4 require_once
'./Modules/Test/classes/inc.AssessmentConstants.php';
5 require_once
'Modules/Test/classes/class.ilTestExpressPage.php';
6 require_once
'Modules/TestQuestionPool/exceptions/class.ilTestQuestionPoolException.php';
7 require_once
'Modules/Test/classes/class.ilTestExpressPage.php';
8 require_once
'Modules/Test/classes/class.ilObjAssessmentFolder.php';
111 $this->ctrl->saveParameter($this,
"q_id");
112 $this->ctrl->saveParameter($this,
"prev_qid");
113 $this->ctrl->saveParameter($this,
"calling_test");
114 $this->ctrl->saveParameter($this,
"calling_consumer");
115 $this->ctrl->saveParameter($this,
"consumer_context");
116 $this->ctrl->saveParameterByClass(
'ilAssQuestionPageGUI',
'test_express_mode');
117 $this->ctrl->saveParameterByClass(
'ilAssQuestionPageGUI',
'calling_consumer');
118 $this->ctrl->saveParameterByClass(
'ilAssQuestionPageGUI',
'consumer_context');
119 $this->ctrl->saveParameterByClass(
'ilobjquestionpoolgui',
'test_express_mode');
120 $this->ctrl->saveParameterByClass(
'ilobjquestionpoolgui',
'calling_consumer');
121 $this->ctrl->saveParameterByClass(
'ilobjquestionpoolgui',
'consumer_context');
123 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
124 $this->errormessage = $this->lng->txt(
"fill_out_all_required_fields");
126 $this->selfassessmenteditingmode =
false;
127 $this->new_id_listeners =
array();
128 $this->new_id_listener_cnt = 0;
130 $this->navigationGUI = null;
139 $ilHelp = $DIC[
'ilHelp'];
140 $ilHelp->setScreenIdComponent(
'qpl');
142 $cmd = $this->ctrl->getCmd(
"editQuestion");
143 $next_class = $this->ctrl->getNextClass($this);
149 case 'ilformpropertydispatchgui':
152 require_once
'Services/Form/classes/class.ilFormPropertyDispatchGUI.php';
155 return $this->ctrl->forwardCommand($form_prop_dispatch);
355 if( is_object($this->
object) )
384 require_once
'Modules/TestQuestionPool/classes/tables/class.ilQuestionCumulatedStatisticsTableGUI.php';
387 require_once
'Modules/TestQuestionPool/classes/tables/class.ilQuestionUsagesTableGUI.php';
390 $tpl->setContent(implode(
'<br />',
array(
391 $stats_table->getHTML(),
392 $usage_table->getHTML()
409 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
411 if ((!$question_type)
and ($question_id > 0))
416 if (strlen($question_type) == 0)
return NULL;
421 $question =
new $question_type_gui();
424 $question->object->feedbackOBJ =
new $feedbackObjectClassname($question->object, $ilCtrl, $ilDB, $lng);
426 if ($question_id > 0)
428 $question->object->loadFromDb($question_id);
439 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
440 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
451 return $q_type .
"GUI";
468 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
474 $tpl->
addJavaScript(
'Modules/TestQuestionPool/js/ilAssMultipleChoice.js');
483 if(!$this->tpl->blockExists(
'content'))
485 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.il_as_qpl_content.html",
"Modules/TestQuestionPool");
488 if(!$this->tpl->blockExists(
'statusline'))
490 $this->tpl->addBlockFile(
"STATUSLINE",
"statusline",
"tpl.statusline.html");
493 if(!$this->tpl->blockExists(
'adm_content'))
495 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_question.html",
"Modules/TestQuestionPool");
505 $this->tpl->setVariable(
"QUESTION_DATA", $form->getHTML());
516 include_once(
"./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php");
519 $page_gui->setOutputMode(
"presentation");
520 $presentation = $page_gui->presentation();
521 $presentation = preg_replace(
"/src=\"\\.\\//ims",
"src=\"" . ILIAS_HTTP_PATH .
"/", $presentation);
522 return $presentation;
532 if( $this->
object->getTestPresentationConfig()->isSolutionInitiallyPrefilled() )
542 if ($this->
object->getTestPresentationConfig()->isUnchangedAnswerPossible())
549 $this->lng->loadLanguageModule(
"content");
552 include_once(
"./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php");
555 $page_gui->setTemplateTargetVar($a_temp_var);
560 $page_gui->setQuestionActionsHTML($this->
getNavigationGUI()->getActionsHTML());
570 $page_gui->setPresentationTitle($this->questionHeaderBlockBuilder->getPresentationTitle());
571 $page_gui->setQuestionInfoHTML($this->questionHeaderBlockBuilder->getQuestionInfoHTML());
574 return $page_gui->presentation();
581 $tpl =
new ilTemplate(
'tpl.tst_question_additional_behaviour_checkbox.html',
true,
true,
'Modules/TestQuestionPool');
582 $tpl->setVariable(
'TXT_FORCE_FORM_DIFF_LABEL', $this->
object->getTestPresentationConfig()->getUseUnchangedAnswerLabel());
591 return $this->lng->txt(
'use_previous_solution_advice');
596 $tpl =
new ilTemplate(
'tpl.tst_question_additional_behaviour_checkbox.html',
true,
true,
'Modules/TestQuestionPool');
598 $tpl->setVariable(
'TXT_FORCE_FORM_DIFF_LABEL', $this->lng->txt(
'use_previous_solution'));
609 if (
$_GET[
"calling_test"])
614 elseif (
$_GET[
"test_ref_id"])
621 if (
$_GET[
"q_id"] > 0)
623 $this->ctrl->setParameterByClass(
"ilAssQuestionPageGUI",
"q_id",
$_GET[
"q_id"]);
624 $this->ctrl->redirectByClass(
"ilAssQuestionPageGUI",
"edit");
628 $this->ctrl->redirectByClass(
"ilobjquestionpoolgui",
"questions");
639 if (strlen($return_to))
641 $this->ctrl->setParameter($this,
"return_to", $return_to);
643 else if ($_REQUEST[
'return_to']) {
644 $this->ctrl->setParameter($this,
"return_to", $_REQUEST[
'return_to']);
646 if(strlen($return_to_feedback))
648 $this->ctrl->setParameter($this,
'return_to_fb',
'true');
651 $this->ctrl->saveParameter($this,
'test_express_mode');
653 $template =
new ilTemplate(
"tpl.il_as_qpl_sync_original.html",TRUE, TRUE,
"Modules/TestQuestionPool");
654 $template->setVariable(
"BUTTON_YES", $this->lng->txt(
"yes"));
655 $template->setVariable(
"BUTTON_NO", $this->lng->txt(
"no"));
656 $template->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
657 $template->setVariable(
"TEXT_SYNC", $this->lng->txt(
"confirm_sync_questions"));
658 $this->tpl->setVariable(
"ADM_CONTENT", $template->get());
663 $original_id = $this->
object->original_id;
666 $this->
object->syncWithOriginal();
668 if (strlen(
$_GET[
"return_to"]))
670 $this->ctrl->redirect($this,
$_GET[
"return_to"]);
672 if (strlen($_REQUEST[
"return_to_fb"]))
674 $this->ctrl->redirectByClass(
'ilAssQuestionFeedbackEditingGUI',
'showFeedbackForm');
678 if(isset(
$_GET[
'calling_consumer']) && (
int)
$_GET[
'calling_consumer'])
680 $ref_id = (int)$_GET[
'calling_consumer'];
684 ilUtil::redirect($consumer->getQuestionEditingFormBackTarget($_GET[
'consumer_context']));
686 require_once
'Services/Link/classes/class.ilLink.php';
689 $_GET[
"ref_id"] = $_GET[
"calling_test"];
691 if($_REQUEST[
'test_express_mode'])
697 ilUtil::redirect(
"ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=".$_GET[
"calling_test"]);
704 if (strlen(
$_GET[
"return_to"]))
706 $this->ctrl->redirect($this,
$_GET[
"return_to"]);
708 if(strlen($_REQUEST[
'return_to_fb']))
710 $this->ctrl->redirectByClass(
'ilAssQuestionFeedbackEditingGUI',
'showFeedbackForm');
714 if(isset(
$_GET[
'calling_consumer']) && (
int)
$_GET[
'calling_consumer'])
716 $ref_id = (int)$_GET[
'calling_consumer'];
720 ilUtil::redirect($consumer->getQuestionEditingFormBackTarget($_GET[
'consumer_context']));
722 require_once
'Services/Link/classes/class.ilLink.php';
725 $_GET[
"ref_id"] = $_GET[
"calling_test"];
727 if($_REQUEST[
'test_express_mode'])
733 ilUtil::redirect(
"ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=".$_GET[
"calling_test"]);
748 $ilUser->setPref(
"tst_lastquestiontype", $this->
object->getQuestionType());
749 $ilUser->writePref(
"tst_lastquestiontype", $this->
object->getQuestionType());
750 $this->
object->saveToDb();
751 $originalexists = $this->
object->_questionExists($this->
object->original_id);
752 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
755 $this->ctrl->redirect($this,
"originalSyncForm");
757 elseif (
$_GET[
"calling_test"])
763 elseif (
$_GET[
"test_ref_id"])
765 global $tree,
$ilDB, $ilPluginAdmin;
767 include_once (
"./Modules/Test/classes/class.ilObjTest.php");
771 require_once
'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
774 $test->insertQuestion( $testQuestionSetConfigFactory->getQuestionSetConfig(), $this->
object->getId() );
780 $this->ctrl->setParameter($this,
"q_id", $this->
object->getId());
781 $this->editQuestion();
790 $this->ctrl->setParameterByClass(
"ilAssQuestionPageGUI",
"q_id", $this->
object->getId());
791 $this->ctrl->redirectByClass(
"ilAssQuestionPageGUI",
"edit");
802 $old_id =
$_GET[
"q_id"];
807 $ilUser->setPref(
"tst_lastquestiontype", $this->
object->getQuestionType());
808 $ilUser->writePref(
"tst_lastquestiontype", $this->
object->getQuestionType());
809 $this->
object->saveToDb();
810 $originalexists = $this->
object->_questionExistsInPool($this->
object->original_id);
813 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
817 $this->ctrl->setParameter($this,
'return_to',
'editQuestion');
818 $this->ctrl->redirect($this,
"originalSyncForm");
821 elseif($_GET[
"calling_test"])
823 require_once
'Modules/Test/classes/class.ilObjTest.php';
827 global $tree,
$ilDB, $ilPluginAdmin;
829 include_once(
"./Modules/Test/classes/class.ilObjTest.php");
830 $_GET[
"ref_id"] = $_GET[
"calling_test"];
833 require_once
'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
836 $new_id =
$test->insertQuestion(
837 $testQuestionSetConfigFactory->getQuestionSetConfig(), $this->
object->getId()
840 if(isset($_REQUEST[
'prev_qid']))
842 $test->moveQuestionAfter($this->
object->getId() + 1, $_REQUEST[
'prev_qid']);
845 $this->ctrl->setParameter($this,
'q_id', $new_id);
846 $this->ctrl->setParameter($this,
'calling_test', $_GET[
'calling_test']);
847 #$this->ctrl->setParameter($this, 'test_ref_id', false); 850 $this->ctrl->redirect($this,
'editQuestion');
857 if($this->
object->getId() != $old_id)
860 $this->ctrl->setParameterByClass($_GET[
"cmdClass"],
"q_id", $this->
object->getId());
861 $this->ctrl->setParameterByClass($_GET[
"cmdClass"],
"sel_question_types", $_GET[
"sel_question_types"]);
868 if($_REQUEST[
'prev_qid'])
872 include_once(
"./Modules/Test/classes/class.ilObjTest.php");
874 $test->moveQuestionAfter($_REQUEST[
'prev_qid'], $this->
object->getId());
876 if( $_REQUEST[
'express_mode'] )
878 global $tree,
$ilDB, $ilPluginAdmin;
880 include_once(
"./Modules/Test/classes/class.ilObjTest.php");
883 require_once
'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
886 $test->insertQuestion(
887 $testQuestionSetConfigFactory->getQuestionSetConfig(), $this->
object->getId()
890 require_once
'Modules/Test/classes/class.ilTestExpressPage.php';
891 $_REQUEST[
'q_id'] = $this->
object->getId();
895 $this->ctrl->redirectByClass($_GET[
"cmdClass"],
"editQuestion");
905 $this->ctrl->redirect($this,
'editQuestion');
916 $old_id =
$_GET[
"q_id"];
920 $ilUser->setPref(
"tst_lastquestiontype", $this->
object->getQuestionType());
921 $ilUser->writePref(
"tst_lastquestiontype", $this->
object->getQuestionType());
922 $this->
object->saveToDb();
923 $originalexists = $this->
object->_questionExistsInPool($this->
object->original_id);
924 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
928 $this->ctrl->setParameter($this,
'test_express_mode', $_REQUEST[
'test_express_mode']);
929 $this->ctrl->redirect($this,
"originalSyncForm");
932 elseif($_GET[
"calling_test"])
934 require_once
'Modules/Test/classes/class.ilObjTest.php';
936 #var_dump(assQuestion::_questionExistsInTest($this->object->getId(), $test->getTestId())); 937 $q_id = $this->
object->getId();
940 global $tree,
$ilDB, $ilPluginAdmin;
942 include_once(
"./Modules/Test/classes/class.ilObjTest.php");
943 $_GET[
"ref_id"] = $_GET[
"calling_test"];
946 require_once
'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
949 $new_id =
$test->insertQuestion(
950 $testQuestionSetConfigFactory->getQuestionSetConfig(), $this->
object->getId()
954 if(isset($_REQUEST[
'prev_qid']))
956 $test->moveQuestionAfter($this->
object->getId() + 1, $_REQUEST[
'prev_qid']);
959 $this->ctrl->setParameter($this,
'q_id', $new_id);
960 $this->ctrl->setParameter($this,
'calling_test', $_GET[
'calling_test']);
961 #$this->ctrl->setParameter($this, 'test_ref_id', false); 966 $_REQUEST[
'test_express_mode']
973 ilUtil::redirect(
"ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=" . $_GET[
"calling_test"]);
978 if($this->
object->getId() != $old_id)
982 $this->ctrl->redirectByClass(
"ilobjquestionpoolgui",
"questions");
992 $this->ctrl->redirectByClass(
"ilobjquestionpoolgui",
"questions");
1003 $this->
object->saveToDb();
1004 $this->ctrl->setParameter($this,
"q_id", $this->
object->getId());
1005 $this->editQuestion();
1018 $tmpPath = $cont_obj->getLMTree()->getPathFull($a_endnode_id, $a_startnode_id);
1021 for ($i = 1; $i < (count($tmpPath) - 1); $i++)
1028 $path .= $tmpPath[$i][
"title"];
1036 $this->sequence_no = $nr;
1046 $this->question_count = $a_question_count;
1066 $this->errormessage .= ((strlen($this->errormessage)) ?
"<br />" :
"") .
$errormessage;
1083 return $this->
object->getQuestionType();
1096 if (strlen($a_value))
1098 $result =
" value=\"$a_value\" ";
1110 $cnt = $this->new_id_listener_cnt;
1111 $this->new_id_listeners[$cnt][
"object"] =& $a_object;
1112 $this->new_id_listeners[$cnt][
"method"] = $a_method;
1113 $this->new_id_listeners[$cnt][
"parameters"] = $a_parameters;
1114 $this->new_id_listener_cnt++;
1123 for ($i=0; $i<$this->new_id_listener_cnt; $i++)
1125 $this->new_id_listeners[$i][
"parameters"][
"new_id"] = $a_new_id;
1126 $object =& $this->new_id_listeners[$i][
"object"];
1127 $method = $this->new_id_listeners[$i][
"method"];
1128 $parameters = $this->new_id_listeners[$i][
"parameters"];
1133 $object->$method($parameters);
1143 if(!$this->
object->getSelfAssessmentEditingMode())
1145 $form->addCommandButton(
"saveReturn", $this->lng->txt(
"save_return"));
1147 $form->addCommandButton(
"save", $this->lng->txt(
"save"));
1160 $title->setMaxLength(100);
1162 $title->setRequired(TRUE);
1165 if (!$this->
object->getSelfAssessmentEditingMode())
1168 $author =
new ilTextInputGUI($this->lng->txt(
"author"),
"author");
1170 $author->setRequired(TRUE);
1171 $form->addItem($author);
1174 $description =
new ilTextInputGUI($this->lng->txt(
"description"),
"comment");
1176 $description->setRequired(FALSE);
1177 $form->addItem($description);
1184 if (trim($author) ==
"")
1188 $hi->setValue($author);
1189 $form->addItem($hi);
1196 $question->setRequired(TRUE);
1197 $question->setRows(10);
1198 $question->setCols(80);
1200 if (!$this->
object->getSelfAssessmentEditingMode())
1204 $question->setUseRte(TRUE);
1205 include_once
"./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
1207 $question->addPlugin(
"latex");
1208 $question->addButton(
"latex");
1209 $question->addButton(
"pastelatex");
1210 $question->setRTESupport($this->
object->getId(),
"qpl",
"assessment");
1215 require_once
'Modules/TestQuestionPool/classes/questions/class.ilAssSelfAssessmentQuestionFormatter.php';
1217 $question->setUseTagsForRteOnly(
false);
1219 $form->addItem($question);
1221 if (!$this->
object->getSelfAssessmentEditingMode())
1228 $ewt = $this->
object->getEstimatedWorkingTime();
1238 if (strlen($this->
object->getNrOfTries()))
1240 $nr_tries = $this->
object->getNrOfTries();
1244 $nr_tries = $this->
object->getDefaultNrOfTries();
1251 $ni =
new ilNumberInputGUI($this->lng->txt(
"qst_nr_of_tries"),
"nr_of_tries");
1253 $ni->setMinValue(0);
1255 $ni->setMaxLength(5);
1256 $form->addItem($ni);
1264 require_once
'Services/Taxonomy/classes/class.ilTaxAssignInputGUI.php';
1268 $postvar =
"tax_node_assign_$taxonomyId";
1272 $tax_node_assign->saveInput(
"qpl", $this->
object->getObjId(),
"quest", $this->
object->getId());
1282 $sectHeader->setTitle($this->lng->txt(
'qpl_qst_edit_form_taxonomy_section'));
1285 require_once
'Services/Taxonomy/classes/class.ilTaxSelectInputGUI.php';
1290 $label = sprintf($this->lng->txt(
'qpl_qst_edit_form_taxonomy'), $taxonomy->getTitle());
1291 $postvar =
"tax_node_assign_$taxonomyId";
1296 require_once
'Services/Taxonomy/classes/class.ilTaxNodeAssignment.php';
1300 $taxSelect->setValue(array_map(
function($assignedNode) {
1301 return $assignedNode[
'node_id'];
1302 }, $assignedNodes));
1334 include_once
"./Modules/Test/classes/class.ilObjTest.php";
1336 if (strlen($manual_feedback))
1338 return $manual_feedback;
1340 $correct_feedback = $this->
object->feedbackOBJ->getGenericFeedbackTestPresentation($this->
object->getId(),
true);
1341 $incorrect_feedback = $this->
object->feedbackOBJ->getGenericFeedbackTestPresentation($this->
object->getId(),
false);
1342 if (strlen($correct_feedback.$incorrect_feedback))
1344 $reached_points = $this->
object->calculateReachedPoints($active_id,
$pass);
1345 $max_points = $this->
object->getMaximumPoints();
1346 if ($reached_points == $max_points)
1352 $output = $incorrect_feedback;
1355 return $this->
object->prepareTextareaOutput(
$output, TRUE);
1360 return $this->
object->prepareTextareaOutput(
1361 $this->
object->feedbackOBJ->getGenericFeedbackTestPresentation($this->object->getId(),
true),
true 1367 return $this->
object->prepareTextareaOutput(
1368 $this->
object->feedbackOBJ->getGenericFeedbackTestPresentation($this->object->getId(),
false),
true 1387 $count = $this->
object->isInUse();
1389 if ($this->
object->_questionExistsInPool($this->object->getId()) && $count)
1392 if ($rbacsystem->checkAccess(
"write",
$_GET[
"ref_id"]))
1394 ilUtil::sendInfo(sprintf($this->lng->txt(
"qpl_question_is_in_use"), $count));
1416 $save = (is_array(
$_POST[
"cmd"]) && array_key_exists(
"suggestedsolution",
$_POST[
"cmd"])) ? TRUE : FALSE;
1418 if ($save &&
$_POST[
"deleteSuggestedSolution"] == 1)
1420 $this->
object->deleteSuggestedSolutions();
1422 $this->ctrl->redirect($this,
"suggestedsolution");
1426 $solution_array = $this->
object->getSuggestedSolution(0);
1428 "lm" => $this->lng->txt(
"obj_lm"),
1429 "st" => $this->lng->txt(
"obj_st"),
1430 "pg" => $this->lng->txt(
"obj_pg"),
1431 "git" => $this->lng->txt(
"glossary_term"),
1432 "file" => $this->lng->txt(
"fileDownload"),
1433 "text" => $this->lng->txt(
"solutionText")
1436 if ((strcmp(
$_POST[
"solutiontype"],
"file") == 0) && (strcmp($solution_array[
"type"],
"file") != 0))
1438 $solution_array =
array(
1442 elseif ((strcmp(
$_POST[
"solutiontype"],
"text") == 0) && (strcmp($solution_array[
"type"],
"text") != 0))
1447 $solution_array =
array(
1453 if ($save && strlen(
$_POST[
"filename"]))
1455 $solution_array[
"value"][
"filename"] =
$_POST[
"filename"];
1457 if ($save && strlen(
$_POST[
"solutiontext"]))
1459 $solution_array[
"value"] =
$_POST[
"solutiontext"];
1461 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
1462 if (count($solution_array))
1465 $form->setFormAction($this->ctrl->getFormAction($this));
1466 $form->setTitle($this->lng->txt(
"solution_hint"));
1467 $form->setMultipart(TRUE);
1468 $form->setTableWidth(
"100%");
1469 $form->setId(
"suggestedsolutiondisplay");
1472 include_once
"./Modules/TestQuestionPool/classes/class.ilSolutionTitleInputGUI.php";
1474 $template =
new ilTemplate(
"tpl.il_as_qpl_suggested_solution_input_presentation.html", TRUE, TRUE,
"Modules/TestQuestionPool");
1475 if (strlen($solution_array[
"internal_link"]))
1478 $template->setCurrentBlock(
"preview");
1479 $template->setVariable(
"TEXT_SOLUTION", $this->lng->txt(
"suggested_solution"));
1480 $template->setVariable(
"VALUE_SOLUTION",
" <a href=\"$href\" target=\"content\">" . $this->lng->txt(
"view").
"</a> ");
1481 $template->parseCurrentBlock();
1483 elseif ((strcmp($solution_array[
"type"],
"file") == 0) && (is_array($solution_array[
"value"])))
1485 $href = $this->
object->getSuggestedSolutionPathWeb() . $solution_array[
"value"][
"name"];
1486 $template->setCurrentBlock(
"preview");
1487 $template->setVariable(
"TEXT_SOLUTION", $this->lng->txt(
"suggested_solution"));
1488 $template->setVariable(
"VALUE_SOLUTION",
" <a href=\"$href\" target=\"content\">" .
ilUtil::prepareFormOutput((strlen($solution_array[
"value"][
"filename"])) ? $solution_array[
"value"][
"filename"] : $solution_array[
"value"][
"name"]).
"</a> ");
1489 $template->parseCurrentBlock();
1491 $template->setVariable(
"TEXT_TYPE", $this->lng->txt(
"type"));
1492 $template->setVariable(
"VALUE_TYPE",
$options[$solution_array[
"type"]]);
1493 $title->setHtml($template->get());
1495 $deletesolution->setOptionTitle($this->lng->txt(
"deleteSuggestedSolution"));
1496 $title->addSubItem($deletesolution);
1499 if (strcmp($solution_array[
"type"],
"file") == 0)
1503 $file->setRequired(TRUE);
1504 $file->enableFileNameSelection(
"filename");
1506 if( $_FILES[
"file"][
"tmp_name"] &&
$file->checkInput() )
1516 if (is_array($solution_array[
"value"])) @unlink($this->
object->getSuggestedSolutionPath() . $solution_array[
"value"][
"name"]);
1517 $file->setValue($_FILES[
"file"][
"name"]);
1518 $this->
object->saveSuggestedSolution(
"file",
"", 0,
array(
"name" => $_FILES[
"file"][
"name"],
"type" => $_FILES[
"file"][
"type"],
"size" => $_FILES[
"file"][
"size"],
"filename" =>
$_POST[
"filename"]));
1519 $originalexists = $this->
object->_questionExistsInPool($this->
object->original_id);
1527 $this->ctrl->redirect($this,
"suggestedsolution");
1538 if (is_array($solution_array[
"value"]))
1540 $file->setValue($solution_array[
"value"][
"name"]);
1541 $file->setFilename((strlen($solution_array[
"value"][
"filename"])) ? $solution_array[
"value"][
"filename"] : $solution_array[
"value"][
"name"]);
1544 $form->addItem(
$file);
1546 $hidden->setValue(
"file");
1547 $form->addItem($hidden);
1549 else if (strcmp($solution_array[
"type"],
"text") == 0)
1551 $solutionContent = $solution_array[
'value'];
1552 $solutionContent = $this->
object->fixSvgToPng($solutionContent);
1553 $solutionContent = $this->
object->fixUnavailableSkinImageSources($solutionContent);
1555 $question->
setValue($this->
object->prepareTextareaOutput($solutionContent));
1556 $question->setRequired(TRUE);
1557 $question->setRows(10);
1558 $question->setCols(80);
1559 $question->setUseRte(TRUE);
1560 $question->addPlugin(
"latex");
1561 $question->addButton(
"latex");
1562 $question->setRTESupport($this->
object->getId(),
"qpl",
"assessment");
1564 $hidden->setValue(
"text");
1565 $form->addItem($hidden);
1566 $form->addItem($question);
1568 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
'ref_id']))
1570 $form->addCommandButton(
'showSuggestedSolution', $this->lng->txt(
'cancel'));
1571 $form->addCommandButton(
'suggestedsolution', $this->lng->txt(
'save'));
1576 if ($form->checkInput())
1578 switch ($solution_array[
"type"])
1581 $this->
object->saveSuggestedSolution(
"file",
"", 0,
array(
1582 "name" => $solution_array[
"value"][
"name"],
1583 "type" => $solution_array[
"value"][
"type"],
1584 "size" => $solution_array[
"value"][
"size"],
1585 "filename" =>
$_POST[
"filename"]
1589 $this->
object->saveSuggestedSolution(
"text",
"", 0, $solution_array[
"value"]);
1592 $originalexists = $this->
object->_questionExistsInPool($this->
object->original_id);
1600 $this->ctrl->redirect($this,
"suggestedsolution");
1608 $savechange = (strcmp($this->ctrl->getCmd(),
"saveSuggestedSolution") == 0) ? TRUE : FALSE;
1611 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
'ref_id']))
1614 $formchange->setFormAction($this->ctrl->getFormAction($this));
1615 $formchange->setTitle((count($solution_array)) ? $this->lng->txt(
"changeSuggestedSolution") : $this->lng->txt(
"addSuggestedSolution"));
1616 $formchange->setMultipart(FALSE);
1617 $formchange->setTableWidth(
"100%");
1618 $formchange->setId(
"suggestedsolution");
1620 $solutiontype =
new ilRadioGroupInputGUI($this->lng->txt(
"suggestedSolutionType"),
"solutiontype");
1621 foreach(
$options as $opt_value => $opt_caption)
1625 if (count($solution_array))
1627 $solutiontype->setValue($solution_array[
"type"]);
1629 $solutiontype->setRequired(TRUE);
1630 $formchange->addItem($solutiontype);
1632 $formchange->addCommandButton(
"saveSuggestedSolution", $this->lng->txt(
"select"));
1636 $formchange->checkInput();
1638 $changeoutput = $formchange->getHTML();
1641 $this->tpl->setVariable(
"ADM_CONTENT", $changeoutput .
$output);
1648 include_once(
"./Modules/TestQuestionPool/classes/class.ilSolutionExplorer.php");
1649 $type =
$_GET[
"link_new_type"];
1650 $search =
$_GET[
"search_link_type"];
1651 $this->ctrl->setParameter($this,
"link_new_type", $type);
1652 $this->ctrl->setParameter($this,
"search_link_type", $search);
1653 $this->ctrl->saveParameter($this,
array(
"subquestion_index",
"link_new_type",
"search_link_type"));
1657 $parent_ref_id = $tree->getParentId(
$_GET[
"ref_id"]);
1658 $exp =
new ilSolutionExplorer($this->ctrl->getLinkTarget($this,
'suggestedsolution'), get_class($this));
1660 $exp->setExpandTarget($this->ctrl->getLinkTarget($this,
'outSolutionExplorer'));
1661 $exp->setTargetGet(
"ref_id");
1662 $exp->setRefId(
$_GET[
"ref_id"]);
1663 $exp->addFilter($type);
1664 $exp->setSelectableType($type);
1665 if(isset(
$_GET[
'expandCurrentPath']) &&
$_GET[
'expandCurrentPath'])
1667 $exp->expandPathByRefId($parent_ref_id);
1673 $template =
new ilTemplate(
"tpl.il_as_qpl_explorer.html", TRUE, TRUE,
"Modules/TestQuestionPool");
1674 $template->setVariable(
"EXPLORER_TREE",$exp->getOutput());
1675 $template->setVariable(
"BUTTON_CANCEL",$this->lng->txt(
"cancel"));
1676 $template->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this,
"suggestedsolution"));
1677 $this->tpl->setVariable(
"ADM_CONTENT", $template->get());
1684 include_once(
"./Modules/TestQuestionPool/classes/class.ilSolutionExplorer.php");
1685 switch (
$_POST[
"solutiontype"])
1711 if(isset(
$_POST[
'solutiontype']))
1713 $this->ctrl->setParameter($this,
'expandCurrentPath', 1);
1715 $this->ctrl->setParameter($this,
"link_new_type", $type);
1716 $this->ctrl->setParameter($this,
"search_link_type", $search);
1717 $this->ctrl->redirect($this,
"outSolutionExplorer");
1722 $this->ctrl->redirect($this,
"suggestedsolution");
1727 require_once
'Modules/TestQuestionPool/classes/tables/class.ilQuestionInternalLinkSelectionTableGUI.php';
1728 require_once
'Modules/LearningModule/classes/class.ilLMPageObject.php';
1729 require_once
'Modules/LearningModule/classes/class.ilObjContentObjectGUI.php';
1731 $this->ctrl->setParameter($this,
'q_id', $this->
object->getId());
1734 $cont_obj = $cont_obj_gui->object;
1736 $shownpages =
array();
1737 $tree = $cont_obj->getLMTree();
1738 $chapters = $tree->getSubtree($tree->getNodeData($tree->getRootId()));
1742 foreach($chapters as $chapter)
1744 $chapterpages = $tree->getChildsByType($chapter[
'obj_id'],
'pg');
1745 foreach($chapterpages as $page)
1747 if($page[
'type'] ==
$_GET[
'search_link_type'])
1749 array_push($shownpages, $page[
'obj_id']);
1751 if($tree->isInTree($page[
'obj_id']))
1760 $this->ctrl->setParameter($this, $page[
'type'], $page[
'obj_id']);
1762 'title' => $page[
'title'],
1764 'text_add' => $this->lng->txt(
'add'),
1765 'href_add' => $this->ctrl->getLinkTarget($this,
'add' . strtoupper($page[
'type']))
1770 foreach($pages as $page)
1772 if(!in_array($page[
'obj_id'], $shownpages))
1774 $this->ctrl->setParameter($this, $page[
'type'], $page[
'obj_id']);
1776 'title' => $page[
'title'],
1777 'description' =>
'---',
1778 'text_add' => $this->lng->txt(
'add'),
1779 'href_add' => $this->ctrl->getLinkTarget($this,
'add' . strtoupper($page[
'type']))
1784 require_once
'Modules/TestQuestionPool/classes/tables/class.ilQuestionInternalLinkSelectionTableGUI.php';
1787 $table->setData($rows);
1789 $this->tpl->setContent($table->getHTML());
1794 require_once
'Modules/TestQuestionPool/classes/tables/class.ilQuestionInternalLinkSelectionTableGUI.php';
1795 require_once
'Modules/LearningModule/classes/class.ilObjContentObjectGUI.php';
1797 $this->ctrl->setParameter($this,
'q_id', $this->
object->getId());
1800 $cont_obj = $cont_obj_gui->object;
1801 $ctree = $cont_obj->getLMTree();
1802 $nodes = $ctree->getSubtree($ctree->getNodeData($ctree->getRootId()));
1806 foreach($nodes as $node)
1808 if($node[
'type'] ==
$_GET[
'search_link_type'])
1810 $this->ctrl->setParameter($this, $node[
'type'], $node[
'obj_id']);
1812 'title' => $node[
'title'],
1813 'description' =>
'',
1814 'text_add' => $this->lng->txt(
'add'),
1815 'href_add' => $this->ctrl->getLinkTarget($this,
'add' . strtoupper($node[
'type']))
1822 $table->setData($rows);
1824 $this->tpl->setContent($table->getHTML());
1829 require_once
'Modules/TestQuestionPool/classes/tables/class.ilQuestionInternalLinkSelectionTableGUI.php';
1830 require_once
'Modules/Glossary/classes/class.ilObjGlossary.php';
1832 $this->ctrl->setParameter($this,
'q_id', $this->
object->getId());
1835 $terms = $glossary->getTermList();
1839 foreach($terms as $term)
1841 $this->ctrl->setParameter($this,
'git', $term[
'id']);
1843 'title' => $term[
'term'],
1844 'description' =>
'',
1845 'text_add' => $this->lng->txt(
'add'),
1846 'href_add' => $this->ctrl->getLinkTarget($this,
'addGIT')
1851 $table->setTitle($this->lng->txt(
'glossary_term'));
1852 $table->setData($rows);
1854 $this->tpl->setContent($table->getHTML());
1859 $this->ctrl->saveParameter($this,
array(
"subquestion_index",
"link_new_type",
"search_link_type"));
1860 switch (
$_GET[
"search_link_type"])
1872 $subquestion_index = (
$_GET[
"subquestion_index"] > 0) ?
$_GET[
"subquestion_index"] : 0;
1873 $this->
object->saveSuggestedSolution(
"lm",
"il__lm_" .
$_GET[
"source_id"], $subquestion_index);
1875 $this->ctrl->redirect($this,
"suggestedsolution");
1882 $subquestion_index = 0;
1883 if (strlen(
$_GET[
"subquestion_index"]) &&
$_GET[
"subquestion_index"] >= 0)
1885 $subquestion_index =
$_GET[
"subquestion_index"];
1887 $this->
object->saveSuggestedSolution(
"pg",
"il__pg_" .
$_GET[
"pg"], $subquestion_index);
1889 $this->ctrl->redirect($this,
"suggestedsolution");
1894 $subquestion_index = 0;
1895 if (strlen(
$_GET[
"subquestion_index"]) &&
$_GET[
"subquestion_index"] >= 0)
1897 $subquestion_index =
$_GET[
"subquestion_index"];
1899 $this->
object->saveSuggestedSolution(
"st",
"il__st_" .
$_GET[
"st"], $subquestion_index);
1901 $this->ctrl->redirect($this,
"suggestedsolution");
1906 $subquestion_index = 0;
1907 if (strlen(
$_GET[
"subquestion_index"]) &&
$_GET[
"subquestion_index"] >= 0)
1909 $subquestion_index =
$_GET[
"subquestion_index"];
1911 $this->
object->saveSuggestedSolution(
"git",
"il__git_" .
$_GET[
"git"], $subquestion_index);
1913 $this->ctrl->redirect($this,
"suggestedsolution");
1918 return in_array($this->ctrl->getCmd(),
array(
'save',
'saveEdit',
'saveReturn'));
1931 $reflectionClass =
new ReflectionClass($guiClassName);
1935 if( $reflectionClass instanceof ReflectionClass )
1937 $commands =
array();
1939 foreach($reflectionClass->getConstants() as $constName => $constValue)
1941 if( substr($constName, 0, strlen($cmdConstantNameBegin)) == $cmdConstantNameBegin )
1943 $commands[] = $constValue;
1953 global $rbacsystem, $ilTabs;
1955 $ilTabs->clearTargets();
1957 $this->ctrl->setParameterByClass(
"ilAssQuestionPageGUI",
"q_id",
$_GET[
"q_id"]);
1958 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
1959 $q_type = $this->
object->getQuestionType();
1961 if (strlen($q_type))
1963 $classname = $q_type .
"GUI";
1964 $this->ctrl->setParameterByClass(strtolower($classname),
"sel_question_types", $q_type);
1965 $this->ctrl->setParameterByClass(strtolower($classname),
"q_id",
$_GET[
"q_id"]);
1970 if ($rbacsystem->checkAccess(
'write',
$_GET[
"ref_id"]))
1973 $ilTabs->addTarget(
"edit_page",
1974 $this->ctrl->getLinkTargetByClass(
"ilAssQuestionPageGUI",
"edit"),
1975 array(
"edit",
"insert",
"exec_pg"),
1976 "",
"", $force_active);
1981 $force_active =
false;
1982 if ($rbacsystem->checkAccess(
'write',
$_GET[
"ref_id"]))
1985 if ($classname)
$url = $this->ctrl->getLinkTargetByClass($classname,
"editQuestion");
1986 $force_active =
false;
1988 $ilTabs->addTarget(
"edit_question",
1991 $classname,
"", $force_active);
2006 $ilTabs->addTarget(
"statistics",
2007 $this->ctrl->getLinkTargetByClass($classname,
"assessment"),
2008 array(
"assessment"),
2020 $this->ctrl->getLinkTargetByClass($classname,
"suggestedsolution"),
2021 array(
"suggestedsolution",
"saveSuggestedSolution",
"outSolutionExplorer",
"cancel",
2022 "addSuggestedSolution",
"cancelExplorer",
"linkChilds",
"removeSuggestedSolution" 2037 return array(
'editQuestion',
'save',
'saveEdit',
'originalSyncForm');
2055 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionFeedbackEditingGUI.php';
2056 $tabCommands = self::getCommandsFromClassConstants(
'ilAssQuestionFeedbackEditingGUI');
2060 $tabs->
addTarget(
'tst_feedback', $tabLink, $tabCommands, $ilCtrl->getCmdClass(),
'');
2066 protected function addTab_Units(
ilTabsGUI $tabs)
2073 $tabs->
addTarget(
'units', $ilCtrl->getLinkTargetByClass(
'ilLocalUnitConfigurationGUI',
''),
'',
'illocalunitconfigurationgui');
2086 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintsGUI.php';
2088 switch( $ilCtrl->getCmdClass() )
2090 case 'ilassquestionhintsgui':
2092 $tabCommands = self::getCommandsFromClassConstants(
'ilAssQuestionHintsGUI');
2095 case 'ilassquestionhintgui':
2097 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintGUI.php';
2098 $tabCommands = self::getCommandsFromClassConstants(
'ilAssQuestionHintGUI');
2103 $tabCommands =
array();
2108 $tabs->
addTarget(
'tst_question_hints_tab', $tabLink, $tabCommands, $ilCtrl->getCmdClass(),
'');
2113 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionPreviewGUI.php';
2119 array(
'ilAssQuestionPreviewGUI')
2126 $graphicalOutput = FALSE,
2127 $result_output = FALSE,
2128 $show_question_only = TRUE,
2129 $show_feedback = FALSE,
2130 $show_correct_solution = FALSE,
2131 $show_manual_scoring = FALSE,
2132 $show_question_text = TRUE
2137 $reachedPoints = $this->
object->getAdjustedReachedPoints($activeId, $passIndex,
true);
2138 $maximumPoints = $this->
object->getMaximumPoints();
2140 return $reachedPoints == $maximumPoints;
2145 return $this->
object->isAutosaveable();
2150 $this->
object->setTitle(
$_POST[
"title"] );
2151 $this->
object->setAuthor(
$_POST[
"author"] );
2152 $this->
object->setComment(
$_POST[
"comment"] );
2153 if ($this->
object->getSelfAssessmentEditingMode())
2155 $this->
object->setNrOfTries(
$_POST[
'nr_of_tries'] );
2158 $this->
object->setEstimatedWorkingTime(
2159 $_POST[
"Estimated"][
"hh"],
2160 $_POST[
"Estimated"][
"mm"],
2161 $_POST[
"Estimated"][
"ss"]
2165 abstract public function getPreview($show_question_only = FALSE, $showInlineFeedback =
false);
2181 $is_question_postponed = FALSE,
2182 $user_post_solutions = FALSE,
2183 $show_specific_inline_feedback = FALSE
2191 $is_question_postponed,
2192 $user_post_solutions,
2193 $show_specific_inline_feedback
2198 $this->tpl->setVariable(
"QUESTION_OUTPUT", $test_output);
2199 $this->tpl->setVariable(
"FORMACTION", $formaction);
2201 $this->tpl->setVariable(
"FORM_TIMESTAMP",
time());
2219 $is_question_postponed,
2220 $user_post_solutions,
2221 $show_specific_inline_feedback
2226 return self::FORM_ENCODING_URLENCODE;
2234 if((
$_GET[
"calling_test"] > 0) || (
$_GET[
"test_ref_id"] > 0))
2239 if(!
$_GET[
'test_express_mode'] && !
$GLOBALS[
'___test_express_mode'])
2241 $ilTabs->
setBackTarget($this->lng->txt(
"backtocallingtest"),
"ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=$ref_id");
2246 $ilTabs->
setBackTarget($this->lng->txt(
"backtocallingtest"), $link);
2249 else if(isset(
$_GET[
'calling_consumer']) && (int)
$_GET[
'calling_consumer'])
2251 $ref_id = (int)$_GET[
'calling_consumer'];
2255 $ilTabs->
setBackTarget($consumer->getQuestionEditingFormBackTargetLabel(), $consumer->getQuestionEditingFormBackTarget($_GET[
'consumer_context']));
2259 require_once
'Services/Link/classes/class.ilLink.php';
2265 $ilTabs->
setBackTarget($this->lng->txt(
"qpl"), $this->ctrl->getLinkTargetByClass(
"ilobjquestionpoolgui",
"questions"));
2295 require_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
2298 $form->setFormAction($this->ctrl->getFormAction($this));
2300 $form->setId($this->
getType());
2303 $form->setTableWidth(
'100%');
2305 $form->setMultipart(
true);
2321 $errors = $this->editQuestion(
true);
isTestPresentationContext()
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static makeDirParents($a_dir)
Create a new directory and all parent directories.
setQuestionActionCmd($questionActionCmd)
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
hasCorrectSolution($activeId, $passIndex)
getAssignmentsOfItem($a_item_id)
Get assignments for item.
addTab_QuestionPreview(ilTabsGUI $tabsGUI)
This class represents an option in a radio group.
getSolutionOutput( $active_id, $pass=NULL, $graphicalOutput=FALSE, $result_output=FALSE, $show_question_only=TRUE, $show_feedback=FALSE, $show_correct_solution=FALSE, $show_manual_scoring=FALSE, $show_question_text=TRUE)
getTestOutput( $active_id, $pass, $is_question_postponed, $user_post_solutions, $show_specific_inline_feedback)
Taxonomy node <-> item assignment.
static _includeClass($question_type, $gui=0)
Include the php class file for a given question type.
static getQuestionTypeFromDb($question_id)
get question type for question id
addBasicQuestionFormProperties($form)
Add basic question form properties: assessment: title, author, description, question, working time.
getPreviousSolutionConfirmationCheckboxHtml()
addTab_QuestionHints(ilTabsGUI $tabs)
adds the hints tab to ilTabsGUI
getPreview($show_question_only=FALSE, $showInlineFeedback=false)
suggestedsolution()
Allows to add suggested solutions for questions.
static _getGUIClassNameForId($a_q_id)
writePostData($always=false)
Evaluates a posted edit form and writes the form data in the question object.
$question_count
question count in test
addErrorMessage($errormessage)
const ADDITIONAL_CONTENT_EDITING_MODE_PAGE_OBJECT
constant for additional content editing mode "pageobject"
__construct()
assQuestionGUI constructor
getEditQuestionTabCommands()
const SESSION_PREVIEW_DATA_BASE_INDEX
buildBasicEditFormObject()
setPresentationContext($presentationContext)
getBasicEditQuestionTabCommands()
static _getUsedHTMLTags($a_module="")
Returns an array of all allowed HTML tags for text editing.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
static _getQuestionTypeName($type_tag)
Return the translation for a given question type tag.
setValue($a_value)
Set Value.
setQuestionHeaderBlockBuilder($questionHeaderBlockBuilder)
getGenericFeedbackOutputForCorrectSolution()
setTaxonomyIds($taxonomyIds)
setRenderPurpose($renderPurpose)
callNewIdListeners($a_new_id)
Call the new id listeners.
getUseUnchangedAnswerCheckboxHtml()
getQuestionTemplate()
get question template
addTarget($a_text, $a_link, $a_cmd="", $a_cmdClass="", $a_frame="", $a_activate=false, $a_dir_text=false)
Class ilQuestionUsagesTableGUI.
isRenderPurposePlayback()
setEditContext($editContext)
setBackTarget($a_title, $a_target, $a_frame="")
back target for upper context
populateTaxonomyFormSection(ilPropertyFormGUI $form)
const CMD_SHOW_LIST
command constants
const CMD_SHOW
command constants
static stripOnlySlashes($a_str)
strip slashes if magic qoutes is enabled
$sequence_no
sequence number in test
static _getInternalLinkHref($target="")
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
populateJavascriptFilesRequiredForWorkForm(ilTemplate $tpl)
getType()
needed for page editor compliance
static getCommandsFromClassConstants($guiClassName, $cmdConstantNameBegin='CMD_')
extracts values of all constants of given class with given prefix as array can be used to get all pos...
if(!is_dir( $entity_dir)) exit("Fatal Error ([A-Za-z0-9]+)\+" &#(? foreach( $entity_files as $file) $output
& createQuestionGUI($question_type, $question_id=-1)
Creates a question gui representation.
writeQuestionGenericPostData()
const PRESENTATION_CONTEXT_RESULTS
static getReturnToPageLink($q_id=null)
if(!is_array($argv)) $options
addJavaScript($a_js_file, $a_add_version_parameter=true, $a_batch=2)
Add a javascript file that should be included in the header.
isRenderPurposeDemoplay()
setAdjustmentEditContext()
getILIASPage($html="")
Returns the ILIAS Page around a question.
static _getQuestionGUI($question_type, $question_id=-1)
Creates a question gui representation and returns the alias to the question gui note: please do not u...
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
static getManualFeedback($active_id, $question_id, $pass)
Retrieves the manual feedback for a question in a test.
const FORM_ENCODING_MULTIPART
special template class to simplify handling of ITX/PEAR
This class represents a text property in a property form.
originalSyncForm($return_to="", $return_to_feedback='')
addNewIdListener(&$a_object, $a_method, $a_parameters="")
Add a listener that is notified with the new question ID, when a new question is saved.
isAdjustmentEditContext()
const EDIT_CONTEXT_ADJUSTMENT
addTab_QuestionFeedback(ilTabsGUI $tabs)
adds the feedback tab to ilTabsGUI
isRenderPurposeInputValue()
const RENDER_PURPOSE_DEMOPLAY
setTargetGui($linkTargetGui)
getContextPath($cont_obj, $a_endnode_id, $a_startnode_id=1)
get context path in content object tree
getQuestionType()
Returns the question type string.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
setTargetGuiClass($targetGuiClass)
Basic GUI class for assessment questions.
setErrorMessage($errormessage)
const EDIT_CONTEXT_AUTHORING
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
const PRESENTATION_CONTEXT_TEST
static _getClassNameForQType($q_type)
outQuestionForTest( $formaction, $active_id, $pass, $is_question_postponed=FALSE, $user_post_solutions=FALSE, $show_specific_inline_feedback=FALSE)
completeTestOutputFormAction($formAction, $active_id, $pass)
getPreviousSolutionProvidedMessage()
executeCommand()
execute command
static _questionExistsInTest($question_id, $test_id)
getAnswerFeedbackOutput($active_id, $pass)
Returns the answer generic feedback depending on the results of the question.
const FORM_ENCODING_URLENCODE
const RENDER_PURPOSE_PLAYBACK
Class ilQuestionInternalLinkSelectionTableGUI.
getGenericFeedbackOutputForIncorrectSolution()
saveTaxonomyAssignments()
Class ilQuestionUsagesTableGUI.
Create new PHPExcel object
obj_idprivate
static renameExecutables($a_dir)
Rename uploaded executables for security reasons.
getAdditionalEditQuestionCommands()
This class represents a text area property in a property form.
addBackTab(ilTabsGUI $ilTabs)
setPreviewSession($previewSession)
getQuestionHeaderBlockBuilder()
Class ilObjContentObjectGUI.
const RENDER_PURPOSE_PRINT_PDF
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
isRenderPurposePrintPdf()
$questionHeaderBlockBuilder
static getGuiClassNameByQuestionType($questionType)
outQuestionPage($a_temp_var, $a_postponed=false, $active_id="", $html="")
output question page
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
getGenericFeedbackOutput($active_id, $pass)
Returns the answer specific feedback for the question.
static getPageList($lm_id)
static
getAsValueAttribute($a_value)
Returns a HTML value attribute.
setValue($a_value)
Set Value.
static redirect($a_script)
http redirect to other script
const RENDER_PURPOSE_INPUT_VALUE
const RENDER_PURPOSE_PREVIEW
static getFeedbackClassNameByQuestionType($questionType)
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
saveReturn()
save question
getSpecificFeedbackOutput($active_id, $pass)
Returns the answer specific feedback for the question.
setExpand($a_node_id)
set the expand option this value is stored in a SESSION variable to save it different view (lo view...
addTab_SuggestedSolution(ilTabsGUI $tabs, $classname)
setOutputMode($a_mode=IL_PAGE_PRESENTATION)
Set Output Mode.
const TAB_ID_QUESTION_PREVIEW
setQuestionHTML($question_html)
addQuestionFormCommandButtons($form)
Add the command buttons of a question properties form.
setQuestionCount($a_question_count)
renderPurposeSupportsFormHtml()
static _isWriteable($question_id, $user_id)
Returns true if the question is writeable by a certain user.
setNavigationGUI($navigationGUI)