当前位置: 首页>>代码示例>>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;未经允许,请勿转载。