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


PHP ilObjTest::allObligationsAnswered方法代码示例

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


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

示例1: redirectQuestionCmd

 /**
  * Called when a user answered a question to perform a redirect after POST.
  * This is called for security reasons to prevent users sending a form twice.
  * --> description up to date ??
  *
  * @access public
  */
 protected function redirectQuestionCmd()
 {
     global $ilUser;
     // check the test restrictions to access the test in case one
     // of the test navigation commands was called by an external script
     // e.g. $ilNavigationHistory
     $executable = $this->object->isExecutable($this->testSession, $ilUser->getId());
     if (!$executable["executable"]) {
         ilUtil::sendInfo($executable["errormessage"], TRUE);
         $this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
     }
     switch ($_GET["activecommand"]) {
         case "next":
             $this->sequence = $this->calculateSequence();
             if ($this->sequence === FALSE) {
                 if ($this->object->getListOfQuestionsEnd()) {
                     $allObligationsAnswered = ilObjTest::allObligationsAnswered($this->testSession->getTestId(), $this->testSession->getActiveId(), $this->testSession->getPass());
                     if ($this->object->areObligationsEnabled() && !$allObligationsAnswered) {
                         $this->ctrl->redirect($this, "outQuestionSummaryWithObligationsInfo");
                     }
                     $this->outQuestionSummaryCmd();
                 } else {
                     $this->ctrl->redirect($this, "finishTest");
                 }
             } else {
                 $this->testSession->setLastSequence($this->sequence);
                 $this->testSession->saveToDb();
                 $this->outTestPage(false);
             }
             break;
         case "previous":
             $this->sequence = $this->calculateSequence();
             $this->testSession->setLastSequence($this->sequence);
             $this->testSession->saveToDb();
             if ($this->sequence === FALSE) {
                 $this->ctrl->redirect($this, "outIntroductionPage");
             } else {
                 $this->outTestPage(false);
             }
             break;
         case "postpone":
             $this->sequence = $this->calculateSequence();
             $nextSequence = $this->testSequence->getNextSequence($this->sequence);
             $this->testSequence->postponeSequence($this->sequence);
             $this->testSequence->saveToDb();
             $this->testSession->setLastSequence($nextSequence);
             $this->testSession->saveToDb();
             $this->sequence = $nextSequence;
             $this->outTestPage(false);
             break;
         case "setmarked":
             $this->sequence = $this->calculateSequence();
             $this->testSession->setLastSequence($this->sequence);
             $this->testSession->saveToDb();
             $q_id = $this->testSequence->getQuestionForSequence($_GET["sequence"]);
             $this->object->setQuestionSetSolved(1, $q_id, $ilUser->getId());
             $this->outTestPage(false);
             break;
         case "resetmarked":
             $this->sequence = $this->calculateSequence();
             $this->testSession->setLastSequence($this->sequence);
             $this->testSession->saveToDb();
             $q_id = $this->testSequence->getQuestionForSequence($_GET["sequence"]);
             $this->object->setQuestionSetSolved(0, $q_id, $ilUser->getId());
             $this->outTestPage(false);
             break;
         case "directfeedback":
             $this->sequence = $this->calculateSequence();
             $this->testSession->setLastSequence($this->sequence);
             $this->testSession->saveToDb();
             $this->outTestPage(true);
             break;
         case "handleQuestionAction":
             $this->sequence = $this->calculateSequence();
             $this->testSession->setLastSequence($this->sequence);
             $this->testSession->saveToDb();
             $this->outTestPage(false);
             break;
         case "summary":
             $this->ctrl->redirect($this, "outQuestionSummary");
             break;
         case "summary_obligations":
             $this->ctrl->redirect($this, "outQuestionSummaryWithObligationsInfo");
             break;
         case "summary_obligations_only":
             $this->ctrl->redirect($this, "outObligationsOnlySummary");
             break;
         case "start":
             $_SESSION['tst_pass_finish'] = 0;
             // ensure existing test session
             $this->testSession->setUserId($ilUser->getId());
             $this->testSession->setAnonymousId($_SESSION["tst_access_code"][$this->object->getTestId()]);
             $this->testSession->setObjectiveOrientedContainerId($this->getObjectiveOrientedContainerId());
//.........这里部分代码省略.........
开发者ID:arlendotcn,项目名称:ilias,代码行数:101,代码来源:class.ilTestOutputGUI.php

示例2: finishTest

 /**
 * Finish the test
 *
 * Finish the test
 *
 * @access public
 */
 function finishTest($confirm = true)
 {
     global $ilUser;
     global $ilias;
     global $ilAuth;
     unset($_SESSION["tst_next"]);
     $active_id = $this->object->getTestSession()->getActiveId();
     $actualpass = $this->object->_getPass($active_id);
     $allObligationsAnswered = ilObjTest::allObligationsAnswered($this->object->getTestSession()->getTestId(), $active_id, $actualpass);
     if ($this->object->areObligationsEnabled() && !$allObligationsAnswered) {
         if ($this->object->getListOfQuestions()) {
             $_GET['activecommand'] = 'summary_obligations';
         } else {
             $_GET['activecommand'] = 'summary_obligations_only';
         }
         $this->redirectQuestion();
         return;
     }
     if ($actualpass == $this->object->getNrOfTries() - 1 && !$confirm) {
         $this->object->setActiveTestSubmitted($ilUser->getId());
         $ilAuth->setIdle(ilSession::getIdleValue(), false);
         $ilAuth->setExpire(0);
         switch ($this->object->getMailNotification()) {
             case 1:
                 $this->object->sendSimpleNotification($active_id);
                 break;
             case 2:
                 $this->object->sendAdvancedNotification($active_id);
                 break;
         }
     }
     if ($confirm && $actualpass == $this->object->getNrOfTries() - 1) {
         if ($this->object->canShowSolutionPrintview($ilUser->getId())) {
             $template = new ilTemplate("tpl.il_as_tst_finish_navigation.html", TRUE, TRUE, "Modules/Test");
             $template->setVariable("BUTTON_FINISH", $this->lng->txt("btn_next"));
             $template->setVariable("BUTTON_CANCEL", $this->lng->txt("btn_previous"));
             $template_top = new ilTemplate("tpl.il_as_tst_list_of_answers_topbuttons.html", TRUE, TRUE, "Modules/Test");
             $template_top->setCurrentBlock("button_print");
             $template_top->setVariable("BUTTON_PRINT", $this->lng->txt("print"));
             $template_top->parseCurrentBlock();
             $this->showListOfAnswers($active_id, NULL, $template_top->get(), $template->get());
             return;
         } else {
             // show confirmation page
             return $this->confirmFinishTest();
         }
     }
     if (!$_SESSION['tst_pass_finish']) {
         if (!$_SESSION['tst_pass_finish']) {
             $_SESSION['tst_pass_finish'] = 1;
         }
         if ($this->object->getMailNotificationType() == 1) {
             switch ($this->object->getMailNotification()) {
                 case 1:
                     $this->object->sendSimpleNotification($active_id);
                     break;
                 case 2:
                     $this->object->sendAdvancedNotification($active_id);
                     break;
             }
         }
         $this->object->getTestSession()->increaseTestPass();
     }
     $this->redirectBack();
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:72,代码来源:class.ilTestOutputGUI.php

示例3: finishTestCmd

 function finishTestCmd($requires_confirmation = true)
 {
     global $ilUser, $ilAuth;
     unset($_SESSION["tst_next"]);
     $active_id = $this->testSession->getActiveId();
     $actualpass = $this->object->_getPass($active_id);
     $allObligationsAnswered = ilObjTest::allObligationsAnswered($this->testSession->getTestId(), $active_id, $actualpass);
     /*
      * The following "endgames" are possible prior to actually finishing the test:
      * - Obligations (Ability to finish the test.)
      *      If not all obligatory questions are answered, the user is presented a list
      *      showing the deficits.
      * - Examview (Will to finish the test.)
      *      With the examview, the participant can review all answers given in ILIAS or a PDF prior to
      *      commencing to the finished test.
      * - Last pass allowed (Reassuring the will to finish the test.)
      *      If passes are limited, on the last pass, an additional confirmation is to be displayed.
      */
     // Obligations fulfilled? redirectQuestion : one or the other summary -> no finish
     if ($this->object->areObligationsEnabled() && !$allObligationsAnswered) {
         if ($this->object->getListOfQuestions()) {
             $_GET['activecommand'] = 'summary_obligations';
         } else {
             $_GET['activecommand'] = 'summary_obligations_only';
         }
         $this->redirectQuestionCmd();
         return;
     }
     // Examview enabled & !reviewed & requires_confirmation? test_submission_overview (review gui)
     if ($this->object->getEnableExamview() && !isset($_GET['reviewed']) && $requires_confirmation) {
         $_GET['activecommand'] = 'test_submission_overview';
         $this->redirectQuestionCmd();
         return;
     }
     // Last try in limited tries & !confirmed
     if ($requires_confirmation && $actualpass == $this->object->getNrOfTries() - 1) {
         // show confirmation page
         return $this->confirmFinishTestCmd();
     }
     // Last try in limited tries & confirmed?
     if ($actualpass == $this->object->getNrOfTries() - 1 && !$requires_confirmation) {
         $ilAuth->setIdle(ilSession::getIdleValue(), false);
         $ilAuth->setExpire(0);
         switch ($this->object->getMailNotification()) {
             case 1:
                 $this->object->sendSimpleNotification($active_id);
                 break;
             case 2:
                 $this->object->sendAdvancedNotification($active_id);
                 break;
         }
     }
     // Non-last try finish
     if (!$_SESSION['tst_pass_finish']) {
         if (!$_SESSION['tst_pass_finish']) {
             $_SESSION['tst_pass_finish'] = 1;
         }
         if ($this->object->getMailNotificationType() == 1) {
             switch ($this->object->getMailNotification()) {
                 case 1:
                     $this->object->sendSimpleNotification($active_id);
                     break;
                 case 2:
                     $this->object->sendAdvancedNotification($active_id);
                     break;
             }
         }
     }
     // no redirect request loops after test pass finished tasks has been performed
     $this->performTestPassFinishedTasks($actualpass);
     $this->testSession->setLastFinishedPass($this->testSession->getPass());
     $this->testSession->increaseTestPass();
     $this->ctrl->redirect($this, 'afterTestPassFinished');
 }
开发者ID:bheyser,项目名称:qplskl,代码行数:74,代码来源:class.ilTestPlayerAbstractGUI.php

示例4: finishTestCmd

 function finishTestCmd($requires_confirmation = true)
 {
     global $ilUser, $ilAuth;
     unset($_SESSION["tst_next"]);
     $active_id = $this->testSession->getActiveId();
     $actualpass = $this->object->_getPass($active_id);
     $allObligationsAnswered = ilObjTest::allObligationsAnswered($this->testSession->getTestId(), $active_id, $actualpass);
     /*
      * The following "endgames" are possible prior to actually finishing the test:
      * - Obligations (Ability to finish the test.)
      *      If not all obligatory questions are answered, the user is presented a list
      *      showing the deficits.
      * - Examview (Will to finish the test.)
      *      With the examview, the participant can review all answers given in ILIAS or a PDF prior to
      *      commencing to the finished test.
      * - Last pass allowed (Reassuring the will to finish the test.)
      *      If passes are limited, on the last pass, an additional confirmation is to be displayed.
      */
     // Obligations fulfilled? redirectQuestion : one or the other summary -> no finish
     if ($this->object->areObligationsEnabled() && !$allObligationsAnswered) {
         if ($this->object->getListOfQuestions()) {
             $_GET['activecommand'] = 'summary_obligations';
         } else {
             $_GET['activecommand'] = 'summary_obligations_only';
         }
         $this->redirectQuestion();
         return;
     }
     // Examview enabled & !reviewed & requires_confirmation? test_submission_overview (review gui)
     if ($this->object->getEnableExamview() && !isset($_GET['reviewed']) && $requires_confirmation) {
         $_GET['activecommand'] = 'test_submission_overview';
         $this->redirectQuestionCmd();
         return;
     }
     // Last try in limited tries & !confirmed
     if ($requires_confirmation && $actualpass == $this->object->getNrOfTries() - 1) {
         if ($this->object->canShowSolutionPrintview($ilUser->getId())) {
             $template = new ilTemplate("tpl.il_as_tst_finish_navigation.html", TRUE, TRUE, "Modules/Test");
             $template->setVariable("BUTTON_FINISH", $this->lng->txt("btn_next"));
             $template->setVariable("BUTTON_CANCEL", $this->lng->txt("btn_previous"));
             $template_top = new ilTemplate("tpl.il_as_tst_list_of_answers_topbuttons.html", TRUE, TRUE, "Modules/Test");
             $template_top->setCurrentBlock("button_print");
             $template_top->setVariable("BUTTON_PRINT", $this->lng->txt("print"));
             $template_top->parseCurrentBlock();
             $this->showListOfAnswers($active_id, NULL, $template_top->get(), $template->get());
             return;
         } else {
             // show confirmation page
             return $this->confirmFinishTestCmd();
         }
     }
     // Last try in limited tries & confirmed?
     if ($actualpass == $this->object->getNrOfTries() - 1 && !$requires_confirmation) {
         $this->object->setActiveTestSubmitted($ilUser->getId());
         $ilAuth->setIdle(ilSession::getIdleValue(), false);
         $ilAuth->setExpire(0);
         switch ($this->object->getMailNotification()) {
             case 1:
                 $this->object->sendSimpleNotification($active_id);
                 break;
             case 2:
                 $this->object->sendAdvancedNotification($active_id);
                 break;
         }
     }
     // Non-last try finish
     if (!$_SESSION['tst_pass_finish']) {
         if (!$_SESSION['tst_pass_finish']) {
             $_SESSION['tst_pass_finish'] = 1;
         }
         if ($this->object->getMailNotificationType() == 1) {
             switch ($this->object->getMailNotification()) {
                 case 1:
                     $this->object->sendSimpleNotification($active_id);
                     break;
                 case 2:
                     $this->object->sendAdvancedNotification($active_id);
                     break;
             }
         }
         $this->testSession->increaseTestPass();
         ilSession::set('passincreased', $actualpass);
     }
     if ($this->object->getEnableArchiving()) {
         $this->archiveParticipantSubmission($active_id, $actualpass);
     }
     /** @var $ilPluginAdmin ilPluginAdmin */
     global $ilPluginAdmin, $ilCtrl;
     if ($this->object->getSignSubmission() && count($ilPluginAdmin->getActivePluginsForSlot(IL_COMP_MODULE, 'Test', 'tsig')) != 0) {
         $key = 'signed_' . $active_id . '_' . $actualpass;
         if (ilSession::get('passincreased') != null) {
             $key = 'signed_' . $active_id . '_' . ilSession::get('passincreased');
         }
         $val = ilSession::get($key);
         if (is_null($val)) {
             /** @var $ilCtrl ilCtrl */
             $ilCtrl->redirectByClass('ilTestSignatureGUI', 'invokeSignaturePlugin');
         }
     }
     // Redirect after test
//.........这里部分代码省略.........
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:101,代码来源:class.ilTestPlayerAbstractGUI.php


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