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)
171 $this->
object->addAnswer($answer);
177 foreach (array_keys(
$_POST[
'answers'][
'count']) as $index)
181 $this->
object->addAnswer(
"");
185 $picturefile =
$_POST[
'answers'][
'imagename'][$index];
186 $file_org_name = $_FILES[
'answers'][
'name'][
'image'][$index];
187 $file_temp_name = $_FILES[
'answers'][
'tmp_name'][
'image'][$index];
190 if (strlen($file_temp_name))
193 $suffix = strtolower(array_pop(explode(
".", $file_org_name)));
194 if(in_array($suffix, array(
"jpg",
"jpeg",
"png",
"gif")))
197 $filename = $this->
object->createNewImageFileName($file_org_name);
199 if ($this->object->setImageFile($file_temp_name,
$filename, $picturefile))
206 $this->
object->addAnswer($picturefile);
209 $this->
object->setPoints(
$_POST[
"points"]);
228 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
229 $orderingtype = (array_key_exists(
'ordering_type',
$_POST)) ?
$_POST[
'ordering_type'] : $this->object->getOrderingType();
230 if (strcmp($this->ctrl->getCmd(),
'changeToText') == 0) $orderingtype =
OQ_TERMS;
231 if (strcmp($this->ctrl->getCmd(),
'changeToPictures') == 0) $orderingtype =
OQ_PICTURES;
233 $form->setFormAction($this->ctrl->getFormAction($this));
235 $form->setMultipart(($orderingtype ==
OQ_PICTURES) ? TRUE : FALSE);
236 $form->setTableWidth(
"100%");
237 $form->setId(
"ordering");
241 $hidden->setValue($orderingtype);
242 $form->addItem($hidden);
249 $element_height =
new ilNumberInputGUI($this->lng->txt(
"element_height"),
"element_height");
250 $element_height->
setValue($this->object->getElementHeight());
251 $element_height->setRequired(
false);
252 $element_height->setMaxLength(6);
253 $element_height->setMinValue(20);
254 $element_height->setSize(6);
255 $element_height->setInfo($this->lng->txt(
"element_height_info"));
256 $form->addItem($element_height);
261 $geometry =
new ilNumberInputGUI($this->lng->txt(
"thumb_geometry"),
"thumb_geometry");
262 $geometry->
setValue($this->object->getThumbGeometry());
263 $geometry->setRequired(
true);
264 $geometry->setMaxLength(6);
265 $geometry->setMinValue(20);
266 $geometry->setSize(6);
267 $geometry->setInfo($this->lng->txt(
"thumb_geometry_info"));
268 $form->addItem($geometry);
270 if (count($this->object->getAnswers()) == 0)
272 $this->
object->addAnswer();
277 include_once
"./Modules/TestQuestionPool/classes/class.ilImageWizardInputGUI.php";
280 $answers->setQuestionObject($this->
object);
281 $answers->setInfo($this->lng->txt(
'ordering_answer_sequence_info'));
282 $answers->setAllowMove(TRUE);
283 $answervalues = array();
284 foreach ($this->object->getAnswers() as $index => $answervalue)
286 $answervalues[$index] = $answervalue->getAnswertext();
288 $answers->setValues($answervalues);
289 $form->addItem($answers);
295 $answers->setInfo($this->lng->txt(
'ordering_answer_sequence_info'));
296 $answers->setAllowMove(TRUE);
297 $answervalues = array();
298 foreach ($this->object->getAnswers() as $index => $answervalue)
300 $answervalues[$index] = $answervalue->getAnswertext();
302 ksort($answervalues);
303 $answers->setValues($answervalues);
304 $form->addItem($answers);
308 $points->
setValue($this->object->getPoints());
309 $points->setRequired(TRUE);
311 $points->setMinValue(0);
312 $points->setMinvalueShouldBeGreater(
true);
313 $form->addItem($points);
319 $form->addCommandButton(
"changeToText", $this->lng->txt(
"order_terms"));
323 $form->addCommandButton(
"changeToPictures", $this->lng->txt(
"order_pictures"));
333 $form->setValuesByPost();
334 $errors = !$form->checkInput();
335 $form->setValuesByPost();
336 if (
$errors) $checkonly =
false;
339 if (!$checkonly) $this->tpl->setVariable(
"QUESTION_DATA", $form->getHTML());
345 $test_output = $this->
getTestOutput($active_id,
$pass, $is_postponed, $user_post_solution);
346 $this->tpl->setVariable(
"QUESTION_OUTPUT", $test_output);
347 $this->tpl->setVariable(
"FORMACTION", $formaction);
366 $graphicalOutput = FALSE,
367 $result_output = FALSE,
368 $show_question_only = TRUE,
369 $show_feedback = FALSE,
370 $show_correct_solution = FALSE,
371 $show_manual_scoring = FALSE
375 $keys = array_keys($this->object->answers);
378 include_once
"./classes/class.ilTemplate.php";
379 $template =
new ilTemplate(
"tpl.il_as_qpl_ordering_output_solution.html", TRUE, TRUE,
"Modules/TestQuestionPool");
380 $solutiontemplate =
new ilTemplate(
"tpl.il_as_tst_solution_output.html",TRUE, TRUE,
"Modules/TestQuestionPool");
383 $solutions = array();
384 if (($active_id > 0) && (!$show_correct_solution))
386 $solutions =& $this->
object->getSolutionValues($active_id,
$pass);
390 foreach ($this->object->answers as $index => $answer)
392 array_push($solutions, array(
"value1" => $index,
"value2" => $index+1));
395 foreach ($keys as $idx)
397 $answer = $this->
object->answers[$idx];
398 if (($active_id > 0) && (!$show_correct_solution))
400 if ($graphicalOutput)
403 foreach ($solutions as $solution)
405 $sol[$solution[
"value1"]] = $solution[
"value2"];
408 $sol = array_keys($sol);
410 foreach ($this->object->answers as $k => $a)
415 $ans = array_keys($ans);
417 foreach ($ans as $arr_idx => $ans_idx)
419 if ($ans_idx == $idx)
421 if ($ans_idx == $sol[$arr_idx])
430 $template->setCurrentBlock(
"icon_ok");
432 $template->setVariable(
"TEXT_OK", $this->lng->txt(
"answer_is_right"));
433 $template->parseCurrentBlock();
437 $template->setCurrentBlock(
"icon_ok");
439 $template->setVariable(
"TEXT_NOT_OK", $this->lng->txt(
"answer_is_wrong"));
440 $template->parseCurrentBlock();
444 if ($this->object->getOrderingType() ==
OQ_PICTURES)
446 $template->setCurrentBlock(
"ordering_row_standard_pictures");
447 $thumbweb = $this->
object->getImagePathWeb() . $this->
object->getThumbPrefix() . $answer->getAnswertext();
448 $thumb = $this->
object->getImagePath() . $this->
object->getThumbPrefix() . $answer->getAnswertext();
449 if (!@file_exists($thumb)) $this->
object->rebuildThumbnails();
450 $template->setVariable(
"THUMB_HREF", $thumbweb);
451 list($width, $height, $type, $attr) = getimagesize($thumb);
452 $template->setVariable(
"ATTR", $attr);
453 $template->setVariable(
"THUMB_ALT", $this->lng->txt(
"thumbnail"));
454 $template->setVariable(
"THUMB_TITLE", $this->lng->txt(
"enlarge"));
455 $template->parseCurrentBlock();
459 $template->setCurrentBlock(
"ordering_row_standard_text");
460 $template->setVariable(
"ANSWER_TEXT", $this->object->prepareTextareaOutput($answer->getAnswertext(), TRUE));
461 $template->parseCurrentBlock();
463 $template->setCurrentBlock(
"ordering_row_standard");
466 $answer = $this->
object->answers[$idx];
467 $points = $answer->getPoints();
468 $resulttext = ($points == 1) ?
"(%s " . $this->lng->txt(
"point") .
")" :
"(%s " . $this->lng->txt(
"points") .
")";
469 $template->setVariable(
"RESULT_OUTPUT", sprintf($resulttext, $points));
471 foreach ($solutions as $solution)
473 if (strcmp($solution[
"value1"], $idx) == 0)
475 $template->setVariable(
"ANSWER_ORDER", $solution[
"value2"]);
478 $template->parseCurrentBlock();
480 $questiontext = $this->
object->getQuestion();
481 $template->setVariable(
"QUESTIONTEXT", $this->object->prepareTextareaOutput($questiontext, TRUE));
482 $questionoutput = $template->get();
484 if (strlen($feedback)) $solutiontemplate->setVariable(
"FEEDBACK", $feedback);
485 $solutiontemplate->setVariable(
"SOLUTION_OUTPUT", $questionoutput);
487 $solutionoutput = $solutiontemplate->get();
488 if (!$show_question_only)
493 return $solutionoutput;
501 $keys = array_keys($this->object->answers);
505 include_once
"./classes/class.ilTemplate.php";
506 $template =
new ilTemplate(
"tpl.il_as_qpl_ordering_output.html", TRUE, TRUE,
"Modules/TestQuestionPool");
509 if (strcmp($this->ctrl->getCmd(),
'preview') == 0)
511 if (array_key_exists(
'js',
$_GET))
513 $ilUser->writePref(
'tst_javascript',
$_GET[
'js']);
515 $jstemplate =
new ilTemplate(
"tpl.il_as_qpl_javascript_switch.html", TRUE, TRUE,
"Modules/TestQuestionPool");
516 if ($ilUser->getPref(
"tst_javascript") == 1)
519 $jstemplate->setVariable(
"JAVASCRIPT_IMAGE_ALT", $this->lng->txt(
"disable_javascript"));
520 $jstemplate->setVariable(
"JAVASCRIPT_IMAGE_TITLE", $this->lng->txt(
"disable_javascript"));
521 $this->ctrl->setParameterByClass($this->ctrl->getCmdClass(),
"js",
"0");
522 $jstemplate->setVariable(
"JAVASCRIPT_URL", $this->ctrl->getLinkTargetByClass($this->ctrl->getCmdClass(), $this->ctrl->getCmd()));
527 $jstemplate->setVariable(
"JAVASCRIPT_IMAGE_ALT", $this->lng->txt(
"enable_javascript"));
528 $jstemplate->setVariable(
"JAVASCRIPT_IMAGE_TITLE", $this->lng->txt(
"enable_javascript"));
529 $this->ctrl->setParameterByClass($this->ctrl->getCmdClass(),
"js",
"1");
530 $jstemplate->setVariable(
"JAVASCRIPT_URL", $this->ctrl->getLinkTargetByClass($this->ctrl->getCmdClass(), $this->ctrl->getCmd()));
532 $jsswitch = $jstemplate->get();
533 if ($ilUser->getPref(
'tst_javascript')) $this->object->setOutputType(
OUTPUT_JAVASCRIPT);
539 $this->tpl->addBlockFile(
"CONTENT_BLOCK",
"head_content",
"tpl.il_as_qpl_ordering_output_javascript.html",
"Modules/TestQuestionPool");
540 $this->tpl->setCurrentBlock(
"head_content");
541 $this->tpl->setVariable(
"JS_LOCATION",
"./Modules/TestQuestionPool/js/toolman/");
542 $this->tpl->parseCurrentBlock();
546 $this->tpl->setCurrentBlock(
"AdditionalStyle");
547 $this->tpl->setVariable(
"LOCATION_ADDITIONAL_STYLESHEET",
ilUtil::getStyleSheetLocation(
"output",
"test_javascript.css",
"Modules/TestQuestionPool"));
548 $this->tpl->parseCurrentBlock();
554 foreach ($keys as $idx)
556 $answer = $this->
object->answers[$idx];
557 if ($this->object->getOrderingType() ==
OQ_PICTURES)
559 $template->setCurrentBlock(
"ordering_row_standard_pictures");
560 $template->setVariable(
"PICTURE_HREF", $this->object->getImagePathWeb() . $answer->getAnswertext());
561 $thumbweb = $this->
object->getImagePathWeb() . $this->
object->getThumbPrefix() . $answer->getAnswertext();
562 $thumb = $this->
object->getImagePath() . $this->
object->getThumbPrefix() . $answer->getAnswertext();
563 if (!@file_exists($thumb)) $this->
object->rebuildThumbnails();
564 $template->setVariable(
"THUMB_HREF", $thumbweb);
565 $template->setVariable(
"THUMB_ALT", $this->lng->txt(
"thumbnail"));
566 $template->setVariable(
"THUMB_TITLE", $this->lng->txt(
"enlarge"));
567 $template->setVariable(
"ANSWER_ID", $answer->getRandomID());
568 $template->parseCurrentBlock();
572 $template->setCurrentBlock(
"ordering_row_standard_text");
573 $template->setVariable(
"ANSWER_TEXT", $this->object->prepareTextareaOutput($answer->getAnswertext(), TRUE));
574 $template->setVariable(
"ANSWER_ID", $answer->getRandomID());
575 $template->parseCurrentBlock();
577 $template->setCurrentBlock(
"ordering_row_standard");
578 $template->setVariable(
"ANSWER_ID", $answer->getRandomID());
579 $template->parseCurrentBlock();
584 foreach ($keys as $idx)
586 $answer = $this->
object->answers[$idx];
587 if ($this->object->getOrderingType() ==
OQ_PICTURES)
589 $template->setCurrentBlock(
"ordering_row_javascript_pictures");
590 $template->setVariable(
"PICTURE_HREF", $this->object->getImagePathWeb() . $answer->getAnswertext());
591 $thumbweb = $this->
object->getImagePathWeb() . $this->
object->getThumbPrefix() . $answer->getAnswertext();
592 $thumb = $this->
object->getImagePath() . $this->
object->getThumbPrefix() . $answer->getAnswertext();
593 if (!@file_exists($thumb)) $this->
object->rebuildThumbnails();
594 $template->setVariable(
"THUMB_HREF", $thumbweb);
595 $template->setVariable(
"THUMB_ALT", $this->lng->txt(
"thumbnail"));
596 $template->setVariable(
"THUMB_TITLE", $this->lng->txt(
"thumbnail"));
598 $template->setVariable(
"ENLARGE_ALT", $this->lng->txt(
"enlarge"));
599 $template->setVariable(
"ENLARGE_TITLE", $this->lng->txt(
"enlarge"));
600 $template->setVariable(
"ANSWER_ID", $answer->getRandomID());
601 $template->parseCurrentBlock();
605 $template->setCurrentBlock(
"ordering_row_javascript_text");
606 $template->setVariable(
"ANSWER_TEXT", $this->object->prepareTextareaOutput($answer->getAnswertext(), TRUE));
607 $template->setVariable(
"ANSWER_ID", $answer->getRandomID());
608 $template->parseCurrentBlock();
611 $template->setCurrentBlock(
"ordering_with_javascript");
612 if ($this->object->getOrderingType() ==
OQ_PICTURES)
614 $template->setVariable(
"RESET_POSITIONS", $this->lng->txt(
"reset_pictures"));
618 $template->setVariable(
"RESET_POSITIONS", $this->lng->txt(
"reset_definitions"));
620 $template->parseCurrentBlock();
622 $questiontext = $this->
object->getQuestion();
623 $template->setVariable(
"QUESTIONTEXT", $this->object->prepareTextareaOutput($questiontext, TRUE));
624 $questionoutput = $jsswitch . $template->get();
625 if (!$show_question_only)
630 return $questionoutput;
637 if (is_array($user_post_solution))
643 $keys = array_keys($this->object->answers);
649 include_once
"./classes/class.ilTemplate.php";
651 $template =
new ilTemplate(
"tpl.il_as_qpl_ordering_output.html", TRUE, TRUE,
"Modules/TestQuestionPool");
655 $this->tpl->addBlockFile(
"CONTENT_BLOCK",
"head_content",
"tpl.il_as_qpl_ordering_output_javascript.html",
"Modules/TestQuestionPool");
656 $this->tpl->setCurrentBlock(
"head_content");
657 $this->tpl->setVariable(
"JS_LOCATION",
"./Modules/TestQuestionPool/js/toolman/");
658 $this->tpl->parseCurrentBlock();
662 $this->tpl->setCurrentBlock(
"AdditionalStyle");
663 $this->tpl->setVariable(
"LOCATION_ADDITIONAL_STYLESHEET",
ilUtil::getStyleSheetLocation(
"output",
"test_javascript.css",
"Modules/TestQuestionPool"));
664 $this->tpl->parseCurrentBlock();
668 $this->tpl->setVariable(
"ON_SUBMIT",
"return saveOrder('orderlist');");
676 include_once
"./Modules/Test/classes/class.ilObjTest.php";
681 if (is_array($user_post_solution))
683 $solutions = array();
684 foreach ($user_post_solution as $key => $value)
686 if (preg_match(
"/order_(\d+)/", $key, $matches))
688 foreach ($this->object->getAnswers() as $answeridx => $answer)
690 if ($answer->getRandomID() == $matches[1])
692 array_push($solutions, array(
"value1" => $answeridx,
"value2" => $value));
700 $solutions =& $this->
object->getSolutionValues($active_id,
$pass);
705 $solution_script .=
"";
706 $jssolutions = array();
707 foreach ($solutions as $idx => $solution_value)
709 if ((strcmp($solution_value[
"value2"],
"") != 0) && (strcmp($solution_value[
"value1"],
"") != 0))
711 $jssolutions[$solution_value[
"value2"]] = $solution_value[
"value1"];
714 if (count($jssolutions))
718 foreach ($jssolutions as $key => $value)
720 if (is_object($this->object->getAnswer($value)))
722 $js .=
"initialorder.push('id_" . $this->
object->getAnswer($value)->getRandomID() .
"');";
725 $js .=
"restoreInitialOrder();";
729 $template->setCurrentBlock(
"javascript_restore_order");
730 $template->setVariable(
"RESTORE_ORDER", $js);
731 $template->parseCurrentBlock();
738 foreach ($keys as $idx)
740 $answer = $this->
object->answers[$idx];
741 if ($this->object->getOrderingType() ==
OQ_PICTURES)
743 $template->setCurrentBlock(
"ordering_row_standard_pictures");
744 $template->setVariable(
"PICTURE_HREF", $this->object->getImagePathWeb() . $answer->getAnswertext());
745 $thumbweb = $this->
object->getImagePathWeb() . $this->
object->getThumbPrefix() . $answer->getAnswertext();
746 $thumb = $this->
object->getImagePath() . $this->
object->getThumbPrefix() . $answer->getAnswertext();
747 if (!@file_exists($thumb)) $this->
object->rebuildThumbnails();
748 $template->setVariable(
"THUMB_HREF", $thumbweb);
749 $template->setVariable(
"THUMB_ALT", $this->lng->txt(
"thumbnail"));
750 $template->setVariable(
"THUMB_TITLE", $this->lng->txt(
"enlarge"));
751 $template->setVariable(
"ANSWER_ID", $answer->getRandomID());
752 $template->parseCurrentBlock();
756 $template->setCurrentBlock(
"ordering_row_standard_text");
757 $template->setVariable(
"ANSWER_TEXT", $this->object->prepareTextareaOutput($answer->getAnswertext(), TRUE));
758 $template->setVariable(
"ANSWER_ID", $answer->getRandomID());
759 $template->parseCurrentBlock();
761 $template->setCurrentBlock(
"ordering_row_standard");
762 $template->setVariable(
"ANSWER_ID", $answer->getRandomID());
763 if (is_array($solutions))
765 foreach ($solutions as $solution)
767 if (($solution[
"value1"] == $idx) && (strlen($solution[
"value2"])))
769 $template->setVariable(
"ANSWER_ORDER",
" value=\"" . $solution[
"value2"] .
"\"");
773 $template->parseCurrentBlock();
778 foreach ($keys as $idx)
780 $answer = $this->
object->answers[$idx];
781 if ($this->object->getOrderingType() ==
OQ_PICTURES)
783 $template->setCurrentBlock(
"ordering_row_javascript_pictures");
784 $template->setVariable(
"PICTURE_HREF", $this->object->getImagePathWeb() . $answer->getAnswertext());
785 $thumbweb = $this->
object->getImagePathWeb() . $this->
object->getThumbPrefix() . $answer->getAnswertext();
786 $thumb = $this->
object->getImagePath() . $this->
object->getThumbPrefix() . $answer->getAnswertext();
787 if (!@file_exists($thumb)) $this->
object->rebuildThumbnails();
788 $template->setVariable(
"THUMB_HREF", $thumbweb);
789 $template->setVariable(
"THUMB_ALT", $this->lng->txt(
"thumbnail"));
790 $template->setVariable(
"THUMB_TITLE", $this->lng->txt(
"thumbnail"));
792 $template->setVariable(
"ENLARGE_ALT", $this->lng->txt(
"enlarge"));
793 $template->setVariable(
"ENLARGE_TITLE", $this->lng->txt(
"enlarge"));
794 $template->setVariable(
"ANSWER_ID", $answer->getRandomID());
795 $template->parseCurrentBlock();
799 $template->setCurrentBlock(
"ordering_row_javascript_text");
800 $template->setVariable(
"ANSWER_TEXT", $this->object->prepareTextareaOutput($answer->getAnswertext(), TRUE));
801 $template->setVariable(
"ANSWER_ID", $answer->getRandomID());
802 $template->parseCurrentBlock();
805 $template->setCurrentBlock(
"ordering_with_javascript");
806 if ($this->object->getOrderingType() ==
OQ_PICTURES)
808 $template->setVariable(
"RESET_POSITIONS", $this->lng->txt(
"reset_pictures"));
812 $template->setVariable(
"RESET_POSITIONS", $this->lng->txt(
"reset_definitions"));
814 $template->parseCurrentBlock();
816 $questiontext = $this->
object->getQuestion();
817 $template->setVariable(
"QUESTIONTEXT", $this->object->prepareTextareaOutput($questiontext, TRUE));
818 $questionoutput = $template->get();
819 $pageoutput = $this->
outQuestionPage(
"", $is_postponed, $active_id, $questionoutput);
830 include_once
"./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
832 $this->
object->saveFeedbackGeneric(0,
$_POST[
"feedback_incomplete"]);
833 $this->
object->saveFeedbackGeneric(1,
$_POST[
"feedback_complete"]);
834 $this->
object->cleanupMediaObjectUsage();
845 global $rbacsystem, $ilTabs;
847 $this->ctrl->setParameterByClass(
"ilpageobjectgui",
"q_id",
$_GET[
"q_id"]);
848 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
849 $q_type = $this->
object->getQuestionType();
853 $classname = $q_type .
"GUI";
854 $this->ctrl->setParameterByClass(strtolower($classname),
"sel_question_types", $q_type);
855 $this->ctrl->setParameterByClass(strtolower($classname),
"q_id",
$_GET[
"q_id"]);
860 if ($rbacsystem->checkAccess(
'write',
$_GET[
"ref_id"]))
863 $ilTabs->addTarget(
"edit_content",
864 $this->ctrl->getLinkTargetByClass(
"ilPageObjectGUI",
"edit"),
865 array(
"edit",
"insert",
"exec_pg"),
866 "",
"", $force_active);
870 $ilTabs->addTarget(
"preview",
871 $this->ctrl->getLinkTargetByClass(
"ilPageObjectGUI",
"preview"),
873 "ilPageObjectGUI",
"", $force_active);
876 $force_active =
false;
877 if ($rbacsystem->checkAccess(
'write',
$_GET[
"ref_id"]))
880 if ($classname) $url = $this->ctrl->getLinkTargetByClass($classname,
"editQuestion");
881 $commands =
$_POST[
"cmd"];
882 if (is_array($commands))
884 foreach ($commands as $key => $value)
886 if (preg_match(
"/^delete_.*/", $key, $matches))
888 $force_active =
true;
893 $ilTabs->addTarget(
"edit_properties",
895 array(
"editQuestion",
"save",
"saveEdit",
"addanswers",
"removeanswers",
"changeToPictures",
"uploadanswers",
"changeToText",
"upanswers",
"downanswers",
"originalSyncForm"),
896 $classname,
"", $force_active);
901 $ilTabs->addTarget(
"feedback",
902 $this->ctrl->getLinkTargetByClass($classname,
"feedback"),
903 array(
"feedback",
"saveFeedback"),
909 $ilTabs->addTarget(
"solution_hint",
910 $this->ctrl->getLinkTargetByClass($classname,
"suggestedsolution"),
911 array(
"suggestedsolution",
"saveSuggestedSolution",
"outSolutionExplorer",
"cancel",
912 "addSuggestedSolution",
"cancelExplorer",
"linkChilds",
"removeSuggestedSolution"
922 $ilTabs->addTarget(
"statistics",
923 $this->ctrl->getLinkTargetByClass($classname,
"assessment"),
928 if ((
$_GET[
"calling_test"] > 0) || (
$_GET[
"test_ref_id"] > 0))
933 global $___test_express_mode;
935 if (!
$_GET[
'test_express_mode'] && !$___test_express_mode) {
936 $ilTabs->setBackTarget($this->lng->txt(
"backtocallingtest"),
"ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=$ref_id");
940 $ilTabs->setBackTarget($this->lng->txt(
"backtocallingtest"), $link);
945 $ilTabs->setBackTarget($this->lng->txt(
"qpl"), $this->ctrl->getLinkTargetByClass(
"ilobjquestionpoolgui",
"questions"));