24 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
25 include_once
"./Modules/Test/classes/inc.AssessmentConstants.php";
51 include_once
"./Modules/TestQuestionPool/classes/class.assOrderingQuestion.php";
55 $this->
object->loadFromDb($id);
79 $position = key(
$_POST[
"cmd"][
"addanswers"]);
80 $this->
object->addAnswer(
"", $position+1);
87 $position = key(
$_POST[
'cmd'][
'removeimageanswers']);
89 $this->
object->removeAnswerImage($position);
96 $position = key(
$_POST[
"cmd"][
"removeanswers"]);
97 $this->
object->deleteAnswer($position);
104 $position = key(
$_POST[
"cmd"][
"upanswers"]);
105 $this->
object->moveAnswerUp($position);
112 $position = key(
$_POST[
"cmd"][
"downanswers"]);
113 $this->
object->moveAnswerDown($position);
131 $hasErrors = (!$always) ? $this->
editQuestion(
true) :
false;
134 $this->
object->setTitle(
$_POST[
"title"]);
135 $this->
object->setAuthor(
$_POST[
"author"]);
136 $this->
object->setComment(
$_POST[
"comment"]);
137 include_once
"./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
138 $questiontext =
$_POST[
"question"];
139 $this->
object->setQuestion($questiontext);
140 $this->
object->setThumbGeometry(
$_POST[
"thumb_geometry"]);
141 $this->
object->setElementHeight(
$_POST[
"element_height"]);
144 $this->
object->setNrOfTries(
$_POST[
'nr_of_tries']);
147 $this->
object->setEstimatedWorkingTime(
148 $_POST[
"Estimated"][
"hh"],
149 $_POST[
"Estimated"][
"mm"],
152 $ordering_type =
$_POST[
"ordering_type"];
153 $this->
object->setOrderingType($ordering_type);
156 $this->
object->flushAnswers();
162 $answers =
$_POST[
"answers"];
163 if (is_array($answers))
165 foreach ($answers as $index => $answer)
167 $this->
object->addAnswer($answer);
173 foreach (
$_POST[
'answers'][
'count'] as $index => $dummy)
176 if (strlen($_FILES[
'answers'][
'name'][
'image'][$index]))
179 $filename = $this->
object->createNewImageFileName($_FILES[
'answers'][
'name'][
'image'][$index]);
180 if ($this->object->setImageFile($_FILES[
'answers'][
'tmp_name'][
'image'][$index], $this->object->getEncryptedFilename(
$filename),
$_POST[
'answers'][
'']))
182 $picturefile = $this->
object->getEncryptedFilename(
$filename);
188 $this->
object->addAnswer($picturefile);
192 $this->
object->addAnswer(
$_POST[
'answers'][
'imagename'][$index]);
196 $this->
object->setPoints(
$_POST[
"points"]);
212 $save = ((strcmp($this->ctrl->getCmd(),
"save") == 0) || (strcmp($this->ctrl->getCmd(),
"saveEdit") == 0)) ? TRUE : FALSE;
215 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
216 $orderingtype = (array_key_exists(
'ordering_type',
$_POST)) ?
$_POST[
'ordering_type'] : $this->object->getOrderingType();
217 if (strcmp($this->ctrl->getCmd(),
'changeToText') == 0) $orderingtype =
OQ_TERMS;
218 if (strcmp($this->ctrl->getCmd(),
'changeToPictures') == 0) $orderingtype =
OQ_PICTURES;
220 $form->setFormAction($this->ctrl->getFormAction($this));
222 $form->setMultipart(($orderingtype ==
OQ_PICTURES) ? TRUE : FALSE);
223 $form->setTableWidth(
"100%");
224 $form->setId(
"ordering");
228 $hidden->setValue($orderingtype);
229 $form->addItem($hidden);
236 $element_height =
new ilNumberInputGUI($this->lng->txt(
"element_height"),
"element_height");
237 $element_height->
setValue($this->object->getElementHeight());
238 $element_height->setRequired(
false);
239 $element_height->setMaxLength(6);
240 $element_height->setMinValue(20);
241 $element_height->setSize(6);
242 $element_height->setInfo($this->lng->txt(
"element_height_info"));
243 $form->addItem($element_height);
248 $geometry =
new ilNumberInputGUI($this->lng->txt(
"thumb_geometry"),
"thumb_geometry");
249 $geometry->
setValue($this->object->getThumbGeometry());
250 $geometry->setRequired(
true);
251 $geometry->setMaxLength(6);
252 $geometry->setMinValue(20);
253 $geometry->setSize(6);
254 $geometry->setInfo($this->lng->txt(
"thumb_geometry_info"));
255 $form->addItem($geometry);
257 if (count($this->object->getAnswers()) == 0)
259 $this->
object->addAnswer();
264 include_once
"./Modules/TestQuestionPool/classes/class.ilImageWizardInputGUI.php";
267 $answers->setQuestionObject($this->
object);
268 $answers->setInfo($this->lng->txt(
'ordering_answer_sequence_info'));
269 $answers->setAllowMove(TRUE);
270 $answervalues = array();
271 foreach ($this->object->getAnswers() as $index => $answervalue)
273 $answervalues[$index] = $answervalue->getAnswertext();
275 $answers->setValues($answervalues);
276 $form->addItem($answers);
282 $answers->setInfo($this->lng->txt(
'ordering_answer_sequence_info'));
283 $answers->setAllowMove(TRUE);
284 $answervalues = array();
285 foreach ($this->object->getAnswers() as $index => $answervalue)
287 $answervalues[$index] = $answervalue->getAnswertext();
289 ksort($answervalues);
290 $answers->setValues($answervalues);
291 $form->addItem($answers);
294 include_once(
"./Services/Form/classes/class.ilAdditionalCharactersGUI.php");
298 $points->setValue($this->object->getPoints());
302 $points->setMinvalueShouldBeGreater(
true);
310 $form->addCommandButton(
"changeToText", $this->lng->txt(
"order_terms"));
314 $form->addCommandButton(
"changeToPictures", $this->lng->txt(
"order_pictures"));
322 $form->setValuesByPost();
323 $errors = !$form->checkInput();
324 $form->setValuesByPost();
325 if (
$errors) $checkonly =
false;
328 if (!$checkonly) $this->tpl->setVariable(
"QUESTION_DATA", $form->getHTML());
334 $test_output = $this->
getTestOutput($active_id,
$pass, $is_postponed, $user_post_solution);
335 $this->tpl->setVariable(
"QUESTION_OUTPUT", $test_output);
336 $this->tpl->setVariable(
"FORMACTION", $formaction);
355 $graphicalOutput = FALSE,
356 $result_output = FALSE,
357 $show_question_only = TRUE,
358 $show_feedback = FALSE,
359 $show_correct_solution = FALSE,
360 $show_manual_scoring = FALSE
364 $keys = array_keys($this->object->answers);
367 include_once
"./classes/class.ilTemplate.php";
368 $template =
new ilTemplate(
"tpl.il_as_qpl_ordering_output_solution.html", TRUE, TRUE,
"Modules/TestQuestionPool");
369 $solutiontemplate =
new ilTemplate(
"tpl.il_as_tst_solution_output.html",TRUE, TRUE,
"Modules/TestQuestionPool");
372 $solutions = array();
373 if (($active_id > 0) && (!$show_correct_solution))
375 $solutions =& $this->
object->getSolutionValues($active_id,
$pass);
379 foreach ($this->object->answers as $index => $answer)
381 array_push($solutions, array(
"value1" => $index,
"value2" => $index+1));
384 foreach ($keys as $idx)
386 $answer = $this->
object->answers[$idx];
387 if (($active_id > 0) && (!$show_correct_solution))
389 if ($graphicalOutput)
392 foreach ($solutions as $solution)
394 $sol[$solution[
"value1"]] = $solution[
"value2"];
397 $sol = array_keys($sol);
399 foreach ($this->object->answers as $k => $a)
404 $ans = array_keys($ans);
406 foreach ($ans as $arr_idx => $ans_idx)
408 if ($ans_idx == $idx)
410 if ($ans_idx == $sol[$arr_idx])
419 $template->setCurrentBlock(
"icon_ok");
421 $template->setVariable(
"TEXT_OK", $this->lng->txt(
"answer_is_right"));
422 $template->parseCurrentBlock();
426 $template->setCurrentBlock(
"icon_ok");
428 $template->setVariable(
"TEXT_NOT_OK", $this->lng->txt(
"answer_is_wrong"));
429 $template->parseCurrentBlock();
433 if ($this->object->getOrderingType() ==
OQ_PICTURES)
435 $template->setCurrentBlock(
"ordering_row_standard_pictures");
436 $thumbweb = $this->
object->getImagePathWeb() . $this->
object->getThumbPrefix() . $answer->getAnswertext();
437 $thumb = $this->
object->getImagePath() . $this->
object->getThumbPrefix() . $answer->getAnswertext();
438 if (!@file_exists($thumb)) $this->
object->rebuildThumbnails();
439 $template->setVariable(
"THUMB_HREF", $thumbweb);
440 list($width, $height,
$type, $attr) = getimagesize($thumb);
441 $template->setVariable(
"ATTR", $attr);
442 $template->setVariable(
"THUMB_ALT", $this->lng->txt(
"thumbnail"));
443 $template->setVariable(
"THUMB_TITLE", $this->lng->txt(
"enlarge"));
444 $template->parseCurrentBlock();
448 $template->setCurrentBlock(
"ordering_row_standard_text");
449 $template->setVariable(
"ANSWER_TEXT", $this->object->prepareTextareaOutput($answer->getAnswertext(), TRUE));
450 $template->parseCurrentBlock();
452 $template->setCurrentBlock(
"ordering_row_standard");
455 $answer = $this->
object->answers[$idx];
456 $points = $answer->getPoints();
457 $resulttext = (
$points == 1) ?
"(%s " . $this->lng->txt(
"point") .
")" :
"(%s " . $this->lng->txt(
"points") .
")";
458 $template->setVariable(
"RESULT_OUTPUT", sprintf($resulttext,
$points));
460 foreach ($solutions as $solution)
462 if (strcmp($solution[
"value1"], $idx) == 0)
464 $template->setVariable(
"ANSWER_ORDER", $solution[
"value2"]);
467 $template->parseCurrentBlock();
469 $questiontext = $this->
object->getQuestion();
470 $template->setVariable(
"QUESTIONTEXT", $this->object->prepareTextareaOutput($questiontext, TRUE));
471 $questionoutput = $template->get();
473 if (strlen($feedback)) $solutiontemplate->setVariable(
"FEEDBACK", $feedback);
474 $solutiontemplate->setVariable(
"SOLUTION_OUTPUT", $questionoutput);
476 $solutionoutput = $solutiontemplate->get();
477 if (!$show_question_only)
482 return $solutionoutput;
490 $keys = array_keys($this->object->answers);
494 include_once
"./classes/class.ilTemplate.php";
495 $template =
new ilTemplate(
"tpl.il_as_qpl_ordering_output.html", TRUE, TRUE,
"Modules/TestQuestionPool");
498 if (strcmp($this->ctrl->getCmd(),
'preview') == 0)
500 if (array_key_exists(
'js',
$_GET))
502 $ilUser->writePref(
'tst_javascript',
$_GET[
'js']);
504 $jstemplate =
new ilTemplate(
"tpl.il_as_qpl_javascript_switch.html", TRUE, TRUE,
"Modules/TestQuestionPool");
505 if ($ilUser->getPref(
"tst_javascript") == 1)
508 $jstemplate->setVariable(
"JAVASCRIPT_IMAGE_ALT", $this->lng->txt(
"disable_javascript"));
509 $jstemplate->setVariable(
"JAVASCRIPT_IMAGE_TITLE", $this->lng->txt(
"disable_javascript"));
510 $this->ctrl->setParameterByClass($this->ctrl->getCmdClass(),
"js",
"0");
511 $jstemplate->setVariable(
"JAVASCRIPT_URL", $this->ctrl->getLinkTargetByClass($this->ctrl->getCmdClass(), $this->ctrl->getCmd()));
516 $jstemplate->setVariable(
"JAVASCRIPT_IMAGE_ALT", $this->lng->txt(
"enable_javascript"));
517 $jstemplate->setVariable(
"JAVASCRIPT_IMAGE_TITLE", $this->lng->txt(
"enable_javascript"));
518 $this->ctrl->setParameterByClass($this->ctrl->getCmdClass(),
"js",
"1");
519 $jstemplate->setVariable(
"JAVASCRIPT_URL", $this->ctrl->getLinkTargetByClass($this->ctrl->getCmdClass(), $this->ctrl->getCmd()));
521 $jsswitch = $jstemplate->get();
522 if ($ilUser->getPref(
'tst_javascript')) $this->object->setOutputType(
OUTPUT_JAVASCRIPT);
528 $this->tpl->addBlockFile(
"CONTENT_BLOCK",
"head_content",
"tpl.il_as_qpl_ordering_output_javascript.html",
"Modules/TestQuestionPool");
529 $this->tpl->setCurrentBlock(
"head_content");
530 $this->tpl->setVariable(
"JS_LOCATION",
"./Modules/TestQuestionPool/js/toolman/");
531 $this->tpl->parseCurrentBlock();
535 $this->tpl->setCurrentBlock(
"AdditionalStyle");
536 $this->tpl->setVariable(
"LOCATION_ADDITIONAL_STYLESHEET",
ilUtil::getStyleSheetLocation(
"output",
"test_javascript.css",
"Modules/TestQuestionPool"));
537 $this->tpl->parseCurrentBlock();
543 foreach ($keys as $idx)
545 $answer = $this->
object->answers[$idx];
546 if ($this->object->getOrderingType() ==
OQ_PICTURES)
548 $template->setCurrentBlock(
"ordering_row_standard_pictures");
549 $template->setVariable(
"PICTURE_HREF", $this->object->getImagePathWeb() . $answer->getAnswertext());
550 $thumbweb = $this->
object->getImagePathWeb() . $this->
object->getThumbPrefix() . $answer->getAnswertext();
551 $thumb = $this->
object->getImagePath() . $this->
object->getThumbPrefix() . $answer->getAnswertext();
552 if (!@file_exists($thumb)) $this->
object->rebuildThumbnails();
553 $template->setVariable(
"THUMB_HREF", $thumbweb);
554 $template->setVariable(
"THUMB_ALT", $this->lng->txt(
"thumbnail"));
555 $template->setVariable(
"THUMB_TITLE", $this->lng->txt(
"enlarge"));
556 $template->setVariable(
"ANSWER_ID", $answer->getRandomID());
557 $template->parseCurrentBlock();
561 $template->setCurrentBlock(
"ordering_row_standard_text");
562 $template->setVariable(
"ANSWER_TEXT", $this->object->prepareTextareaOutput($answer->getAnswertext(), TRUE));
563 $template->setVariable(
"ANSWER_ID", $answer->getRandomID());
564 $template->parseCurrentBlock();
566 $template->setCurrentBlock(
"ordering_row_standard");
567 $template->setVariable(
"ANSWER_ID", $answer->getRandomID());
568 $template->parseCurrentBlock();
573 foreach ($keys as $idx)
575 $answer = $this->
object->answers[$idx];
576 if ($this->object->getOrderingType() ==
OQ_PICTURES)
578 $template->setCurrentBlock(
"ordering_row_javascript_pictures");
579 $template->setVariable(
"PICTURE_HREF", $this->object->getImagePathWeb() . $answer->getAnswertext());
580 $thumbweb = $this->
object->getImagePathWeb() . $this->
object->getThumbPrefix() . $answer->getAnswertext();
581 $thumb = $this->
object->getImagePath() . $this->
object->getThumbPrefix() . $answer->getAnswertext();
582 if (!@file_exists($thumb)) $this->
object->rebuildThumbnails();
583 $template->setVariable(
"THUMB_HREF", $thumbweb);
584 $template->setVariable(
"THUMB_ALT", $this->lng->txt(
"thumbnail"));
585 $template->setVariable(
"THUMB_TITLE", $this->lng->txt(
"thumbnail"));
587 $template->setVariable(
"ENLARGE_ALT", $this->lng->txt(
"enlarge"));
588 $template->setVariable(
"ENLARGE_TITLE", $this->lng->txt(
"enlarge"));
589 $template->setVariable(
"ANSWER_ID", $answer->getRandomID());
590 $template->parseCurrentBlock();
594 $template->setCurrentBlock(
"ordering_row_javascript_text");
595 $template->setVariable(
"ANSWER_TEXT", $this->object->prepareTextareaOutput($answer->getAnswertext(), TRUE));
596 $template->setVariable(
"ANSWER_ID", $answer->getRandomID());
597 $template->parseCurrentBlock();
600 $template->setCurrentBlock(
"ordering_with_javascript");
601 if ($this->object->getOrderingType() ==
OQ_PICTURES)
603 $template->setVariable(
"RESET_POSITIONS", $this->lng->txt(
"reset_pictures"));
607 $template->setVariable(
"RESET_POSITIONS", $this->lng->txt(
"reset_definitions"));
609 $template->parseCurrentBlock();
611 $questiontext = $this->
object->getQuestion();
612 $template->setVariable(
"QUESTIONTEXT", $this->object->prepareTextareaOutput($questiontext, TRUE));
613 $questionoutput = $jsswitch . $template->get();
614 if (!$show_question_only)
619 return $questionoutput;
626 if (is_array($user_post_solution))
632 $keys = array_keys($this->object->answers);
638 include_once
"./classes/class.ilTemplate.php";
640 $template =
new ilTemplate(
"tpl.il_as_qpl_ordering_output.html", TRUE, TRUE,
"Modules/TestQuestionPool");
644 $this->tpl->addBlockFile(
"CONTENT_BLOCK",
"head_content",
"tpl.il_as_qpl_ordering_output_javascript.html",
"Modules/TestQuestionPool");
645 $this->tpl->setCurrentBlock(
"head_content");
646 $this->tpl->setVariable(
"JS_LOCATION",
"./Modules/TestQuestionPool/js/toolman/");
647 $this->tpl->parseCurrentBlock();
651 $this->tpl->setCurrentBlock(
"AdditionalStyle");
652 $this->tpl->setVariable(
"LOCATION_ADDITIONAL_STYLESHEET",
ilUtil::getStyleSheetLocation(
"output",
"test_javascript.css",
"Modules/TestQuestionPool"));
653 $this->tpl->parseCurrentBlock();
657 $this->tpl->setVariable(
"ON_SUBMIT",
"return saveOrder('orderlist');");
665 include_once
"./Modules/Test/classes/class.ilObjTest.php";
670 if (is_array($user_post_solution))
672 $solutions = array();
673 foreach ($user_post_solution as $key => $value)
675 if (preg_match(
"/order_(\d+)/", $key, $matches))
677 foreach ($this->object->getAnswers() as $answeridx => $answer)
679 if ($answer->getRandomID() == $matches[1])
681 array_push($solutions, array(
"value1" => $answeridx,
"value2" => $value));
689 $solutions =& $this->
object->getSolutionValues($active_id,
$pass);
694 $solution_script .=
"";
695 $jssolutions = array();
696 foreach ($solutions as $idx => $solution_value)
698 if ((strcmp($solution_value[
"value2"],
"") != 0) && (strcmp($solution_value[
"value1"],
"") != 0))
700 $jssolutions[$solution_value[
"value2"]] = $solution_value[
"value1"];
703 if (count($jssolutions))
707 foreach ($jssolutions as $key => $value)
709 if (is_object($this->object->getAnswer($value)))
711 $js .=
"initialorder.push('id_" . $this->
object->getAnswer($value)->getRandomID() .
"');";
714 $js .=
"restoreInitialOrder();";
718 $template->setCurrentBlock(
"javascript_restore_order");
719 $template->setVariable(
"RESTORE_ORDER", $js);
720 $template->parseCurrentBlock();
727 foreach ($keys as $idx)
729 $answer = $this->
object->answers[$idx];
730 if ($this->object->getOrderingType() ==
OQ_PICTURES)
732 $template->setCurrentBlock(
"ordering_row_standard_pictures");
733 $template->setVariable(
"PICTURE_HREF", $this->object->getImagePathWeb() . $answer->getAnswertext());
734 $thumbweb = $this->
object->getImagePathWeb() . $this->
object->getThumbPrefix() . $answer->getAnswertext();
735 $thumb = $this->
object->getImagePath() . $this->
object->getThumbPrefix() . $answer->getAnswertext();
736 if (!@file_exists($thumb)) $this->
object->rebuildThumbnails();
737 $template->setVariable(
"THUMB_HREF", $thumbweb);
738 $template->setVariable(
"THUMB_ALT", $this->lng->txt(
"thumbnail"));
739 $template->setVariable(
"THUMB_TITLE", $this->lng->txt(
"enlarge"));
740 $template->setVariable(
"ANSWER_ID", $answer->getRandomID());
741 $template->parseCurrentBlock();
745 $template->setCurrentBlock(
"ordering_row_standard_text");
746 $template->setVariable(
"ANSWER_TEXT", $this->object->prepareTextareaOutput($answer->getAnswertext(), TRUE));
747 $template->setVariable(
"ANSWER_ID", $answer->getRandomID());
748 $template->parseCurrentBlock();
750 $template->setCurrentBlock(
"ordering_row_standard");
751 $template->setVariable(
"ANSWER_ID", $answer->getRandomID());
752 if (is_array($solutions))
754 foreach ($solutions as $solution)
756 if (($solution[
"value1"] == $idx) && (strlen($solution[
"value2"])))
758 $template->setVariable(
"ANSWER_ORDER",
" value=\"" . $solution[
"value2"] .
"\"");
762 $template->parseCurrentBlock();
767 foreach ($keys as $idx)
769 $answer = $this->
object->answers[$idx];
770 if ($this->object->getOrderingType() ==
OQ_PICTURES)
772 $template->setCurrentBlock(
"ordering_row_javascript_pictures");
773 $template->setVariable(
"PICTURE_HREF", $this->object->getImagePathWeb() . $answer->getAnswertext());
774 $thumbweb = $this->
object->getImagePathWeb() . $this->
object->getThumbPrefix() . $answer->getAnswertext();
775 $thumb = $this->
object->getImagePath() . $this->
object->getThumbPrefix() . $answer->getAnswertext();
776 if (!@file_exists($thumb)) $this->
object->rebuildThumbnails();
777 $template->setVariable(
"THUMB_HREF", $thumbweb);
778 $template->setVariable(
"THUMB_ALT", $this->lng->txt(
"thumbnail"));
779 $template->setVariable(
"THUMB_TITLE", $this->lng->txt(
"thumbnail"));
781 $template->setVariable(
"ENLARGE_ALT", $this->lng->txt(
"enlarge"));
782 $template->setVariable(
"ENLARGE_TITLE", $this->lng->txt(
"enlarge"));
783 $template->setVariable(
"ANSWER_ID", $answer->getRandomID());
784 $template->parseCurrentBlock();
788 $template->setCurrentBlock(
"ordering_row_javascript_text");
789 $template->setVariable(
"ANSWER_TEXT", $this->object->prepareTextareaOutput($answer->getAnswertext(), TRUE));
790 $template->setVariable(
"ANSWER_ID", $answer->getRandomID());
791 $template->parseCurrentBlock();
794 $template->setCurrentBlock(
"ordering_with_javascript");
795 if ($this->object->getOrderingType() ==
OQ_PICTURES)
797 $template->setVariable(
"RESET_POSITIONS", $this->lng->txt(
"reset_pictures"));
801 $template->setVariable(
"RESET_POSITIONS", $this->lng->txt(
"reset_definitions"));
803 $template->parseCurrentBlock();
805 $questiontext = $this->
object->getQuestion();
806 $template->setVariable(
"QUESTIONTEXT", $this->object->prepareTextareaOutput($questiontext, TRUE));
807 $questionoutput = $template->get();
808 $pageoutput = $this->
outQuestionPage(
"", $is_postponed, $active_id, $questionoutput);
819 include_once
"./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
821 $this->
object->saveFeedbackGeneric(0,
$_POST[
"feedback_incomplete"]);
822 $this->
object->saveFeedbackGeneric(1,
$_POST[
"feedback_complete"]);
823 $this->
object->cleanupMediaObjectUsage();
834 global $rbacsystem, $ilTabs;
836 $this->ctrl->setParameterByClass(
"ilpageobjectgui",
"q_id",
$_GET[
"q_id"]);
837 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
838 $q_type = $this->
object->getQuestionType();
842 $classname = $q_type .
"GUI";
843 $this->ctrl->setParameterByClass(strtolower($classname),
"sel_question_types", $q_type);
844 $this->ctrl->setParameterByClass(strtolower($classname),
"q_id",
$_GET[
"q_id"]);
849 if ($rbacsystem->checkAccess(
'write',
$_GET[
"ref_id"]))
852 $ilTabs->addTarget(
"edit_content",
853 $this->ctrl->getLinkTargetByClass(
"ilPageObjectGUI",
"edit"),
854 array(
"edit",
"insert",
"exec_pg"),
855 "",
"", $force_active);
859 $ilTabs->addTarget(
"preview",
860 $this->ctrl->getLinkTargetByClass(
"ilPageObjectGUI",
"preview"),
862 "ilPageObjectGUI",
"", $force_active);
865 $force_active =
false;
866 if ($rbacsystem->checkAccess(
'write',
$_GET[
"ref_id"]))
869 if ($classname) $url = $this->ctrl->getLinkTargetByClass($classname,
"editQuestion");
870 $commands =
$_POST[
"cmd"];
871 if (is_array($commands))
873 foreach ($commands as $key => $value)
875 if (preg_match(
"/^delete_.*/", $key, $matches))
877 $force_active =
true;
882 $ilTabs->addTarget(
"edit_properties",
884 array(
"editQuestion",
"save",
"saveEdit",
"addanswers",
"removeanswers",
"changeToPictures",
"uploadanswers",
"changeToText",
"upanswers",
"downanswers",
"originalSyncForm"),
885 $classname,
"", $force_active);
890 $ilTabs->addTarget(
"feedback",
891 $this->ctrl->getLinkTargetByClass($classname,
"feedback"),
892 array(
"feedback",
"saveFeedback"),
898 $ilTabs->addTarget(
"solution_hint",
899 $this->ctrl->getLinkTargetByClass($classname,
"suggestedsolution"),
900 array(
"suggestedsolution",
"saveSuggestedSolution",
"outSolutionExplorer",
"cancel",
901 "addSuggestedSolution",
"cancelExplorer",
"linkChilds",
"removeSuggestedSolution"
911 $ilTabs->addTarget(
"statistics",
912 $this->ctrl->getLinkTargetByClass($classname,
"assessment"),
917 if ((
$_GET[
"calling_test"] > 0) || (
$_GET[
"test_ref_id"] > 0))
921 $ilTabs->setBackTarget($this->lng->txt(
"backtocallingtest"),
"ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=$ref_id");
925 $ilTabs->setBackTarget($this->lng->txt(
"qpl"), $this->ctrl->getLinkTargetByClass(
"ilobjquestionpoolgui",
"questions"));