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


PHP ilObjTest::isQuestionObligatory方法代码示例

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


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

示例1: array

 function &getSequenceSummary($obligationsFilter = false)
 {
     $correctedsequence = $this->getCorrectedSequence();
     $result_array = array();
     include_once "./Modules/Test/classes/class.ilObjTest.php";
     $solved_questions = ilObjTest::_getSolvedQuestions($this->active_id);
     $key = 1;
     foreach ($correctedsequence as $sequence) {
         $question =& ilObjTest::_instanciateQuestion($this->getQuestionForSequence($sequence));
         if (is_object($question)) {
             $worked_through = $question->_isWorkedThrough($this->active_id, $question->getId(), $this->pass);
             $solved = 0;
             if (array_key_exists($question->getId(), $solved_questions)) {
                 $solved = $solved_questions[$question->getId()]["solved"];
             }
             $is_postponed = $this->isPostponedQuestion($question->getId());
             $row = array("nr" => "{$key}", "title" => $question->getTitle(), "qid" => $question->getId(), "visited" => $worked_through, "solved" => $solved ? "1" : "0", "description" => $question->getComment(), "points" => $question->getMaximumPoints(), "worked_through" => $worked_through, "postponed" => $is_postponed, "sequence" => $sequence, "obligatory" => ilObjTest::isQuestionObligatory($question->getId()), 'isAnswered' => $question->isAnswered($this->active_id, $this->pass));
             if (!$obligationsFilter || $row['obligatory']) {
                 array_push($result_array, $row);
             }
             $key++;
         }
     }
     return $result_array;
 }
开发者ID:bheyser,项目名称:qplskl,代码行数:25,代码来源:class.ilTestSequence.php

示例2: outWorkingForm


