當前位置: 首頁>>代碼示例>>PHP>>正文


PHP assQuestion::_questionExistsInTest方法代碼示例

本文整理匯總了PHP中assQuestion::_questionExistsInTest方法的典型用法代碼示例。如果您正苦於以下問題:PHP assQuestion::_questionExistsInTest方法的具體用法?PHP assQuestion::_questionExistsInTest怎麽用?PHP assQuestion::_questionExistsInTest使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在assQuestion的用法示例。


在下文中一共展示了assQuestion::_questionExistsInTest方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: saveReturn

 /**
  * save question
  */
 function saveReturn()
 {
     global $ilUser;
     $old_id = $_GET["q_id"];
     $result = $this->writePostData();
     if ($result == 0) {
         $ilUser->setPref("tst_lastquestiontype", $this->object->getQuestionType());
         $ilUser->writePref("tst_lastquestiontype", $this->object->getQuestionType());
         $this->object->saveToDb();
         $originalexists = $this->object->_questionExistsInPool($this->object->original_id);
         include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
         if (($_GET["calling_test"] || isset($_GET['calling_consumer']) && (int) $_GET['calling_consumer']) && $originalexists && assQuestion::_isWriteable($this->object->original_id, $ilUser->getId())) {
             ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
             $this->ctrl->redirect($this, "originalSyncForm");
             return;
         } elseif ($_GET["calling_test"]) {
             require_once 'Modules/Test/classes/class.ilObjTest.php';
             $test = new ilObjTest($_GET["calling_test"]);
             #var_dump(assQuestion::_questionExistsInTest($this->object->getId(), $test->getTestId()));
             $q_id = $this->object->getId();
             if (!assQuestion::_questionExistsInTest($this->object->getId(), $test->getTestId())) {
                 global $tree, $ilDB, $ilPluginAdmin;
                 include_once "./Modules/Test/classes/class.ilObjTest.php";
                 $_GET["ref_id"] = $_GET["calling_test"];
                 $test = new ilObjTest($_GET["calling_test"], true);
                 require_once 'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
                 $testQuestionSetConfigFactory = new ilTestQuestionSetConfigFactory($tree, $ilDB, $ilPluginAdmin, $test);
                 $new_id = $test->insertQuestion($testQuestionSetConfigFactory->getQuestionSetConfig(), $this->object->getId());
                 $q_id = $new_id;
                 if (isset($_REQUEST['prev_qid'])) {
                     $test->moveQuestionAfter($this->object->getId() + 1, $_REQUEST['prev_qid']);
                 }
                 $this->ctrl->setParameter($this, 'q_id', $new_id);
                 $this->ctrl->setParameter($this, 'calling_test', $_GET['calling_test']);
                 #$this->ctrl->setParameter($this, 'test_ref_id', false);
             }
             ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
             if ($_REQUEST['test_express_mode']) {
                 ilUtil::redirect(ilTestExpressPage::getReturnToPageLink($q_id));
             } else {
                 ilUtil::redirect("ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=" . $_GET["calling_test"]);
             }
         } else {
             if ($this->object->getId() != $old_id) {
                 $this->callNewIdListeners($this->object->getId());
                 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
                 $this->ctrl->redirectByClass("ilobjquestionpoolgui", "questions");
             }
             if (strcmp($_SESSION["info"], "") != 0) {
                 ilUtil::sendSuccess($_SESSION["info"] . "<br />" . $this->lng->txt("msg_obj_modified"), true);
             } else {
                 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
             }
             $this->ctrl->redirectByClass("ilobjquestionpoolgui", "questions");
         }
     }
 }
開發者ID:bheyser,項目名稱:qplskl,代碼行數:60,代碼來源:class.assQuestionGUI.php


注:本文中的assQuestion::_questionExistsInTest方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。