コード例 #1
0
 public static function retrieveByCourseSubjectStudentExamination(CourseSubjectStudentExamination $course_subject_student_examination, $con = null)
 {
     $criteria = new Criteria();
     $criteria->add(self::CAREER_SUBJECT_SCHOOL_YEAR_ID, $course_subject_student_examination->getCourseSubject()->getCareerSubjectSchoolYearId());
     $criteria->addJoin(self::EXAMINATION_ID, ExaminationPeer::ID);
     $criteria->add(ExaminationPeer::EXAMINATION_NUMBER, $course_subject_student_examination->getExaminationNumber());
     $criteria->add(ExaminationPeer::SCHOOL_YEAR_ID, $course_subject_student_examination->getCourseSubject()->getCareerSubjectSchoolYear()->getSchoolYear()->getId());
     return self::doSelectOne($criteria, $con);
 }
コード例 #2
0
 public function getExaminationResult(CourseSubjectStudentExamination $css_examination)
 {
     if ($css_examination->getMark()) {
         if ($css_examination->getMark() < self::EXAMINATION_NOTE) {
             if ($css_examination->getExaminationNumber() < count($this->_examination_number)) {
                 if ($css_examination->getMark() < self::MIN_NOTE && $css_examination->getExaminationNumber() == self::NOVEMBER) {
                     $current = $this->_examination_number[$css_examination->getExaminationNumber()];
                     $next = $this->_examination_number[$css_examination->getExaminationNumber() + 2];
                     return array(strtolower($current), $next);
                 } else {
                     $current = $this->_examination_number[$css_examination->getExaminationNumber()];
                     $next = $this->_examination_number[$css_examination->getExaminationNumber() + 1];
                     return array(strtolower($current), $next);
                 }
             } else {
                 return array(strtolower($this->_examination_number[$css_examination->getExaminationNumber()]), "Previous");
             }
         } else {
             return array("approved", "Approved");
         }
     } else {
         return array("absent", $css_examination->getExaminationNumber() < count($this->_examination_number) ? $this->_examination_number[$css_examination->getExaminationNumber() + 1] : "Previous");
     }
 }
コード例 #3
0
 public function closeCourseSubjectStudentExamination(CourseSubjectStudentExamination $course_subject_student_examination, PropelPDO $con = null)
 {
     $con = is_null($con) ? Propel::getConnection() : $con;
     $course_subject_student = $course_subject_student_examination->getCourseSubjectStudent();
     // si aprueba la mesa de examen
     if ($course_subject_student_examination->getMark() >= self::EXAMINATION_NOTE) {
         $result = StudentApprovedCareerSubjectPeer::retrieveOrCreateByCareerSubjectAndStudent($course_subject_student->getCourseSubject()->getCareerSubjectSchoolYear()->getCareerSubject()->getId(), $course_subject_student->getStudent()->getId());
         $result->setCareerSubject($course_subject_student->getCourseSubject()->getCareerSubjectSchoolYear()->getCareerSubject());
         $result->setStudent($course_subject_student->getStudent());
         $result->setSchoolYear($course_subject_student->getCourseSubject()->getCareerSubjectSchoolYear()->getSchoolYear());
         if (in_array($course_subject_student->getCourseSubject()->getSubject()->getId(), $this->_introduccion)) {
             $average = (string) $course_subject_student_examination->getMark();
         } else {
             $average = (string) (($course_subject_student->getMarksAverage() + $course_subject_student_examination->getMark()) / 2);
         }
         $average = sprintf('%.4s', $average);
         // se guarda la NOTA FINAL de la materia
         if ($this->getCurrentHistoriaDelArte() && $course_subject_student->getCourseSubject()->getCareerSubjectSchoolYearId() == $this->getCurrentHistoriaDelArte()->getId()) {
             $average = $course_subject_student_examination->getMark();
         }
         if ($average < 4) {
             $average = 4;
         }
         $result->setMark($average);
         ##se agrega en la tupla student_disapproved_course_subject el link a al resultado final
         $student_disapproved_course_subject = $course_subject_student->getCourseResult();
         $student_disapproved_course_subject->setStudentApprovedCareerSubject($result);
         $student_disapproved_course_subject->save($con);
         $result->save($con);
         //Se busca si había una previa creada para esta materia, se debe eliminar
         if ($student_repproved_course_subject = StudentRepprovedCourseSubjectPeer::retrieveByCourseSubjectStudent($course_subject_student)) {
             $student_repproved_course_subject->delete($con);
         }
     } else {
         // TODO: arreglar esto: pedir a la configuración
         // Pasa de diciembre a febrero (se copia el course_subject_student_examination con examination_number + 1)
         if ($course_subject_student_examination->getExaminationNumber() < count($this->_examination_number)) {
             $new_course_subject_student_examination = $course_subject_student_examination->copy();
             $new_course_subject_student_examination->setExaminationNumber($course_subject_student_examination->getExaminationNumber() + 1);
             $new_course_subject_student_examination->setMark(null);
             $new_course_subject_student_examination->setExaminationSubjectId(null);
             $new_course_subject_student_examination->setIsAbsent(false);
             $new_course_subject_student_examination->save($con);
         } else {
             // se crea una previa
             $student_repproved_course_subject = StudentRepprovedCourseSubjectPeer::retrieveByCourseSubjectStudent($course_subject_student);
             if (is_null($student_repproved_course_subject)) {
                 $student_repproved_course_subject = new StudentRepprovedCourseSubject();
             }
             $student_repproved_course_subject->setCourseSubjectStudentId($course_subject_student->getId());
             $student_repproved_course_subject->save($con);
         }
     }
 }
コード例 #4
0
 public function getExaminationResult(CourseSubjectStudentExamination $css_examination)
 {
     if ($css_examination->getMark()) {
         if ($css_examination->getMark() < $this->getExaminationNote()) {
             if ($css_examination->getExaminationNumber() < count($this->_examination_number)) {
                 $current = $this->_examination_number[$css_examination->getExaminationNumber()];
                 $next = $this->_examination_number[$css_examination->getExaminationNumber() + 1];
                 return array(strtolower($current), $next);
             } else {
                 return array(strtolower($this->_examination_number[$css_examination->getExaminationNumber()]), "Previous");
             }
         } else {
             return array("approved", "Approved");
         }
     } else {
         return array("absent", $css_examination->getExaminationNumber() < count($this->_examination_number) ? $this->_examination_number[$css_examination->getExaminationNumber() + 1] : "Previous");
     }
 }