//.........这里部分代码省略.........
         $this->tpl->setVariable("FORMACTION", $formaction);
         $directfeedback = true;
     } else {
         // Answer specific feedback is rendered into the display of the test question with in the concrete question types outQuestionForTest-method.
         // Notation of the params prior to getting rid of this crap in favor of a class
         $question_gui->outQuestionForTest($formaction, $this->testSession->getActiveId(), NULL, $is_postponed, $user_post_solution, $answer_feedback);
         // The display of specific inline feedback and specific feedback in an own block is to honor questions, which
         // have the possibility to embed the specific feedback into their output while maintaining compatibility to
         // questions, which do not have such facilities. E.g. there can be no "specific inline feedback" for essay
         // questions, while the multiple-choice questions do well.
         $this->fillQuestionRelatedNavigation($question_gui);
     }
     if ($directfeedback) {
         // This controls if the solution should be shown.
         // It gets the parameter "Scoring and Results" -> "Instant Feedback" -> "Show Solutions"
         if ($this->object->getInstantFeedbackSolution()) {
             $show_question_inline_score = $this->determineInlineScoreDisplay();
             // Notation of the params prior to getting rid of this crap in favor of a class
             $solutionoutput = $question_gui->getSolutionOutput($this->testSession->getActiveId(), NULL, FALSE, $show_question_inline_score, FALSE, FALSE, TRUE, FALSE, FALSE);
             $this->populateSolutionBlock($solutionoutput);
         }
         // This controls if the score should be shown.
         // It gets the parameter "Scoring and Results" -> "Instant Feedback" -> "Show Results (Only Points)"
         if ($this->object->getAnswerFeedbackPoints()) {
             $reachedPoints = $question_gui->object->getAdjustedReachedPoints($this->testSession->getActiveId(), NULL);
             $maxPoints = $question_gui->object->getMaximumPoints();
             $this->populateScoreBlock($reachedPoints, $maxPoints);
         }
         // This controls if the generic feedback should be shown.
         // It gets the parameter "Scoring and Results" -> "Instant Feedback" -> "Show Solutions"
         if ($this->object->getGenericAnswerFeedback()) {
             $this->populateGenericFeedbackBlock($question_gui);
         }
         // This controls if the specific feedback should be shown.
         // It gets the parameter "Scoring and Results" -> "Instant Feedback" -> "Show Answer-Specific Feedback"
         if ($this->object->getSpecificAnswerFeedback()) {
             $this->populateSpecificFeedbackBlock($question_gui);
         }
     }
     $this->populatePreviousButtons($sequence);
     if ($postpone_allowed && !$is_postponed) {
         $this->populatePostponeButtons();
     }
     if ($this->object->getListOfQuestions()) {
         $this->populateSummaryButtons();
     }
     if ($this->object->getShowCancel()) {
         $this->populateCancelButtonBlock();
     }
     if ($this->isLastQuestionInSequence($question_gui)) {
         if ($this->object->getListOfQuestionsEnd()) {
             $this->populateNextButtonsLeadingToSummary();
         } else {
             $this->populateNextButtonsLeadingToEndOfTest();
         }
     } else {
         $this->populateNextButtonsLeadingToQuestion();
     }
     if ($this->object->getShowMarker()) {
         include_once "./Modules/Test/classes/class.ilObjTest.php";
         $solved_array = ilObjTest::_getSolvedQuestions($this->testSession->getActiveId(), $question_gui->object->getId());
         $solved = 0;
         if (count($solved_array) > 0) {
             $solved = array_pop($solved_array);
             $solved = $solved["solved"];
         }
         if ($solved == 1) {
             $this->populateQuestionMarkingBlockAsMarked();
         } else {
             $this->populateQuestionMarkingBlockAsUnmarked();
         }
     }
     $this->populateCharSelector();
     if ($this->object->getJavaScriptOutput()) {
         $this->tpl->setVariable("JAVASCRIPT_TITLE", $this->lng->txt("disable_javascript"));
         $this->ctrl->setParameter($this, "tst_javascript", "0");
         $this->tpl->setVariable("JAVASCRIPT_URL", $this->ctrl->getLinkTarget($this, "gotoQuestion"));
     } else {
         $this->tpl->setVariable("JAVASCRIPT_TITLE", $this->lng->txt("enable_javascript"));
         $this->ctrl->setParameter($this, "tst_javascript", "1");
         $this->tpl->setVariable("JAVASCRIPT_URL", $this->ctrl->getLinkTarget($this, "gotoQuestion"));
     }
     if ($question_gui->object->requiresJsSwitch() && !$this->object->getForceJS()) {
         $this->tpl->touchBlock("jsswitch");
     }
     $this->tpl->addJavaScript(ilUtil::getJSLocation("autosave.js", "Modules/Test"));
     $this->tpl->setVariable("AUTOSAVE_URL", $this->ctrl->getFormAction($this, "autosave", "", true));
     if ($question_gui->isAutosaveable() && $this->object->getAutosave()) {
         $this->tpl->touchBlock('autosave');
         //$this->tpl->setVariable("BTN_SAVE", "Zwischenspeichern");
         //$this->tpl->setVariable("CMD_SAVE", "gotoquestion_{$sequence}");
         //$this->tpl->setVariable("AUTOSAVEFORMACTION", str_replace("&", "&", $this->ctrl->getFormAction($this)));
         $this->tpl->setVariable("AUTOSAVEFORMACTION", str_replace("&", "&", $this->ctrl->getLinkTarget($this, "autosave")));
         $this->tpl->setVariable("AUTOSAVEINTERVAL", $this->object->getAutosaveIval());
     }
     if ($this->object->areObligationsEnabled() && ilObjTest::isQuestionObligatory($question_gui->object->getId())) {
         $this->tpl->touchBlock('question_obligatory');
         $this->tpl->setVariable('QUESTION_OBLIGATORY', $this->lng->txt('required_field'));
     }
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:101,代码来源:class.ilTestOutputGUI.php

