本文整理汇总了PHP中SchoolBehaviourFactory::getEvaluatorInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP SchoolBehaviourFactory::getEvaluatorInstance方法的具体用法?PHP SchoolBehaviourFactory::getEvaluatorInstance怎么用?PHP SchoolBehaviourFactory::getEvaluatorInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SchoolBehaviourFactory
的用法示例。
在下文中一共展示了SchoolBehaviourFactory::getEvaluatorInstance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: configure
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"))));
}
示例2: configure
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"))));
}
示例3: executeFinish
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');
}
示例4: getMinCourseMinuminMark
public static function getMinCourseMinuminMark()
{
return SchoolBehaviourFactory::getEvaluatorInstance()->getMinimumMark();
}
示例5: close
public function close(PropelPDO $con = null)
{
SchoolBehaviourFactory::getEvaluatorInstance()->closeCourseSubjectStudent($this, $con);
}
示例6: include_partial
?>
<?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) {
示例7: include_partial
<?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
示例8: foreach
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
}
示例9: getColor
public function getColor()
{
return SchoolBehaviourFactory::getEvaluatorInstance()->getColorForCourseSubjectStudentMark($this);
}
示例10: getResultStr
public function getResultStr()
{
return SchoolBehaviourFactory::getEvaluatorInstance()->getStudentDisapprovedResultStringShort($this);
}
示例11: getErrorsWithCourseSubjectsStudent
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;
}
示例12:
* 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
示例13: countDisapprovedStudents
public function countDisapprovedStudents()
{
$criteria = $this->getCriteriaForCourseSubjectExamination();
$criteria->add(CourseSubjectStudentExaminationPeer::MARK, SchoolBehaviourFactory::getEvaluatorInstance()->getExaminationNote(), Criteria::LESS_THAN);
return CourseSubjectStudentExaminationPeer::doCount($criteria);
}
示例14: __
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');
示例15: getCourseSubjectStudentsForCourseType
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;
}