Esempio n. 1
0
 public function executeUpdateScore()
 {
     $ss_update_grade = $this->getRequestParameter('student_score_update_grade');
     $ss_update_rem = $this->getRequestParameter('student_score_update_remark');
     $ss_update_cit = $this->getRequestParameter('student_score_update_citation');
     $ss_add_grade = $this->getRequestParameter('student_score_add_grade');
     $ss_add_rem = $this->getRequestParameter('student_score_add_remark');
     $ss_add_cit = $this->getRequestParameter('student_score_add_citation');
     $subject_accal_id = $this->getRequestParameter('subject_accal_id');
     $class_group_id = $this->getRequestParameter('class_group_id');
     $this->forward404Unless($subject_accal_id);
     foreach ($ss_update_grade as $ss_id => $ss_grade) {
         if ($ss_grade) {
             $ss = StudentScorePeer::retrieveByPK($ss_id);
             $ss->setGrade($ss_grade);
             if ($ss_update_rem[$ss_id]) {
                 $ss->setRemark($ss_update_rem[$ss_id]);
             } else {
                 $ss->setRemark('');
             }
             if ($ss_update_cit[$ss_id]) {
                 $ss->setCitationId($ss_update_cit[$ss_id]);
             } else {
                 $ss->setCitationId('');
             }
             $ss->save();
         }
     }
     foreach ($ss_add_grade as $sc_id => $grade_comps) {
         foreach ($grade_comps as $gc_id => $grade) {
             if ($grade > 0) {
                 $ss = new StudentScore();
                 $ss->setStudentCourseId($sc_id);
                 $ss->setGradeComponentId($gc_id);
                 $ss->setGrade($grade);
                 if ($ss_add_rem[$sc_id][$gc_id]) {
                     $ss->setRemark($ss_add_rem[$sc_id][$gc_id]);
                 }
                 if ($ss_add_cit[$sc_id][$gc_id]) {
                     $ss->setCitationId($ss_add_cit[$sc_id][$gc_id]);
                 }
                 $ss->save();
             }
         }
     }
     return $this->redirect('subject_accal_l/editScore?subject_accal_id=' . $subject_accal_id . '&class_group_id=' . $class_group_id);
 }
Esempio n. 2
0
 public function addStudentScore(StudentScore $l)
 {
     $this->collStudentScores[] = $l;
     $l->setGradeComponent($this);
 }
Esempio n. 3
0
 public function addStudentScore(StudentScore $l)
 {
     $this->collStudentScores[] = $l;
     $l->setStudentCourse($this);
 }
Esempio n. 4
0
 public function addStudentScore(StudentScore $l)
 {
     $this->collStudentScores[] = $l;
     $l->setCitation($this);
 }