示例3: calculateResultsFromSolution

 /**
  * Calculates the question results from a previously saved question solution
  *
  * @final
  * @global ilDB $ilDB
  * @global ilObjUser $ilUser
  * @param integer $active_id Active id of the user
  * @param integer $pass Test pass
  */
 public final function calculateResultsFromSolution($active_id, $pass = NULL, $obligationsEnabled = false)
 {
     global $ilDB, $ilUser;
     if (is_null($pass)) {
         include_once "./Modules/Test/classes/class.ilObjTest.php";
         $pass = ilObjTest::_getPass($active_id);
     }
     // determine reached points for submitted solution
     $reached_points = $this->calculateReachedPoints($active_id, $pass);
     // deduct points for requested hints from reached points
     require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintTracking.php';
     $questionHintTracking = new ilAssQuestionHintTracking($this->getId(), $active_id, $pass);
     $requestsStatisticData = $questionHintTracking->getRequestStatisticDataByQuestionAndTestpass();
     $reached_points = $reached_points - $requestsStatisticData->getRequestsPoints();
     // adjust reached points regarding to tests scoring options
     $reached_points = $this->adjustReachedPointsByScoringOptions($reached_points, $active_id, $pass);
     if ($obligationsEnabled && ilObjTest::isQuestionObligatory($this->getId())) {
         $isAnswered = $this->isAnswered($active_id, $pass);
     } else {
         $isAnswered = true;
     }
     if (is_null($reached_points)) {
         $reached_points = 0;
     }
     $this->getProcessLocker()->requestUserQuestionResultUpdateLock();
     $query = "\n\t\t\tDELETE FROM\t\ttst_test_result\n\t\t\t\n\t\t\tWHERE\t\t\tactive_fi = %s\n\t\t\tAND\t\t\t\tquestion_fi = %s\n\t\t\tAND\t\t\t\tpass = %s\n\t\t";
     $types = array('integer', 'integer', 'integer');
     $values = array($active_id, $this->getId(), $pass);
     if ($this->getStep() !== NULL) {
         $query .= "\n\t\t\t\tAND\t\t\t\tstep = %s\n\t\t\t";
         $types[] = 'integer';
         $values[] = $this->getStep();
     }
     $affectedRows = $ilDB->manipulateF($query, $types, $values);
     $next_id = $ilDB->nextId("tst_test_result");
     $fieldData = array('test_result_id' => array('integer', $next_id), 'active_fi' => array('integer', $active_id), 'question_fi' => array('integer', $this->getId()), 'pass' => array('integer', $pass), 'points' => array('float', $reached_points), 'tstamp' => array('integer', time()), 'hint_count' => array('integer', $requestsStatisticData->getRequestsCount()), 'hint_points' => array('float', $requestsStatisticData->getRequestsPoints()), 'answered' => array('integer', $isAnswered));
     if ($this->getStep() !== NULL) {
         $fieldData['step'] = array('integer', $this->getStep());
     }
     $ilDB->insert('tst_test_result', $fieldData);
     $this->getProcessLocker()->releaseUserQuestionResultUpdateLock();
     include_once "./Modules/Test/classes/class.ilObjAssessmentFolder.php";
     if (ilObjAssessmentFolder::_enabledAssessmentLogging()) {
         $this->logAction(sprintf($this->lng->txtlng("assessment", "log_user_answered_question", ilObjAssessmentFolder::_getLogLanguage()), $reached_points), $active_id, $this->getId());
     }
     // update test pass results
     $this->_updateTestPassResults($active_id, $pass, $obligationsEnabled, $this->getProcessLocker());
     // Update objective status
     include_once 'Modules/Course/classes/class.ilCourseObjectiveResult.php';
     ilCourseObjectiveResult::_updateObjectiveResult($ilUser->getId(), $active_id, $this->getId());
 }
开发者ID:bheyser,项目名称:qplskl,代码行数:60,代码来源:class.assQuestion.php

