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


PHP assQuestion::lookupParentObjId方法代碼示例

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


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

示例1: 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

示例2: syncImages

 /**
  * Sync images of a MC question on synchronisation with the original question
  */
 protected function syncImages()
 {
     global $ilLog;
     $imagepath = $this->getImagePath();
     $question_id = $this->getOriginalId();
     $originalObjId = parent::lookupParentObjId($this->getOriginalId());
     $imagepath_original = $this->getImagePath($question_id, $originalObjId);
     ilUtil::delDir($imagepath_original);
     foreach ($this->answers as $answer) {
         $filename = $answer->getImage();
         if (strlen($filename)) {
             if (@file_exists($imagepath . $filename)) {
                 if (!file_exists($imagepath)) {
                     ilUtil::makeDirParents($imagepath);
                 }
                 if (!file_exists($imagepath_original)) {
                     ilUtil::makeDirParents($imagepath_original);
                 }
                 if (!@copy($imagepath . $filename, $imagepath_original . $filename)) {
                     $ilLog->write("image could not be duplicated!!!!", $ilLog->ERROR);
                     $ilLog->write("object: " . print_r($this, TRUE), $ilLog->ERROR);
                 }
             }
             if (@file_exists($imagepath . $this->getThumbPrefix() . $filename)) {
                 if (!@copy($imagepath . $this->getThumbPrefix() . $filename, $imagepath_original . $this->getThumbPrefix() . $filename)) {
                     $ilLog->write("image thumbnail could not be duplicated!!!!", $ilLog->ERROR);
                     $ilLog->write("object: " . print_r($this, TRUE), $ilLog->ERROR);
                 }
             }
         }
     }
 }
開發者ID:arlendotcn,項目名稱:ilias,代碼行數:35,代碼來源:class.assMultipleChoice.php

示例3: isSyncOriginalPossibleAndAllowed

 private function isSyncOriginalPossibleAndAllowed($questionId)
 {
     $questionData = $this->questionList->getDataArrayForQuestionId($questionId);
     if (!$questionData['original_id']) {
         return false;
     }
     require_once 'Modules/TestQuestionPool/classes/class.assQuestion.php';
     $parentObjId = assQuestion::lookupParentObjId($questionData['original_id']);
     if (!$this->doesObjectTypeMatch($parentObjId)) {
         return false;
     }
     foreach (ilObject::_getAllReferences($parentObjId) as $parentRefId) {
         if ($this->access->checkAccess('write', '', $parentRefId)) {
             return true;
         }
     }
     return false;
 }
開發者ID:bheyser,項目名稱:qplskl,代碼行數:18,代碼來源:class.ilAssQuestionSkillAssignmentsGUI.php

示例4: 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


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