本文整理汇总了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');
}
示例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);
}
示例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();
}
}
示例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;
}
示例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;
}