예제 #1
0
 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');
 }
예제 #2
0
 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');
 }