public function actionDefault()
 {
     $check = GradingLevels::model()->findAllByAttributes(array('batch_id' => $_REQUEST['id']));
     foreach ($check as $check1) {
         $check1->delete();
     }
     for ($i = 1; $i < 7; $i++) {
         $model = GradingLevels::model()->findByPk($i);
         $model->batch_id = $_REQUEST['id'];
         $new = new GradingLevels();
         $new->attributes = $model->attributes;
         $new->save();
     }
     $this->redirect(array('/courses/gradingLevels', 'id' => $_REQUEST['id']));
 }
示例#2
0
?>
</th>
                        <th><?php 
echo Yii::t('parentportal', 'Result');
?>
</th>
                    </tr>
                    <?php 
if ($exam == NULL) {
    echo '<tr><td align="center" colspan="4"><i>' . Yii::t('parentportal', 'No Assessments') . '</i></td></tr>';
} else {
    $displayed_flag = '';
    foreach ($exam as $exams) {
        $exm = Exams::model()->findByAttributes(array('id' => $exams->exam_id));
        $group = ExamGroups::model()->findByAttributes(array('id' => $exm->exam_group_id, 'result_published' => 1));
        $grades = GradingLevels::model()->findAllByAttributes(array('batch_id' => $exams->grading_level_id));
        $t = count($grades);
        if ($group != NULL and count($group) > 0) {
            echo '<tr>';
            if ($exm != NULL) {
                $displayed_flag = 1;
                //$group=ExamGroups::model()->findByAttributes(array('id'=>$exm->exam_group_id));
                echo '<td>' . $group->name . '</td>';
                $sub = Subjects::model()->findByAttributes(array('id' => $exm->subject_id));
                if ($sub->elective_group_id != 0 and $sub->elective_group_id != NULL) {
                    $student_elective = StudentElectives::model()->findByAttributes(array('student_id' => $student->id));
                    if ($student_elective != NULL) {
                        $electname = Electives::model()->findByAttributes(array('id' => $student_elective->elective_id, 'elective_group_id' => $sub->elective_group_id));
                        if ($electname != NULL) {
                            echo '<td>' . $electname->name . '</td>';
                        }
示例#3
0
                 if ($grade->min_score > $current_max) {
                     $grade_value = $grade->name;
                     $current_max = $grade->min_score;
                 }
             } else {
                 $t--;
                 continue;
             }
             $grd = 1;
         }
         echo $grade_value;
         if ($t <= 0) {
             $glevel = " No Grades";
         }
     } else {
         $grades = GradingLevels::model()->findAllByAttributes(array('batch_id' => NULL));
         $i = count($grades);
         foreach ($grades as $grade) {
             if ($grade->min_score <= $score->marks) {
                 echo $grade->name;
                 break;
             } else {
                 $i--;
                 continue;
             }
         }
         if ($i <= 0) {
             echo 'No Grades';
         }
     }
 } else {
        // $message .= ucfirst($student->first_name).'  '.ucfirst($student->middle_name).'  '.ucfirst($student->last_name) . "\r\n";
        // echo ucfirst($student->first_name).'  '.ucfirst($student->middle_name).'  '.ucfirst($student->last_name);
        ?>
					
                    <?php 
        $total = 0;
        $total_of_max_marks = 0;
        $result = "PASS";
        $result_r = "";
        foreach ($exams as $exam) {
            $score = ExamScores::model()->findByAttributes(array('student_id' => $student->id, 'exam_id' => $exam->id));
            $subject = Subjects::model()->findByAttributes(array('id' => $exam->subject_id));
            $examgroup = ExamGroups::model()->findByAttributes(array('id' => $exam->exam_group_id));
            $examname = $examgroup->name;
            if ($score->marks != NULL or $score->remarks != NULL) {
                $grades = GradingLevels::model()->findAllByAttributes(array('batch_id' => $_REQUEST['id']));
                $t = count($grades);
                if ($examgroup->exam_type == 'Marks') {
                    if ($score->marks != NULL) {
                        // echo $score->marks;
                        $message .= $subject->name . ' :' . $score->marks . "\r\n";
                        $result_r .= $subject->name . ': ' . round($score->marks) . '/' . round($exam->maximum_marks) . ";";
                        $total += round($score->marks);
                        $total_of_max_marks += round($exam->maximum_marks);
                        // if($score->is_failed == 1){ $result = 'FAIL'; }
                    } else {
                        $result_r .= "-";
                    }
                } else {
                    if ($examgroup->exam_type == 'Grades') {
                        $grd = 1;
示例#5
0
 public function GetGradinglevel($data, $row)
 {
     $grade = GradingLevels::model()->findAllByAttributes(array('batch_id' => $data->grading_level_id));
     $i = count($grade);
     foreach ($grade as $grade1) {
         if ($grade1->min_score <= $data->marks) {
             return $grade1->name;
         } else {
             $i--;
             continue;
         }
     }
     if ($i <= 0) {
         return 'No Grades';
     }
 }