当前位置: 首页>>代码示例>>PHP>>正文


PHP ilObjTest::areObligationsEnabled方法代码示例

本文整理汇总了PHP中ilObjTest::areObligationsEnabled方法的典型用法代码示例。如果您正苦于以下问题:PHP ilObjTest::areObligationsEnabled方法的具体用法?PHP ilObjTest::areObligationsEnabled怎么用?PHP ilObjTest::areObligationsEnabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ilObjTest的用法示例。


在下文中一共展示了ilObjTest::areObligationsEnabled方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: saveOrderAndObligationsObject

 public function saveOrderAndObligationsObject()
 {
     global $ilAccess;
     if (!$ilAccess->checkAccess("write", "", $this->ref_id)) {
         // allow only write access
         ilUtil::sendInfo($this->lng->txt("cannot_edit_test"), true);
         $this->ctrl->redirect($this, "infoScreen");
     }
     global $ilCtrl;
     $orders = $obligations = array();
     foreach ($_REQUEST['order'] as $qId => $order) {
         $id = (int) str_replace('q_', '', $qId);
         $orders[$id] = $order;
     }
     if ($this->object->areObligationsEnabled() && isset($_REQUEST['obligatory']) && is_array($_REQUEST['obligatory'])) {
         foreach ($_REQUEST['obligatory'] as $qId => $obligation) {
             $id = (int) str_replace('q_', '', $qId);
             if (ilObjTest::isQuestionObligationPossible($id)) {
                 $obligations[$id] = $obligation;
             }
         }
     }
     $this->object->setQuestionOrderAndObligations($orders, $obligations);
     $ilCtrl->redirect($this, 'questions');
 }
开发者ID:bheyser,项目名称:qplskl,代码行数:25,代码来源:class.ilObjTestGUI.php

示例2: getFinalStatement

 /**
  * Returns the final statement for a user
  *
  * @param array An array containing the information on reached points, max points etc. ("test" key of ilObjTest::getTestResult)
  * @return string HTML code of the final statement
  * @access public
  */
 function getFinalStatement($active_id)
 {
     $test_data_array = $this->object->getResultsForActiveId($active_id);
     $obligationsAnswered = $test_data_array['obligations_answered'];
     if (!$test_data_array["max_points"]) {
         $percentage = 0;
     } else {
         $percentage = $test_data_array["reached_points"] / $test_data_array["max_points"] * 100;
     }
     $total_max = $test_data_array["max_points"];
     $total_reached = $test_data_array["reached_points"];
     $result_percentage = $percentage;
     $result_total_reached = $total_reached;
     $result_total_max = $total_max;
     $mark = "";
     $markects = "";
     $mark_obj = $this->object->mark_schema->getMatchingMark($result_percentage);
     if ($mark_obj) {
         require_once './Modules/Test/classes/class.ilTestFinalMarkLangVarBuilder.php';
         $langVarBuilder = new ilTestFinalMarkLangVarBuilder($mark_obj->getPassed(), $obligationsAnswered, $this->object->areObligationsEnabled());
         $mark = $this->lng->txt($langVarBuilder->build());
         $mark = str_replace("[mark]", $mark_obj->getOfficialName(), $mark);
         $mark = str_replace("[markshort]", $mark_obj->getShortName(), $mark);
         $mark = str_replace("[percentage]", sprintf("%.2f", $result_percentage), $mark);
         $mark = str_replace("[reached]", $result_total_reached, $mark);
         $mark = str_replace("[max]", $result_total_max, $mark);
     }
     if ($this->object->ects_output) {
         $passed_array =& $this->object->getTotalPointsPassedArray();
         $ects_mark = $this->object->getECTSGrade($passed_array, $result_total_reached, $result_total_max);
         $markects = $this->lng->txt("mark_tst_ects");
         $markects = str_replace("[markects]", $this->lng->txt("ects_grade_" . strtolower($ects_mark)), $markects);
     }
     return array("mark" => $mark, "markects" => $markects);
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:42,代码来源:class.ilTestServiceGUI.php

示例3: build

 public function build()
 {
     $this->initTemplate();
     $this->loadResultData();
     if ($this->testOBJ->isShowGradingStatusEnabled()) {
         $this->populateGradingStatus();
     }
     if ($this->testOBJ->areObligationsEnabled()) {
         $this->populateObligationsStatus();
     }
     if ($this->testOBJ->isShowGradingMarkEnabled()) {
         $this->populateGradingMark();
     }
     if ($this->testOBJ->getECTSOutput()) {
         $this->populateEctsGrade();
     }
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:17,代码来源:class.ilTestGradingMessageBuilder.php

示例4: isGradingMessageRequired

 protected function isGradingMessageRequired()
 {
     if ($this->object->isShowGradingStatusEnabled()) {
         return true;
     }
     if ($this->object->isShowGradingMarkEnabled()) {
         return true;
     }
     if ($this->object->areObligationsEnabled()) {
         return true;
     }
     return false;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:13,代码来源:class.ilTestServiceGUI.php

示例5: isGradingMessageRequired

 protected function isGradingMessageRequired()
 {
     if ($this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) {
         return false;
     }
     if ($this->object->isShowGradingStatusEnabled()) {
         return true;
     }
     if ($this->object->isShowGradingMarkEnabled()) {
         return true;
     }
     if ($this->object->areObligationsEnabled()) {
         return true;
     }
     return false;
 }
开发者ID:bheyser,项目名称:qplskl,代码行数:16,代码来源:class.ilTestServiceGUI.php


注:本文中的ilObjTest::areObligationsEnabled方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。