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


PHP assQuestion::_getOriginalId方法代码示例

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


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

示例1: cloneQuestionSetRelatedData

 /**
  * removes all question set config related data for cloned/copied test
  *
  * @param ilObjTest $cloneTestOBJ
  */
 public function cloneQuestionSetRelatedData($cloneTestOBJ)
 {
     global $ilLog;
     require_once 'Services/CopyWizard/classes/class.ilCopyWizardOptions.php';
     require_once 'Modules/TestQuestionPool/classes/class.assQuestion.php';
     $cwo = ilCopyWizardOptions::_getInstance($cloneTestOBJ->getId());
     foreach ($this->questions as $key => $question_id) {
         $question = assQuestion::_instanciateQuestion($question_id);
         $cloneTestOBJ->questions[$key] = $question->duplicate(true, null, null, null, $cloneTestOBJ->getId());
         $original_id = assQuestion::_getOriginalId($question_id);
         $question = assQuestion::_instanciateQuestion($cloneTestOBJ->questions[$key]);
         $question->saveToDb($original_id);
         // Save the mapping of old question id <-> new question id
         // This will be used in class.ilObjCourse::cloneDependencies to copy learning objectives
         $originalKey = $this->testOBJ->getRefId() . '_' . $question_id;
         $mappedKey = $cloneTestOBJ->getRefId() . '_' . $cloneTestOBJ->questions[$key];
         $cwo->appendMapping($originalKey, $mappedKey);
         $ilLog->write(__METHOD__ . ": Added mapping {$originalKey} <-> {$mappedKey}");
     }
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:25,代码来源:class.ilTestFixedQuestionSetConfig.php

示例2: copyObject

 /**
  * Copies an assImagemapQuestion object
  *
  * Copies an assImagemapQuestion object
  *
  * @access public
  */
 function copyObject($target_questionpool_id, $title = "")
 {
     if ($this->id <= 0) {
         // The question has not been saved. It cannot be duplicated
         return;
     }
     // duplicate the question in database
     $clone = $this;
     include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
     $original_id = assQuestion::_getOriginalId($this->id);
     $clone->id = -1;
     $source_questionpool_id = $this->getObjId();
     $clone->setObjId($target_questionpool_id);
     if ($title) {
         $clone->setTitle($title);
     }
     $clone->saveToDb();
     // copy question page content
     $clone->copyPageOfQuestion($original_id);
     // copy XHTML media objects
     $clone->copyXHTMLMediaObjectsOfQuestion($original_id);
     // duplicate the image
     $clone->copyImage($original_id, $source_questionpool_id);
     $clone->onCopy($source_questionpool_id, $original_id, $clone->getObjId(), $clone->getId());
     return $clone->id;
 }
开发者ID:arlendotcn,项目名称:ilias,代码行数:33,代码来源:class.assImagemapQuestion.php

示例3: logAction

 /**
 * Logs an action into the Test&Assessment log
 *
 * @param string $logtext The log text
 * @param integer $question_id If given, saves the question id to the database
 * @access public
 */
 function logAction($logtext = "", $question_id = "")
 {
     global $ilUser;
     $original_id = "";
     if (strcmp($question_id, "") != 0) {
         include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
         $original_id = assQuestion::_getOriginalId($question_id);
     }
     include_once "./Modules/Test/classes/class.ilObjAssessmentFolder.php";
     ilObjAssessmentFolder::_addLog($ilUser->getId(), $this->getId(), $logtext, $question_id, $original_id, TRUE, $this->getRefId());
 }
开发者ID:bheyser,项目名称:qplskl,代码行数:18,代码来源:class.ilObjTest.php

示例4: copyObject

 /**
  * Copies an assClozeTest object
  *
  * @access public
  */
 function copyObject($target_questionpool, $title = "")
 {
     if ($this->getId() <= 0) {
         // The question has not been saved. It cannot be duplicated
         return;
     }
     $clone = $this;
     include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
     $original_id = assQuestion::_getOriginalId($this->getId());
     $clone->id = -1;
     $source_questionpool = $this->getObjId();
     $clone->setObjId($target_questionpool);
     if ($title) {
         $clone->setTitle($title);
     }
     $clone->saveToDb();
     // copy question page content
     $clone->copyPageOfQuestion($original_id);
     // copy XHTML media objects
     $clone->copyXHTMLMediaObjectsOfQuestion($original_id);
     // duplicate the generic feedback
     $clone->duplicateGenericFeedback($original_id);
     // duplicate specific feedback
     $clone->duplicateSpecificFeedback($original_id);
     $clone->onCopy($this->getObjId(), $this->getId());
     return $clone->getId();
 }
开发者ID:khanhnnvn,项目名称:ilias_E-learning,代码行数:32,代码来源:class.assClozeTest.php

示例5: copyAndLinkToQuestionpoolObject

 public function copyAndLinkToQuestionpoolObject()
 {
     global $lng;
     require_once 'Modules/TestQuestionPool/classes/class.assQuestion.php';
     // #13761; All methods use for this request should be revised, thx japo ;-)
     if ('copyAndLinkToQuestionpool' == $this->ctrl->getCmd() && (!isset($_REQUEST['q_id']) || !is_array($_REQUEST['q_id']))) {
         ilUtil::sendFailure($this->lng->txt('tst_no_question_selected_for_moving_to_qpl'), true);
         $this->ctrl->redirect($this, 'questions');
     }
     if (isset($_REQUEST['q_id']) && is_array($_REQUEST['q_id'])) {
         foreach ($_REQUEST['q_id'] as $q_id) {
             if (!assQuestion::originalQuestionExists($q_id)) {
                 continue;
             }
             $type = ilObject::_lookupType(assQuestion::lookupParentObjId(assQuestion::_getOriginalId($q_id)));
             if ($type !== 'tst') {
                 ilUtil::sendFailure($lng->txt('tst_link_only_unassigned'), true);
                 $this->ctrl->redirect($this, 'questions');
                 return;
             }
         }
     }
     $this->createQuestionpoolTargetObject('copyAndLinkQuestionsToPool');
 }
开发者ID:bheyser,项目名称:qplskl,代码行数:24,代码来源:class.ilObjTestGUI.php

示例6: copyObject

 /**
  * Copies an assAccountingQuestion object
  *
  * @access public
  */
 function copyObject($target_questionpool_id, $title = "")
 {
     if ($this->getId() <= 0) {
         // The question has not been saved. It cannot be duplicated
         return;
     }
     // make a real clone to keep the object unchanged
     // therefore no local variables are needed for the original ids
     // but parts will still point to the original ones
     $clone = clone $this;
     include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
     $original_id = assQuestion::_getOriginalId($this->getId());
     $source_questionpool_id = $this->getObjId();
     $clone->setId(-1);
     $clone->setObjId($target_questionpool_id);
     if ($title) {
         $clone->setTitle($title);
     }
     // save the clone data
     $clone->saveToDb('', false);
     // clone all parts
     // must be done after saving when new id is set
     $clone->cloneParts($this);
     // copy question page content
     $clone->copyPageOfQuestion($original_id);
     // copy XHTML media objects
     $clone->copyXHTMLMediaObjectsOfQuestion($original_id);
     // call the event handler for copy
     $clone->onCopy($source_questionpool_id, $original_id, $clone->getObjId(), $clone->getId());
     return $clone->getId();
 }
开发者ID:ilifau,项目名称:assAccountingQuestion,代码行数:36,代码来源:class.assAccountingQuestion.php

示例7: _logAction

 /**
 * Logs an action into the Test&Assessment log
 *
 * @param string $logtext The log text
 * @param integer $question_id If given, saves the question id to the database
 * @access public
 */
 function _logAction($logtext = "", $active_id = "", $question_id = "")
 {
     global $ilUser;
     $original_id = "";
     if (strcmp($question_id, "") != 0) {
         include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
         $original_id = assQuestion::_getOriginalId($question_id);
     }
     include_once "./Modules/Test/classes/class.ilObjAssessmentFolder.php";
     include_once "./Modules/Test/classes/class.ilObjTest.php";
     ilObjAssessmentFolder::_addLog($ilUser->id, ilObjTest::_getObjectIDFromActiveID($active_id), $logtext, $question_id, $original_id);
 }
开发者ID:bheyser,项目名称:qplskl,代码行数:19,代码来源:class.assQuestion.php

示例8: copyAndLinkToQuestionpoolObject

 public function copyAndLinkToQuestionpoolObject()
 {
     global $lng;
     require_once 'Modules/TestQuestionPool/classes/class.assQuestion.php';
     foreach ($_REQUEST['q_id'] as $q_id) {
         if (!assQuestion::originalQuestionExists($q_id)) {
             continue;
         }
         $type = ilObject::_lookupType(assQuestion::lookupParentObjId(assQuestion::_getOriginalId($q_id)));
         if ($type !== 'tst') {
             ilUtil::sendFailure($lng->txt('tst_link_only_unassigned'), true);
             $this->backObject();
             return;
         }
     }
     $this->createQuestionpoolTargetObject('copyAndLinkQuestionsToPool');
 }
开发者ID:Walid-Synakene,项目名称:ilias,代码行数:17,代码来源:class.ilObjTestGUI.php

示例9: copyObject

 /**
  * Copies an assClozeTest object
  *
  * @access public
  */
 function copyObject($target_questionpool_id, $title = "")
 {
     if ($this->getId() <= 0) {
         // The question has not been saved. It cannot be duplicated
         return;
     }
     $thisId = $this->getId();
     $thisObjId = $this->getObjId();
     $clone = $this;
     include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
     $original_id = assQuestion::_getOriginalId($this->getId());
     $clone->id = -1;
     $clone->setObjId($target_questionpool_id);
     if ($title) {
         $clone->setTitle($title);
     }
     if ($this->gap_combinations_exists) {
         $this->copyGapCombination($original_id, $clone->getId());
     }
     $clone->saveToDb();
     // copy question page content
     $clone->copyPageOfQuestion($original_id);
     // copy XHTML media objects
     $clone->copyXHTMLMediaObjectsOfQuestion($original_id);
     $clone->onCopy($thisObjId, $thisId, $clone->getObjId(), $clone->getId());
     return $clone->getId();
 }
开发者ID:bheyser,项目名称:qplskl,代码行数:32,代码来源:class.assClozeTest.php


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