public function configure() { $sf_formatter_revisited = new sfWidgetFormSchemaFormatterRevisited($this); $this->getWidgetSchema()->addFormFormatter('Revisited', $sf_formatter_revisited); $this->getWidgetSchema()->setFormFormatterName('Revisited'); $this->setWidget('date', new csWidgetFormDateInput()); $this->getWidget('date')->setLabel(__('Examination date')); $this->setValidator('date', new mtValidatorDateString(array('required' => false))); unset($this['student_repproved_course_subject_id'], $this["examination_repproved_subject_id"]); if (!$this->getObject()->getExaminationRepprovedSubject()->canEditCalifications()) { unset($this["is_absent"]); $this->widgetSchema["mark"] = new mtWidgetFormPlain(array("empty_value" => "Is absent")); $this->widgetSchema["date"] = new mtWidgetFormPlain(array("empty_value" => "-")); $this->getWidget('date')->setLabel(__('Examination date')); } else { $this->widgetSchema->setHelp("mark", "Enter student's mark or mark him as absent."); } $behavior = SchoolBehaviourFactory::getEvaluatorInstance(); $this->validatorSchema["mark"]->setOption("min", $behavior->getMinimumMark()); $this->validatorSchema["mark"]->setOption("max", $behavior->getMaximumMark()); $this->validatorSchema["mark"]->setMessage("min", "Mark should be at least %min%."); $this->validatorSchema["mark"]->setMessage("max", "Mark should be at most %max%."); $this->widgetSchema->setLabel("mark", $this->getObject()->getStudentRepprovedCourseSubject()->getStudent()); $this->validatorSchema->setPostValidator(new sfValidatorCallback(array("callback" => array($this, "validateAbsence")))); }
public function configure() { $sf_formatter_revisited = new sfWidgetFormSchemaFormatterRevisited($this); $this->getWidgetSchema()->addFormFormatter('Revisited', $sf_formatter_revisited); $this->getWidgetSchema()->setFormFormatterName('Revisited'); unset($this['student_repproved_course_subject_id'], $this["examination_repproved_subject_id"]); $configuration = $this->getObject()->getStudentRepprovedCourseSubject()->getCourseSubjectStudent()->getCourseSubject()->getCareerSubjectSchoolYear()->getConfiguration(); if (!$this->getObject()->getExaminationRepprovedSubject()->canEditCalifications()) { unset($this["is_absent"]); $this->widgetSchema["mark"] = new mtWidgetFormPlain(array('object' => $this->getObject(), 'method' => 'getMarkStrByConfig', "empty_value" => "Is absent", 'method_args' => $configuration, 'add_hidden_input' => false), array('class' => 'mark')); } else { $this->widgetSchema->setHelp("mark", "Enter student's mark or mark him as absent."); if (!$configuration->isNumericalMark()) { $letter_mark = LetterMarkPeer::getLetterMarkByValue((int) $this->getObject()->getMark()); $this->setWidget('mark', new sfWidgetFormPropelChoice(array('model' => 'LetterMark', 'add_empty' => true))); if (!is_null($letter_mark)) { $this->setDefault('mark', $letter_mark->getId()); } $this->setValidator('mark', new sfValidatorPropelChoice(array('model' => 'LetterMark', 'required' => false))); } else { $behavior = SchoolBehaviourFactory::getEvaluatorInstance(); $this->validatorSchema["mark"]->setOption("min", $behavior->getMinimumMark()); $this->validatorSchema["mark"]->setOption("max", $behavior->getMaximumMark()); $this->validatorSchema["mark"]->setMessage("min", "Mark should be at least %min%."); $this->validatorSchema["mark"]->setMessage("max", "Mark should be at most %max%."); } } $this->widgetSchema->setLabel("mark", $this->getObject()->getStudentRepprovedCourseSubject()->getStudent()); $this->validatorSchema->setPostValidator(new sfValidatorCallback(array("callback" => array($this, "validateAbsence")))); }
public function executeFinish(sfWebRequest $request, $con = null) { $all_tentative_repproved_students = TentativeRepprovedStudentPeer::doSelectNonDeleted(); $con = is_null($con) ? Propel::getConnection() : $con; try { $con->beginTransaction(); foreach ($all_tentative_repproved_students as $trs) { $student_career_school_year = $trs->getStudentCareerSchoolYear(); $student = $student_career_school_year->getStudent(); SchoolBehaviourFactory::getEvaluatorInstance()->repproveStudent($student, $student_career_school_year, $con); $trs->setIsDeleted(true); $trs->save(); } $con->commit(); } catch (PropelException $e) { $con->rollBack(); } $this->redirect('schoolyear/index'); }
public static function getMinCourseMinuminMark() { return SchoolBehaviourFactory::getEvaluatorInstance()->getMinimumMark(); }
public function close(PropelPDO $con = null) { SchoolBehaviourFactory::getEvaluatorInstance()->closeCourseSubjectStudent($this, $con); }
?> <?php if ($course_subject_students_attendance_day = $student->getCourseSubjectStudentsForCourseTypeAndAttendanceForDay(CourseType::TRIMESTER, $student_career_school_year)) { ?> <?php include_partial('course_subject_trimester', array('student' => $student, 'course_subject_students' => $course_subject_students_attendance_day, 'periods' => $periods, 'has_attendance_for_subject' => false, 'student_career_school_year' => $student_career_school_year)); ?> <?php } ?> <?php if ($division->getYear() == 4) { ?> <?php $introduccion = SchoolBehaviourFactory::getEvaluatorInstance()->getCourseSubjectStudentsForIntroduccion($student, $division->getCareerSchoolYear()); ?> <?php include_partial('introduccion', array('student' => $student, 'course_subject_students' => $introduccion, 'division' => $division, 'student_career_school_year' => $student_career_school_year)); ?> <?php } ?> <?php ?> <?php if ($course_subject_student_attendance_subject = $student->getCourseSubjectStudentsForCourseTypeAndAttendanceForSubject(CourseType::TRIMESTER, $student_career_school_year)) { ?> <?php if ($division->getYear() == 4) {
<?php if (count($course_subject_students_second_q = $student->getCourseSubjectStudentsForBimesterSecondQuaterly($student_career_school_year)) > 0) { ?> <tr> <?php include_partial('th_bimester_tabular', array('division' => $division, 'number' => '2', 'course_subject_students' => $course_subject_students_second_q)); ?> </tr> <?php } ?> <?php $first = true; ?> <?php $historia = SchoolBehaviourFactory::getEvaluatorInstance()->getHistoriaDelArteForSchoolYear($student_career_school_year->getCareerSchoolYear()->getSchoolYear()); ?> <?php $count_marks = 0; ?> <?php foreach ($course_subject_students_second_q as $course_subject_student) { ?> <?php $count_marks = $course_subject_student->getCourseSubject()->countMarks() > $count_marks ? $course_subject_student->getCourseSubject()->countMarks() : $count_marks; ?> <?php } ?> <?php
foreach ($course_subject_students as $course_subject_student) { ?> <tr> <td class="subject"><?php echo $course_subject_student->getCourseSubject()->getCareerSubject()->getSubject(); ?> </td> <?php for ($i = 1; $i <= $marks; $i++) { ?> <?php if ($course_subject_student->getIsNotAverageable()) { ?> <td><?php echo SchoolBehaviourFactory::getEvaluatorInstance()->getExemptString(); ?> </td> <?php } else { ?> <td><?php echo ($mark = $course_subject_student->getMarkFor($i)) ? $mark->getMarkByConfig($course_subject_student->getConfiguration()) : "-"; ?> </td> <?php } ?> <?php }
public function getColor() { return SchoolBehaviourFactory::getEvaluatorInstance()->getColorForCourseSubjectStudentMark($this); }
public function getResultStr() { return SchoolBehaviourFactory::getEvaluatorInstance()->getStudentDisapprovedResultStringShort($this); }
public function getErrorsWithCourseSubjectsStudent($career_school_year) { $c = new Criteria(); $c->add(CareerSchoolYearPeer::ID, $career_school_year->getId()); $c->addJoin(CareerSubjectSchoolYearPeer::CAREER_SCHOOL_YEAR_ID, CareerSchoolYearPeer::ID); $c->addJoin(CareerSubjectSchoolYearPeer::ID, CourseSubjectPeer::CAREER_SUBJECT_SCHOOL_YEAR_ID); $c->addJoin(CourseSubjectStudentPeer::COURSE_SUBJECT_ID, CourseSubjectPeer::ID); $c->add(CourseSubjectStudentPeer::STUDENT_ID, $this->getId()); $c->clearSelectColumns(); $c->addSelectColumn(CareerSubjectSchoolYearPeer::ID); $stmt = CareerSubjectSchoolYearPeer::doSelectStmt($c); //me quedo solo con los IDs de los CareerSubjectSchoolYear $array = $stmt->fetchAll(PDO::FETCH_COLUMN); unset($stmt); //ordeno de mayot a menor arsort($array); //armo un arreglo con las claves de los CareerSubjectSchoolYear->ID y //valor la cantidad de veces que esta adentro del arreglo $array_count = array_count_values($array); unset($array); //Filtro los valores que son menores a 1 $array_filtered = array_filter($array_count, create_function('$each', 'return $each>1;')); CareerSubjectSchoolYearPeer::clearInstancePool(); unset($array_count); if (!empty($array_filtered)) { $array_filtered = SchoolBehaviourFactory::getEvaluatorInstance()->evaluateErrorsWithCareerSubjectSchoolYear($array_filtered); } return $array_filtered; }
* Kimkëlen is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License v2.0 as published by * the Free Software Foundation. * * Kimkëlen is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Kimkëlen. If not, see <http://www.gnu.org/licenses/gpl-2.0.html>. */ ?> <?php $evaluator_instance = SchoolBehaviourFactory::getEvaluatorInstance(); ?> <tbody class="print_body"> <?php $i = 0; ?> <?php foreach ($course_subject->getCourseSubjectStudents() as $course_subject_student) { ?> <?php if ($course_subject_student->getStudent()->getIsRegistered($course_subject->getCareerSubjectSchoolYear()->getCareerSchoolYear()->getSchoolYear())) { ?> <?php $i++; ?> <?php
public function countDisapprovedStudents() { $criteria = $this->getCriteriaForCourseSubjectExamination(); $criteria->add(CourseSubjectStudentExaminationPeer::MARK, SchoolBehaviourFactory::getEvaluatorInstance()->getExaminationNote(), Criteria::LESS_THAN); return CourseSubjectStudentExaminationPeer::doCount($criteria); }
echo __('Average'); ?> </th> <th><?php echo __('Result'); ?> </th> </tr> </thead> <tbody> <?php foreach ($course_subject->getCourseSubjectStudentPathways() as $course_subject_student) { ?> <?php $course_marks_avg = SchoolBehaviourFactory::getEvaluatorInstance()->getMarksAverage($course_subject_student->getRelatedCourseSubjectStudent()); ?> <?php if ($course_subject_student->getMark() >= $evaluator_instance::PATHWAY_PROMOTION_NOTE) { ?> <?php $course_result = __('Approved'); ?> <?php $final_mark = bcdiv($course_subject_student->getMark() + $course_marks_avg, 2, 2); ?> <?php } else { ?> <?php $course_result = __('Dissaproved');
public function getCourseSubjectStudentsForCourseType($student, $course_type, $school_year = null) { $not_in = SchoolBehaviourFactory::getEvaluatorInstance()->getLvmSpecialSubjectIds($school_year); if (is_null($school_year)) { $school_year = SchoolYearPeer::retrieveCurrent(); } $c = new Criteria(); $c->add(CoursePeer::SCHOOL_YEAR_ID, $school_year->getId()); $c->addJoin(CourseSubjectPeer::COURSE_ID, CoursePeer::ID); $c->addJoin(CourseSubjectStudentPeer::COURSE_SUBJECT_ID, CourseSubjectPeer::ID); $c->add(CourseSubjectPeer::CAREER_SUBJECT_SCHOOL_YEAR_ID, $not_in, Criteria::NOT_IN); $c->addJoin(CourseSubjectPeer::CAREER_SUBJECT_SCHOOL_YEAR_ID, CareerSubjectSchoolYearPeer::ID); CareerSubjectSchoolYearPeer::sorted($c); $course_subject_students = $student->getCourseSubjectStudents($c); $results = array(); foreach ($course_subject_students as $css) { if ($css->getCourseSubject()->getCourseType() == $course_type) { $results[] = $css; } } return $results; }
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); } } }
public function save($con = null) { if (is_null($con)) { $con = $this->getConnection(); } try { $con->beginTransaction(); $values = $this->getValues(); $any_change = false; //First check the marks if ($this->canEditMarks()) { foreach ($this->getObject()->getSortedCourseSubjectStudentMarks() as $cssm) { $mark = $values['mark_' . $cssm->getId()]; $configuration = $this->getObject()->getConfiguration(); if (!$configuration->isNumericalMark()) { $letter_mark = LetterMarkPeer::retrieveByPk($mark); if (is_null($letter_mark)) { $mark = null; } else { $mark = $letter_mark->getValue(); } } if ($cssm->getMark() !== $mark) { $cssm->setMark($mark); if ($mark == 0) { $cssm->setIsFree(true); } else { $cssm->setIsFree(false); } $cssm->save($con); $any_change = true; } } if ($any_change && $this->getObject()->areAllMarksClosed()) { //Creo de nuevo el result porque cambiaron las notas $course_result = SchoolBehaviourFactory::getEvaluatorInstance()->getCourseSubjectStudentResult($this->getObject(), $con); $course_result->save($con); if ($course_result instanceof StudentApprovedCourseSubject) { $this->getObject()->setStudentApprovedCourseSubject($course_result); $this->getObject()->save($con); } //Si ya fue procesado el año lectivo, entonces crea si corresponde la materia aprobada o la mesa de examen if ($this->getObject()->getCourseSubject()->getCareerSubjectSchoolYear()->getCareerSchoolYear()->getIsProcessed() && $this->getObject()->getCourseSubject()->getCourse()->getIsClosed()) { SchoolBehaviourFactory::getEvaluatorInstance()->closeCourseSubjectStudent($course_result, $con); } } } //if para la edición de notas en mesas de examen if ($this->canEditExaminationSubject()) { $course_subject_student_examination = $this->getObject()->getLastCourseSubjectStudentExamination(); if (isset($values['course_subject_student_examination_id_' . $course_subject_student_examination->getId() . '_mark']) || isset($values['course_subject_student_examination_id_' . $course_subject_student_examination->getId() . '_is_absent'])) { $mark = $values['course_subject_student_examination_id_' . $course_subject_student_examination->getId() . '_mark']; $is_absent = $values['course_subject_student_examination_id_' . $course_subject_student_examination->getId() . '_is_absent']; $date = $values['course_subject_student_examination_id_' . $course_subject_student_examination->getId() . '_date']; $folio = $values['course_subject_student_examination_id_' . $course_subject_student_examination->getId() . '_folio_number']; if ($mark !== $course_subject_student_examination->getMark() || $is_absent !== $course_subject_student_examination->getIsAbsent()) { $course_subject_student_examination->setExaminationSubject(ExaminationSubjectPeer::retrieveByCourseSubjectStudentExamination($course_subject_student_examination)); $course_subject_student_examination->setMark($mark); $course_subject_student_examination->setIsAbsent($is_absent); $course_subject_student_examination->setDate($date); $course_subject_student_examination->setFolioNumber($folio); $course_subject_student_examination->save($con); SchoolBehaviourFactory::getEvaluatorInstance()->closeCourseSubjectStudentExamination($course_subject_student_examination, $con); } } } /* Esto se habia creado para las previas, pero no tiene sentido editarlas. Lo dejo comentado por si sirve para mas adelante. if ($this->canEditStudentRepprovedCourseSubjects()) { $student_repproved_course_subject = $this->getObject()->getStudentRepprovedCourseSubject(); $student_examination_repproved_subject = $student_repproved_course_subject->getLastStudentExaminationRepprovedSubject(); $mark = $values['student_examination_repproved_subject_' . $student_examination_repproved_subject->getId() .'_mark']; $is_absence_name = 'student_examination_repproved_subject_' . $student_examination_repproved_subject->getId() .'_is_absent'; $is_absence = isset($values[$is_absence_name]) ? $values[$is_absence_name] : null; if ($mark !== $student_examination_repproved_subject->getMark() || $is_absence !== $student_examination_repproved_subject->getIsAbsent()) { $student_examination_repproved_subject->setMark($mark); $student_examination_repproved_subject->setIsAbsence($is_absence); } } */ $con->commit(); } catch (PropelException $e) { $con->rollBack(); throw $e; } }
<?php } ?> <tr> <td class='partial_average'><?php echo __('Average'); ?> </td> <?php foreach ($periods as $period) { ?> <?php if ($period->getIsClosed()) { ?> <td class="td_average"><?php echo SchoolBehaviourFactory::getEvaluatorInstance()->getPartialAverageForQuaterly($course_subject_students, array_search($period, $periods) + 1); ?> </td> <td></td> <td></td> <?php } else { ?> <td></td> <td></td> <td></td> <?php } ?>
/** * Returns the anual average. * * @return float */ public function getAnualAverage() { return SchoolBehaviourFactory::getEvaluatorInstance()->getAnualAverageForStudentCareerSchoolYear($this); }
public function getExaminationTypeStr() { $examinations = SchoolBehaviourFactory::getEvaluatorInstance()->getExaminationNumbersLong(); return $examinations[$this->getExaminationNumber()]; }
public function close(PropelPDO $con = null) { $con = is_null($con) ? Propel::getConnection() : $con; SchoolBehaviourFactory::getEvaluatorInstance()->closeStudentExaminationRepprovedSubject($this, $con); }
public function __toString() { return SchoolBehaviourFactory::getEvaluatorInstance()->getStudentRepprovedResultString($this); }
/** * Counts the repproved course subjects for the given student and career. * * @param Student $student * @param Career $career * @param PropelPDO $con * @return Criteria */ public static function retrieveCriteriaRepprovedForStudentAndCareer(Student $student, Career $career, PropelPDO $con = null) { $c = new Criteria(); $c->add(self::STUDENT_APPROVED_CAREER_SUBJECT_ID, null, Criteria::ISNULL); $c->addJoin(self::COURSE_SUBJECT_STUDENT_ID, CourseSubjectStudentPeer::ID); $c->add(CourseSubjectStudentPeer::STUDENT_ID, $student->getId()); $c->addJoin(CourseSubjectStudentPeer::COURSE_SUBJECT_ID, CourseSubjectPeer::ID); $c->addJoin(CourseSubjectPeer::CAREER_SUBJECT_SCHOOL_YEAR_ID, CareerSubjectSchoolYearPeer::ID); $c->addJoin(CareerSubjectSchoolYearPeer::CAREER_SCHOOL_YEAR_ID, CareerSchoolYearPeer::ID); $c->add(CareerSchoolYearPeer::CAREER_ID, $career->getId()); $excluded_subjects = SchoolBehaviourFactory::getEvaluatorInstance()->getExcludeRepprovedSubjects(); $c->add(CareerSchoolYearPeer::ID, $excluded_subjects, Criteria::NOT_IN); return $c; }
public function areAllExaminationsClosed() { if (count(ExaminationPeer::retrieveForSchoolYearAndExaminationNumber($this, SchoolBehaviourFactory::getEvaluatorInstance()->getFebruaryExaminationNumber())) == 0) { return false; } foreach ($this->getExaminations() as $examination) { if (!$examination->isClosed()) { return false; } } return true; }
public function getMarkStrByConfig($config = null) { if ($this->getIsAbsent()) { return __('A'); } else { if (is_null($config)) { $config = $this->getExaminationSubject()->getCareerSubjectSchoolYear()->getConfiguration(); } if ($this->getMark() != SchoolBehaviourFactory::getEvaluatorInstance()->getMinimumMark()) { if (!is_null($config) && !$config->isNumericalMark()) { $letter_mark = LetterMarkPeer::getLetterMarkByValue($this->getMark()); return $letter_mark->getLetter(); } else { return $this->getMark(); } } } }
<span class="right"><strong><?php echo __('School year'); ?> </strong>: <?php echo $examination_subject->getExamination()->getSchoolYear(); ?> </span> </div> <div class="gray-background"> <span><strong><?php echo __('Course minimun mark'); ?> </strong>: <span><?php echo SchoolBehaviourFactory::getEvaluatorInstance()->getExaminationNote(); ?> </span> </div> <br> <table class="gridtable_bordered"> <thead> <tr class="printColumns"> <th rowspan="2"><?php echo __('N° de Orden'); ?> </th> <th rowspan="2"><?php echo __('Apellido y Nombre'); ?>
protected function getMaximumMark() { return SchoolBehaviourFactory::getEvaluatorInstance()->getMaximumMark(); }
public function getAvailableCourseSubjectStudentMarks(Criteria $criteria = null) { return SchoolBehaviourFactory::getEvaluatorInstance()->getAvailableCourseSubjectStudentMarks($this, $criteria); }