public function getLastStudentExaminationRepprovedSubject()
 {
     $c = new Criteria();
     $c->addDescendingOrderByColumn(StudentExaminationRepprovedSubjectPeer::ID);
     $c->add(StudentExaminationRepprovedSubjectPeer::STUDENT_REPPROVED_COURSE_SUBJECT_ID, $this->getId());
     return StudentExaminationRepprovedSubjectPeer::doSelectOne($c);
 }
Пример #2
0
 public function executeComponent_marks_info()
 {
     $this->course_subject_student = $this->getVar('course_subject_student');
     $this->marks = $this->course_subject_student->getAvailableCourseSubjectStudentMarks();
     $c = new Criteria();
     $c->add(CourseSubjectStudentExaminationPeer::COURSE_SUBJECT_STUDENT_ID, $this->course_subject_student->getId());
     $criterion = $c->getNewCriterion(CourseSubjectStudentExaminationPeer::MARK, null, Criteria::ISNOTNULL);
     $criterion->addOr($c->getNewCriterion(CourseSubjectStudentExaminationPeer::IS_ABSENT, true));
     $c->add($criterion);
     $c->addAscendingOrderByColumn(CourseSubjectStudentExaminationPeer::EXAMINATION_NUMBER);
     $this->course_subject_student_examinations = CourseSubjectStudentExaminationPeer::doSelect($c);
     $c = new Criteria();
     $c->add(StudentRepprovedCourseSubjectPeer::COURSE_SUBJECT_STUDENT_ID, $this->course_subject_student->getId() . Criteria::INNER_JOIN);
     $c->addJoin(StudentExaminationRepprovedSubjectPeer::STUDENT_REPPROVED_COURSE_SUBJECT_ID, StudentRepprovedCourseSubjectPeer::ID, Criteria::INNER_JOIN);
     $c->addJoin(StudentExaminationRepprovedSubjectPeer::EXAMINATION_REPPROVED_SUBJECT_ID, ExaminationRepprovedSubjectPeer::ID, Criteria::INNER_JOIN);
     $c->addJoin(ExaminationRepprovedSubjectPeer::EXAMINATION_REPPROVED_ID, ExaminationRepprovedPeer::ID, Criteria::INNER_JOIN);
     $c->addAscendingOrderByColumn(ExaminationRepprovedPeer::EXAMINATION_NUMBER);
     $criterion = $c->getNewCriterion(StudentExaminationRepprovedSubjectPeer::MARK, null, Criteria::ISNOTNULL);
     $criterion->addOr($c->getNewCriterion(StudentExaminationRepprovedSubjectPeer::IS_ABSENT, true));
     $c->add($criterion);
     $this->student_examination_repproved_subjects = StudentExaminationRepprovedSubjectPeer::doSelect($c);
     //$this->pathway_mark = $this->course_subject_student->getCourseSubjectStudentPathwayMark()->getMark();
 }
 public static function retrieveApprovationDate(StudentApprovedCareerSubject $studentApprovedCareerSubject)
 {
     $approvationInstance = $studentApprovedCareerSubject->getApprovationInstance();
     switch (get_class($approvationInstance)) {
         case 'StudentApprovedCourseSubject':
             $period = $approvationInstance->getCourseSubject()->getLastCareerSchoolYearPeriod();
             if (!is_null($period)) {
                 return $period->getEndAt();
             }
             break;
         case 'StudentDisapprovedCourseSubject':
             $cssid = $approvationInstance->getCourseSubjectStudentId();
             $csse = CourseSubjectStudentExaminationPeer::retrieveLastByCourseSubjectStudentId($cssid);
             $exam = $csse->getExaminationSubject()->getExamination();
             return $exam->getDateFrom();
         case 'StudentRepprovedCourseSubject':
             $sers = StudentExaminationRepprovedSubjectPeer::retrieveByStudentRepprovedCourseSubject($approvationInstance);
             $exam = $sers->getExaminationRepprovedSubject()->getExaminationRepproved();
             return $exam->getDateFrom();
     }
     //couldn't find when was approved. return null ¿error?
     return;
 }
 public function countAbsenceStudents()
 {
     $criteria = $this->getCriteriaForExaminationRepprovedExaminationStudent();
     $criteria->add(StudentExaminationRepprovedSubjectPeer::IS_ABSENT, true);
     return StudentExaminationRepprovedSubjectPeer::doCount($criteria);
 }
Пример #5
0
 public function pathwayClose(PropelPDO $con)
 {
     foreach ($this->getCourseSubjectStudentPathways() as $course_subject_student_pathway) {
         $evaluator_instance = SchoolBehaviourFactory::getEvaluatorInstance();
         if ($course_subject_student_pathway->getMark() >= $evaluator_instance->getPathwayPromotionNote()) {
             $original_course_subject_student = $course_subject_student_pathway->getRelatedCourseSubjectStudent();
             //$final_mark = $course_subject_student_pathway->getMark();
             $course_marks_avg = SchoolBehaviourFactory::getEvaluatorInstance()->getMarksAverage($original_course_subject_student, $con);
             $final_mark = bcdiv($course_subject_student_pathway->getMark() + $course_marks_avg, 2, 2);
             $sacs = new StudentApprovedCareerSubject();
             $sacs->setCareerSubject($this->getCareerSubjectSchoolYear()->getCareerSubject());
             $sacs->setMark($final_mark);
             $sacs->setStudent($course_subject_student_pathway->getStudent());
             $sacs->setSchoolYear($this->getCourse()->getSchoolYear());
             $original_course_subject_student->getCourseResult()->setStudentApprovedCareerSubject($sacs);
             $original_course_subject_student->save($con);
             $srcs = StudentRepprovedCourseSubjectPeer::retrieveByCourseSubjectStudent($original_course_subject_student);
             if (is_null($srcs)) {
                 $srcs = new StudentRepprovedCourseSubject();
                 $srcs->setCourseSubjectStudent($original_course_subject_student);
             }
             $srcs->setStudentApprovedCareerSubject($sacs);
             $srcs->save($con);
             $sers = StudentExaminationRepprovedSubjectPeer::retrieveByStudentRepprovedCourseSubject($srcs);
             // TODO: pongo en blanco la referencia a una mesa de previa??
             if (is_null($sers)) {
                 $sers = new StudentExaminationRepprovedSubject();
                 $sers->setStudentRepprovedCourseSubject($srcs);
             }
             $sers->setMark($course_subject_student_pathway->getMark());
             $sers->setExaminationRepprovedSubject(null);
             $sers->save($con);
         }
     }
 }