示例4: outWorkingForm


//.........这里部分代码省略.........
     }
     // Answer specific feedback is rendered into the display of the test question with in the concrete question types outQuestionForTest-method.
     // Notation of the params prior to getting rid of this crap in favor of a class
     $question_gui->outQuestionForTest($formaction, $this->testSession->getActiveId(), NULL, $is_postponed, $user_post_solution, $answer_feedback);
     // The display of specific inline feedback and specific feedback in an own block is to honor questions, which
     // have the possibility to embed the specific feedback into their output while maintaining compatibility to
     // questions, which do not have such facilities. E.g. there can be no "specific inline feedback" for essay
     // questions, while the multiple-choice questions do well.
     $this->fillQuestionRelatedNavigation($question_gui);
     if ($directfeedback) {
         // This controls if the solution should be shown.
         // It gets the parameter "Scoring and Results" -> "Instant Feedback" -> "Show Solutions"
         if ($this->object->getInstantFeedbackSolution()) {
             $show_question_inline_score = $this->determineInlineScoreDisplay();
             // Notation of the params prior to getting rid of this crap in favor of a class
             $solutionoutput = $question_gui->getSolutionOutput($this->testSession->getActiveId(), NULL, TRUE, $show_question_inline_score, FALSE, FALSE, TRUE, FALSE, FALSE);
             $this->populateSolutionBlock($solutionoutput);
         }
         // This controls if the score should be shown.
         // It gets the parameter "Scoring and Results" -> "Instant Feedback" -> "Show Results (Only Points)"
         if ($this->object->getAnswerFeedbackPoints()) {
             $reachedPoints = $question_gui->object->getAdjustedReachedPoints($this->testSession->getActiveId(), NULL);
             $maxPoints = $question_gui->object->getMaximumPoints();
             $this->populateScoreBlock($reachedPoints, $maxPoints);
         }
         // This controls if the generic feedback should be shown.
         // It gets the parameter "Scoring and Results" -> "Instant Feedback" -> "Show Solutions"
         if ($this->object->getGenericAnswerFeedback()) {
             $this->populateGenericFeedbackBlock($question_gui);
         }
         // This controls if the specific feedback should be shown.
         // It gets the parameter "Scoring and Results" -> "Instant Feedback" -> "Show Answer-Specific Feedback"
         if ($this->object->getSpecificAnswerFeedback()) {
             $this->populateSpecificFeedbackBlock($question_gui);
         }
     }
     $this->populatePreviousButtons($this->testSession->getCurrentQuestionId());
     if ($postpone_allowed) {
         $this->populatePostponeButtons();
     }
     if ($this->object->getShowCancel()) {
         $this->populateCancelButtonBlock();
     }
     if ($this->isLastQuestionInSequence($question_gui)) {
         if ($this->object->getListOfQuestionsEnd()) {
             $this->populateNextButtonsLeadingToSummary();
         } else {
             $this->populateNextButtonsLeadingToEndOfTest();
         }
     } else {
         $this->populateNextButtonsLeadingToQuestion();
     }
     if ($this->dynamicQuestionSetConfig->isTaxonomyFilterEnabled()) {
         $this->populateQuestionSelectionButtons();
     }
     if ($this->object->getShowMarker()) {
         include_once "./Modules/Test/classes/class.ilObjTest.php";
         $solved_array = ilObjTest::_getSolvedQuestions($this->testSession->getActiveId(), $question_gui->object->getId());
         $solved = 0;
         if (count($solved_array) > 0) {
             $solved = array_pop($solved_array);
             $solved = $solved["solved"];
         }
         if ($solved == 1) {
             $this->populateQuestionMarkingBlockAsMarked();
         } else {
             $this->populateQuestionMarkingBlockAsUnmarked();
         }
     }
     if ($this->object->getJavaScriptOutput()) {
         $this->tpl->setVariable("JAVASCRIPT_IMAGE", ilUtil::getImagePath("javascript_disable.png"));
         $this->tpl->setVariable("JAVASCRIPT_IMAGE_ALT", $this->lng->txt("disable_javascript"));
         $this->tpl->setVariable("JAVASCRIPT_IMAGE_TITLE", $this->lng->txt("disable_javascript"));
         $this->ctrl->setParameter($this, "tst_javascript", "0");
         $this->tpl->setVariable("JAVASCRIPT_URL", $this->ctrl->getLinkTarget($this, "gotoQuestion"));
     } else {
         $this->tpl->setVariable("JAVASCRIPT_IMAGE", ilUtil::getImagePath("javascript.png"));
         $this->tpl->setVariable("JAVASCRIPT_IMAGE_ALT", $this->lng->txt("enable_javascript"));
         $this->tpl->setVariable("JAVASCRIPT_IMAGE_TITLE", $this->lng->txt("enable_javascript"));
         $this->ctrl->setParameter($this, "tst_javascript", "1");
         $this->tpl->setVariable("JAVASCRIPT_URL", $this->ctrl->getLinkTarget($this, "gotoQuestion"));
     }
     if ($question_gui->object->supportsJavascriptOutput()) {
         $this->tpl->touchBlock("jsswitch");
     }
     $this->tpl->addJavaScript(ilUtil::getJSLocation("autosave.js", "Modules/Test"));
     $this->tpl->setVariable("AUTOSAVE_URL", $this->ctrl->getFormAction($this, "autosave", "", true));
     if ($question_gui->isAutosaveable() && $this->object->getAutosave()) {
         $this->tpl->touchBlock('autosave');
         //$this->tpl->setVariable("BTN_SAVE", "Zwischenspeichern");
         //$this->tpl->setVariable("CMD_SAVE", "gotoquestion_{$sequence}");
         //$this->tpl->setVariable("AUTOSAVEFORMACTION", str_replace("&", "&", $this->ctrl->getFormAction($this)));
         $this->tpl->setVariable("AUTOSAVEFORMACTION", str_replace("&", "&", $this->ctrl->getLinkTarget($this, "autosave")));
         $this->tpl->setVariable("AUTOSAVEINTERVAL", $this->object->getAutosaveIval());
     }
     if ($this->object->areObligationsEnabled() && ilObjTest::isQuestionObligatory($question_gui->object->getId())) {
         $this->tpl->touchBlock('question_obligatory');
         $this->tpl->setVariable('QUESTION_OBLIGATORY', $this->lng->txt('required_field'));
     }
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:101,代码来源:class.ilTestPlayerDynamicQuestionSetGUI.php

示例5: outQuestionPage

 /**
  * output question page
  */
 function outQuestionPage($a_temp_var, $a_postponed = false, $active_id = "", $html = "")
 {
     $postponed = "";
     if ($a_postponed) {
         $postponed = " (" . $this->lng->txt("postponed") . ")";
     }
     include_once "./Services/COPage/classes/class.ilPageObject.php";
     include_once "./Services/COPage/classes/class.ilPageObjectGUI.php";
     $this->lng->loadLanguageModule("content");
     //$page =& new ilPageObject("qpl", $this->object->getId());
     $page_gui =& new ilPageObjectGUI("qpl", $this->object->getId());
     $page_gui->setTemplateTargetVar($a_temp_var);
     $page_gui->setFileDownloadLink("ilias.php?baseClass=ilObjTestGUI&cmd=downloadFile" . "&ref_id=" . $_GET["ref_id"]);
     $page_gui->setFullscreenLink("ilias.php?baseClass=ilObjTestGUI&cmd=fullscreen" . "&ref_id=" . $_GET["ref_id"]);
     $page_gui->setEnabledPageFocus(false);
     if (strlen($html)) {
         $page_gui->setQuestionHTML(array($this->object->getId() => $html));
     }
     $page_gui->setSourcecodeDownloadScript("ilias.php?baseClass=ilObjTestGUI&ref_id=" . $_GET["ref_id"]);
     $page_gui->setOutputMode("presentation");
     include_once "./Modules/Test/classes/class.ilObjTest.php";
     $title_output = ilObjTest::_getTitleOutput($active_id);
     if ($this->object->areObligationsToBeConsidered() && ilObjTest::isQuestionObligatory($this->object->getId())) {
         $obligatoryString = ' *';
     } else {
         $obligatoryString = '';
     }
     switch ($title_output) {
         case 1:
             $page_gui->setPresentationTitle(sprintf($this->lng->txt("tst_position"), $this->getSequenceNumber(), $this->getQuestionCount()) . " - " . $this->object->getTitle() . $postponed . $obligatoryString);
             break;
         case 2:
             $page_gui->setPresentationTitle(sprintf($this->lng->txt("tst_position"), $this->getSequenceNumber(), $this->getQuestionCount()) . $postponed . $obligatoryString);
             break;
         case 0:
         default:
             $maxpoints = $this->object->getMaximumPoints();
             if ($maxpoints == 1) {
                 $maxpoints = " (" . $maxpoints . " " . $this->lng->txt("point") . ")";
             } else {
                 $maxpoints = " (" . $maxpoints . " " . $this->lng->txt("points") . ")";
             }
             $page_gui->setPresentationTitle(sprintf($this->lng->txt("tst_position"), $this->getSequenceNumber(), $this->getQuestionCount()) . " - " . $this->object->getTitle() . $postponed . $maxpoints . $obligatoryString);
             break;
     }
     $presentation = $page_gui->presentation();
     if (strlen($maxpoints)) {
         $presentation = str_replace($maxpoints, "<em>{$maxpoints}</em>", $presentation);
     }
     // bugfix for non XHTML conform img tags in ILIAS Learning Module Editor
     $presentation = preg_replace("/src=\".\\//ims", "src=\"" . ILIAS_HTTP_PATH . "/", $presentation);
     return $presentation;
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:56,代码来源:class.assQuestionGUI.php

示例6: outQuestionPage

 /**
  * output question page
  */
 function outQuestionPage($a_temp_var, $a_postponed = false, $active_id = "", $html = "")
 {
     $postponed = "";
     if ($a_postponed) {
         $postponed = " (" . $this->lng->txt("postponed") . ")";
     }
     include_once "./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php";
     $this->lng->loadLanguageModule("content");
     $page_gui = new ilAssQuestionPageGUI($this->object->getId());
     $page_gui->setTemplateTargetVar($a_temp_var);
     if (strlen($html)) {
         $page_gui->setQuestionHTML(array($this->object->getId() => $html));
     }
     $page_gui->setOutputMode("presentation");
     include_once "./Modules/Test/classes/class.ilObjTest.php";
     $title_output = ilObjTest::_getTitleOutput($active_id);
     if ($this->object->areObligationsToBeConsidered() && ilObjTest::isQuestionObligatory($this->object->getId())) {
         $obligatoryString = ' *';
     } else {
         $obligatoryString = '';
     }
     switch ($title_output) {
         case 1:
             $page_gui->setPresentationTitle(sprintf($this->lng->txt("tst_position"), $this->getSequenceNumber(), $this->getQuestionCount()) . " - " . $this->object->getTitle() . $postponed . $obligatoryString);
             break;
         case 2:
             $page_gui->setPresentationTitle(sprintf($this->lng->txt("tst_position"), $this->getSequenceNumber(), $this->getQuestionCount()) . $postponed . $obligatoryString);
             break;
         case 0:
         default:
             $maxpoints = $this->object->getMaximumPoints();
             if ($maxpoints == 1) {
                 $maxpoints = " (" . $maxpoints . " " . $this->lng->txt("point") . ")";
             } else {
                 $maxpoints = " (" . $maxpoints . " " . $this->lng->txt("points") . ")";
             }
             $page_gui->setPresentationTitle(sprintf($this->lng->txt("tst_position"), $this->getSequenceNumber(), $this->getQuestionCount()) . " - " . $this->object->getTitle() . $postponed . $maxpoints . $obligatoryString);
             break;
     }
     $presentation = $page_gui->presentation();
     if (strlen($maxpoints)) {
         $presentation = str_replace($maxpoints, "<em>{$maxpoints}</em>", $presentation);
     }
     // bugfix for non XHTML conform img tags in ILIAS Learning Module Editor
     $presentation = preg_replace("/src=\".\\//ims", "src=\"" . ILIAS_HTTP_PATH . "/", $presentation);
     return $presentation;
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:50,代码来源:class.assQuestionGUI.php

示例7: outQuestionPage

 /**
  * output question page
  */
 function outQuestionPage($a_temp_var, $a_postponed = false, $active_id = "", $html = "")
 {
     $postponed = "";
     if ($a_postponed) {
         $postponed = " (" . $this->lng->txt("postponed") . ")";
     }
     include_once "./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php";
     $this->lng->loadLanguageModule("content");
     $page_gui = new ilAssQuestionPageGUI($this->object->getId());
     $page_gui->setTemplateTargetVar($a_temp_var);
     if (strlen($html)) {
         $page_gui->setQuestionHTML(array($this->object->getId() => $html));
     }
     $page_gui->setOutputMode("presentation");
     include_once "./Modules/Test/classes/class.ilObjTest.php";
     $title_output = ilObjTest::_getTitleOutput($active_id);
     if ($this->object->areObligationsToBeConsidered() && ilObjTest::isQuestionObligatory($this->object->getId())) {
         $obligatoryString = '([-_-])';
     } else {
         $obligatoryString = '';
     }
     switch ($title_output) {
         case 1:
             $page_gui->setPresentationTitle(sprintf($this->lng->txt("tst_position"), $this->getSequenceNumber(), $this->getQuestionCount()) . " - " . $this->object->getTitle() . $postponed . $obligatoryString);
             break;
         case 2:
             $page_gui->setPresentationTitle(sprintf($this->lng->txt("tst_position"), $this->getSequenceNumber(), $this->getQuestionCount()) . $postponed . $obligatoryString);
             break;
         case 0:
         default:
             if (!is_null($this->questionHeaderBlockBuilder)) {
                 $questionBlockHeader = $this->questionHeaderBlockBuilder->getHTML();
             } else {
                 $maxpoints = $this->object->getMaximumPoints();
                 if ($maxpoints == 1) {
                     $maxpoints = " (" . $maxpoints . " " . $this->lng->txt("point") . ")";
                 } else {
                     $maxpoints = " (" . $maxpoints . " " . $this->lng->txt("points") . ")";
                 }
                 $questionBlockHeader = sprintf($this->lng->txt("tst_position"), $this->getSequenceNumber(), $this->getQuestionCount()) . " - " . $this->object->getTitle() . $postponed . $maxpoints . $obligatoryString;
             }
             $page_gui->setPresentationTitle($questionBlockHeader);
             break;
     }
     $presentation = $page_gui->presentation();
     if (strlen($maxpoints)) {
         $presentation = str_replace($maxpoints, "<em>{$maxpoints}</em>", $presentation);
     }
     if (strlen($obligatoryString)) {
         $replacement = '<br><span class="obligatory" style="font-size:small">' . $this->lng->txt("tst_you_have_to_answer_this_question") . '</span>';
         $presentation = str_replace($obligatoryString, $replacement, $presentation);
     }
     $presentation = preg_replace("/src=\"\\.\\//ims", "src=\"" . ILIAS_HTTP_PATH . "/", $presentation);
     return $presentation;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:58,代码来源:class.assQuestionGUI.php


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