130 protected \ILIAS\TestQuestionPool\InternalRequestService
$request;
137 $this->
lng = $DIC[
'lng'];
138 $this->tpl = $DIC[
'tpl'];
139 $this->
ctrl = $DIC[
'ilCtrl'];
140 $this->
ui = $DIC->ui();
141 $this->ilObjDataCache = $DIC[
'ilObjDataCache'];
142 $this->
access = $DIC->access();
143 $this->
ilHelp = $DIC[
'ilHelp'];
144 $this->ilUser = $DIC[
'ilUser'];
145 $this->ilTabs = $DIC[
'ilTabs'];
146 $this->rbacsystem = $DIC[
'rbacsystem'];
147 $this->request = $DIC->testQuestionPool()->internal()->request();
148 $this->tree = $DIC[
'tree'];
149 $this->db = $DIC->database();
150 $this->
logger = $DIC[
'ilLog'];
151 $this->questioninfo = $DIC->testQuestionPool()->questionInfo();
152 $this->component_repository = $DIC[
'component.repository'];
154 $this->
ctrl->saveParameter($this,
"q_id");
155 $this->
ctrl->saveParameter($this,
"prev_qid");
156 $this->
ctrl->saveParameter($this,
"calling_test");
157 $this->
ctrl->saveParameter($this,
"consumer_context");
158 $this->
ctrl->saveParameterByClass(
'ilAssQuestionPageGUI',
'test_express_mode');
159 $this->
ctrl->saveParameterByClass(
'ilAssQuestionPageGUI',
'consumer_context');
160 $this->
ctrl->saveParameterByClass(
'ilobjquestionpoolgui',
'test_express_mode');
161 $this->
ctrl->saveParameterByClass(
'ilobjquestionpoolgui',
'consumer_context');
163 $this->errormessage = $this->
lng->txt(
"fill_out_all_required_fields");
164 $this->notes_gui = $DIC->notes()->gui();
178 echo $this->
getHeaderAction() . $this->
ui->mainTemplate()->getOnLoadCodeForAsynch();
184 $parentObjType = $this->ilObjDataCache->lookupType($this->
object->getObjId());
190 $this->request->getRefId(),
191 $this->
object->getObjId()
196 $ha = $dispatcher->initHeaderAction();
197 $ha->enableComments(
true,
false);
199 return $ha->getHeaderAction($this->
ui->mainTemplate());
204 $comment_gui =
new ilCommentGUI($this->
object->getObjId(), $this->
object->getId(),
'quest');
210 $this->
ilHelp->setScreenIdComponent(
'qpl');
212 $next_class = $this->
ctrl->getNextClass($this);
214 switch ($next_class) {
215 case 'ilformpropertydispatchgui':
218 $form_prop_dispatch->setItem($form->getItemByPostVar(
ilUtil::stripSlashes($this->request->raw(
'postvar'))));
219 $this->
ctrl->forwardCommand($form_prop_dispatch);
222 $cmd = $this->
ctrl->getCmd(
'editQuestion');
224 case self::SUGGESTED_SOLUTION_COMMANDS_CANCEL:
225 case self::SUGGESTED_SOLUTION_COMMANDS_SAVE:
226 case self::SUGGESTED_SOLUTION_COMMANDS_DEFAULT:
229 case 'saveSuggestedSolutionType':
230 case 'saveContentsSuggestedSolution':
231 case 'deleteSuggestedSolution':
233 case 'cancelExplorer':
234 case 'outSolutionExplorer':
247 if (method_exists($this, $cmd)) {
252 $this->callSpecialQuestionCommands($cmd);
260 return static::HAS_SPECIAL_QUESTION_COMMANDS;
420 if (is_object($this->
object)) {
444 $this->tpl->setContent(implode(
'<br />', array(
445 $stats_table->getHTML(),
446 $usage_table->getHTML()
456 $ilCtrl = $DIC[
'ilCtrl'];
457 $ilDB = $DIC[
'ilDB'];
460 if (($question_type ===
'') && ($question_id > 0)) {
461 $question_type = $DIC->testQuestionPool()->questionInfo()->getQuestionType($question_id);
464 if ($question_type ===
'') {
468 $question_type_gui = $question_type .
'GUI';
469 $question =
new $question_type_gui();
472 $question->object->feedbackOBJ =
new $feedbackObjectClassname($question->object, $ilCtrl,
$ilDB, $lng);
474 if ($question_id > 0) {
475 $question->object->loadFromDb($question_id);
487 $q_type = $DIC->testQuestionPool()->questionInfo()->getQuestionType($a_q_id);
497 return $q_type .
"GUI";
515 if (!$this->tpl->blockExists(
'content')) {
516 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.il_as_qpl_content.html",
"Modules/TestQuestionPool");
519 if (!$this->tpl->blockExists(
'statusline')) {
520 $this->tpl->addBlockFile(
"STATUSLINE",
"statusline",
"tpl.statusline.html");
523 if (!$this->tpl->blockExists(
'adm_content')) {
524 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_question.html",
"Modules/TestQuestionPool");
531 $this->tpl->setVariable(
"QUESTION_DATA", $form->
getHTML());
541 [$this->
object->getId() => $html]
543 $presentation = $page_gui->presentation();
544 $presentation = preg_replace(
"/src=\"\\.\\//ims",
"src=\"" . ILIAS_HTTP_PATH .
"/", $presentation);
545 return $presentation;
548 public function outQuestionPage($a_temp_var, $a_postponed =
false, $active_id =
"", $html =
"", $inlineFeedbackEnabled =
false): string
550 if ($this->
object->getTestPresentationConfig()->isSolutionInitiallyPrefilled()) {
554 } elseif ($this->
object->getTestPresentationConfig()->isUnchangedAnswerPossible()) {
558 $this->
lng->loadLanguageModule(
"content");
562 $page_gui->setTemplateTargetVar($a_temp_var);
566 $page_gui->setQuestionActionsHTML($this->
getNavigationGUI()->getActionsHTML());
570 $page_gui->setQuestionHTML(array($this->
object->getId() => $html));
573 $page_gui->setPresentationTitle($this->questionHeaderBlockBuilder->getPresentationTitle());
574 $page_gui->setQuestionInfoHTML($this->questionHeaderBlockBuilder->getQuestionInfoHTML());
576 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());
588 return $this->
lng->txt(
'use_previous_solution_advice');
593 $tpl =
new ilTemplate(
'tpl.tst_question_additional_behaviour_checkbox.html',
true,
true,
'Modules/TestQuestionPool');
594 $tpl->
setVariable(
'TXT_FORCE_FORM_DIFF_LABEL', $this->
lng->txt(
'use_previous_solution'));
600 if ($this->request->raw(
"calling_test")) {
601 $_GET[
"ref_id"] = $this->request->raw(
"calling_test");
602 ilUtil::redirect(
"ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=" . $this->request->raw(
"calling_test"));
603 } elseif ($this->request->raw(
"test_ref_id")) {
604 $_GET[
"ref_id"] = $this->request->raw(
"test_ref_id");
605 ilUtil::redirect(
"ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=" . $this->request->raw(
"test_ref_id"));
607 if ($this->request->raw(
"q_id") > 0) {
608 $this->
ctrl->setParameterByClass(
"ilAssQuestionPageGUI",
"q_id", $this->request->getQuestionId());
609 $this->
ctrl->redirectByClass(
"ilAssQuestionPageGUI",
"edit");
611 $this->
ctrl->redirectByClass(
"ilobjquestionpoolgui",
"questions");
616 public function originalSyncForm(
string $return_to =
"",
string $return_to_feedback =
''): void
618 if (strlen($return_to)) {
619 $this->
ctrl->setParameter($this,
"return_to", $return_to);
620 } elseif ($this->request->raw(
'return_to')) {
621 $this->
ctrl->setParameter($this,
"return_to", $this->request->raw(
'return_to'));
623 if (strlen($return_to_feedback)) {
624 $this->
ctrl->setParameter($this,
'return_to_fb',
'true');
627 $this->
ctrl->saveParameter($this,
'test_express_mode');
629 $template =
new ilTemplate(
"tpl.il_as_qpl_sync_original.html",
true,
true,
"Modules/TestQuestionPool");
630 $template->setVariable(
"BUTTON_YES", $this->
lng->txt(
"yes"));
631 $template->setVariable(
"BUTTON_NO", $this->
lng->txt(
"no"));
632 $template->setVariable(
"FORM_ACTION", $this->
ctrl->getFormAction($this));
633 $template->setVariable(
"TEXT_SYNC", $this->
lng->txt(
"confirm_sync_questions"));
634 $this->tpl->setVariable(
"ADM_CONTENT", $template->get());
639 $original_id = $this->
object->getOriginalId();
640 if ($original_id !== null) {
641 $this->
object->syncWithOriginal();
642 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
644 if ($this->request->raw(
"return_to") !== null) {
645 $this->
ctrl->redirect($this, $this->request->raw(
"return_to"));
647 if ($this->request->raw(
"return_to_fb") !== null) {
648 $this->
ctrl->redirectByClass(ilAssQuestionFeedbackEditingGUI::class,
'showFeedbackForm');
651 if ($this->request->raw(
'test_express_mode')) {
660 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
662 if ($this->request->raw(
"return_to") !==
'' && $this->request->raw(
"return_to") !== null) {
663 $this->
ctrl->redirect($this, $this->request->raw(
"return_to"));
665 if ($this->request->raw(
'return_to_fb') !==
'' && $this->request->raw(
'return_to_fb') !== null) {
666 $this->
ctrl->redirectByClass(ilAssQuestionFeedbackEditingGUI::class,
'showFeedbackForm');
668 if ($this->request->raw(
'test_express_mode')) {
679 $ilUser->
setPref(
"tst_lastquestiontype", $this->
object->getQuestionType());
680 $ilUser->
writePref(
"tst_lastquestiontype", $this->
object->getQuestionType());
681 $this->
object->saveToDb();
682 $originalexists = $this->questioninfo->questionExists($this->
object->getOriginalId());
685 $this->
ctrl->redirect($this,
"originalSyncForm");
686 } elseif ($this->request->raw(
"calling_test")) {
687 $_GET[
"ref_id"] = $this->request->raw(
"calling_test");
688 ilUtil::redirect(
"ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=" . $this->request->raw(
"calling_test"));
690 } elseif ($this->request->raw(
"test_ref_id")) {
692 $_GET[
"ref_id"] = $this->request->raw(
"test_ref_id");
693 $test =
new ilObjTest($this->request->raw(
"test_ref_id"),
true);
700 $this->component_repository,
705 $test->insertQuestion($testQuestionSetConfigFactory->
getQuestionSetConfig(), $this->
object->getId());
707 ilUtil::redirect(
"ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=" . $this->request->raw(
"test_ref_id"));
709 $this->
ctrl->setParameter($this,
"q_id", $this->
object->getId());
710 $this->editQuestion();
711 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
false);
712 $this->
ctrl->setParameterByClass(ilAssQuestionPageGUI::class,
"q_id", $this->
object->getId());
713 $this->
ctrl->redirectByClass(ilAssQuestionPageGUI::class,
"edit");
720 $this->ilTabs->setTabActive(
'edit_question');
727 $old_id = $this->request->int(
'q_id');
729 $this->ilUser->setPref(
"tst_lastquestiontype", $this->
object->getQuestionType());
730 $this->ilUser->writePref(
"tst_lastquestiontype", $this->
object->getQuestionType());
731 $this->
object->saveToDb();
733 if ($this->
object->getId() !== $old_id) {
737 if ($this->request->int(
'calling_test') !== 0) {
738 if (($q_id = $this->
saveQuestionToTest()) === self::RETURN_AFTER_EXISTING_WITH_ORIGINAL_SAVE) {
739 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
740 $this->
ctrl->setParameter($this,
'return_to',
'editQuestion');
741 $this->
ctrl->redirect($this,
"originalSyncForm");
744 $this->
ctrl->setParameter(
747 $q_id === self::RETURN_AFTER_EXISTING_SAVE ? $this->
object->getId() : $q_id
749 $this->
ctrl->setParameter($this,
'ref_id', $this->request->raw(
'calling_test'));
750 $this->
ctrl->setParameter($this,
'calling_test', $this->request->raw(
'calling_test'));
753 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
754 $this->
ctrl->redirect($this,
'editQuestion');
759 $this->ilTabs->setTabActive(
'edit_question');
765 $old_id = $this->request->getQuestionId();
767 $this->ilUser->setPref(
"tst_lastquestiontype", $this->
object->getQuestionType());
768 $this->ilUser->writePref(
"tst_lastquestiontype", $this->
object->getQuestionType());
769 $this->
object->saveToDb();
771 if ($this->
object->getId() !== $old_id) {
775 if ($this->request->int(
'calling_test') !== 0
777 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
778 $this->
ctrl->setParameter($this,
'test_express_mode', $this->request->raw(
'test_express_mode'));
779 $this->
ctrl->redirect($this,
"originalSyncForm");
782 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
788 $originalexists = !is_null($this->
object->getOriginalId())
789 && $this->questioninfo->questionExistsInPool($this->object->getOriginalId());
793 return self::RETURN_AFTER_EXISTING_WITH_ORIGINAL_SAVE;
796 $test =
new ilObjTest($this->request->raw(
"calling_test"),
true);
798 return self::RETURN_AFTER_EXISTING_SAVE;
806 $this->component_repository,
811 $new_q_id = $this->
object->getId();
812 if ($test->getRefId() !== $this->request->int(
'ref_id')) {
813 $new_q_id = $this->
object->duplicate(
true, $this->
object->getTitle(), $this->
object->getAuthor(), $this->
object->getOwner(), $test->getId());
816 $test->insertQuestion(
817 $testQuestionSetConfigFactory->getQuestionSetConfig(),
822 if ($this->request->isset(
'prev_qid')) {
823 $test->moveQuestionAfter($new_q_id, $this->request->raw(
'prev_qid'));
826 $this->
ctrl->setParameter($this,
'calling_test', $this->request->raw(
"calling_test"));
833 $this->
object->saveToDb();
834 $this->
ctrl->setParameter($this,
"q_id", $this->
object->getId());
835 $this->editQuestion();
841 public function getContextPath($cont_obj,
int $a_endnode_id,
int $a_startnode_id = 1): string
845 $tmpPath = $cont_obj->getLMTree()->getPathFull($a_endnode_id, $a_startnode_id);
848 for ($i = 1; $i < (count($tmpPath) - 1); $i++) {
853 $path .= $tmpPath[$i][
"title"];
861 $this->sequence_no = $nr;
871 $this->question_count = $a_question_count;
891 $this->errormessage .= ((strlen($this->errormessage)) ?
"<br />" :
"") .
$errormessage;
901 return $this->
object->getQuestionType();
907 if (strlen($a_value)) {
908 $result =
" value=\"$a_value\" ";
918 public function addNewIdListener($a_object,
string $a_method,
string $a_parameters =
""): void
921 $this->new_id_listeners[$cnt][
"object"] = &$a_object;
922 $this->new_id_listeners[$cnt][
"method"] = $a_method;
923 $this->new_id_listeners[$cnt][
"parameters"] = $a_parameters;
924 $this->new_id_listener_cnt++;
930 $this->new_id_listeners[$i][
"parameters"][
"new_id"] = $a_new_id;
931 $object = &$this->new_id_listeners[$i][
"object"];
932 $method = $this->new_id_listeners[$i][
"method"];
933 $parameters = $this->new_id_listeners[$i][
"parameters"];
934 $object->$method($parameters);
940 if (!$this->
object->getSelfAssessmentEditingMode()) {
950 $title->setMaxLength(100);
951 $title->setValue($this->
object->getTitle());
952 $title->setRequired(
true);
955 if (!$this->
object->getSelfAssessmentEditingMode()) {
958 $author->setValue($this->
object->getAuthor());
959 $author->setMaxLength(512);
960 $author->setRequired(
true);
965 $description->setValue($this->
object->getComment());
966 $description->setRequired(
false);
967 $description->setMaxLength(1000);
973 if (trim($author) ==
"") {
976 $hi->setValue($author);
989 $question->setRequired(
true);
990 $question->setRows(10);
991 $question->setCols(80);
993 if (!$this->
object->getSelfAssessmentEditingMode()) {
995 $question->setUseRte(
true);
997 $question->addPlugin(
"latex");
998 $question->addButton(
"latex");
999 $question->addButton(
"pastelatex");
1000 $question->setRTESupport($this->
object->getId(),
"qpl",
"assessment");
1004 $question->setUseTagsForRteOnly(
false);
1012 if (!$this->
object->getSelfAssessmentEditingMode()) {
1016 $nr_tries = $this->
object->getNrOfTries() ?? $this->
object->getDefaultNrOfTries();
1018 if ($nr_tries < 1) {
1023 $ni->setValue($nr_tries);
1024 $ni->setMinValue(0);
1026 $ni->setMaxLength(5);
1034 $postvar =
"tax_node_assign_$taxonomyId";
1038 $tax_node_assign->saveInput(
"qpl", $this->
object->getObjId(),
"quest", $this->
object->getId());
1047 ilOverlayGUI::initJavaScript();
1050 $sectHeader->setTitle($this->
lng->txt(
'qpl_qst_edit_form_taxonomy_section'));
1055 $label = sprintf($this->
lng->txt(
'qpl_qst_edit_form_taxonomy'), $taxonomy->getTitle());
1056 $postvar =
"tax_node_assign_$taxonomyId";
1065 $taxSelect->setValue(array_map(
function ($assignedNode) {
1066 return $assignedNode[
'node_id'];
1067 }, $assignedNodes));
1080 if ($manual_feedback !==
'') {
1081 return $manual_feedback;
1084 $correct_feedback = $this->
object->feedbackOBJ->getGenericFeedbackTestPresentation($this->
object->getId(),
true);
1085 $incorrect_feedback = $this->
object->feedbackOBJ->getGenericFeedbackTestPresentation($this->
object->getId(),
false);
1086 if ($correct_feedback . $incorrect_feedback !==
'') {
1090 if ($this->
object->isAdditionalContentEditingModePageObject()) {
1097 string $feedback_correct,
1098 string $feedback_incorrect,
1102 if ($pass === null) {
1105 $reached_points = $this->
object->calculateReachedPoints($active_id, $pass);
1106 $max_points = $this->
object->getMaximumPoints();
1107 if ($reached_points == $max_points) {
1108 return $feedback_correct;
1111 return $feedback_incorrect;
1117 $this->
object->feedbackOBJ->getGenericFeedbackTestPresentation($this->object->getId(),
true),
1125 $this->
object->feedbackOBJ->getGenericFeedbackTestPresentation($this->object->getId(),
false),
1138 $count = $this->questioninfo->usageNumber($this->
object->getId());
1140 if ($this->questioninfo->questionExistsInPool($this->object->getId()) && $count) {
1141 if ($this->rbacsystem->checkAccess(
"write", $this->request->getRefId())) {
1142 $this->tpl->setOnScreenMessage(
'info', sprintf($this->
lng->txt(
"qpl_question_is_in_use"), $count));
1146 return $this->questioninfo->getQuestionTypeName($this->
object->getId());
1151 foreach (assQuestionSuggestedSolution::TYPES as $k => $v) {
1152 $options[$k] = $this->
lng->txt($v);
1162 $cmd = $this->request->raw(
'cmd');
1163 $save = is_array($cmd) && array_key_exists(
'saveSuggestedSolution', $cmd);
1164 if ($save && $this->request->int(
'deleteSuggestedSolution') === 1) {
1165 $this->
object->deleteSuggestedSolutions();
1166 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
1167 $this->
ctrl->redirect($this,
"suggestedsolution");
1172 $solution = $this->
object->getSuggestedSolution();
1175 $solution_type = $this->
ctrl->getCmd() ===
'cancelSuggestedSolution' 1176 ? $solution->getType()
1177 : $this->request->string(
'solutiontype');
1178 if (is_string($solution_type) && strcmp($solution_type,
"file") == 0
1179 && (!$solution || $solution->getType() !== assQuestionSuggestedSolution::TYPE_FILE)
1183 assQuestionSuggestedSolution::TYPE_FILE
1187 $solution_filename = $this->request->raw(
'filename');
1189 is_string($solution_filename) &&
1190 strlen($solution_filename)) {
1191 $solution = $solution->withTitle($solution_filename);
1196 $form->setFormAction($this->
ctrl->getFormAction($this));
1197 $form->setTitle($this->
lng->txt(
"solution_hint"));
1198 $form->setMultipart(
true);
1199 $form->setTableWidth(
"100%");
1200 $form->setId(
"suggestedsolutiondisplay");
1203 $template =
new ilTemplate(
"tpl.il_as_qpl_suggested_solution_input_presentation.html",
true,
true,
"Modules/TestQuestionPool");
1205 if ($solution->isOfTypeLink()) {
1207 $template->setCurrentBlock(
"preview");
1208 $template->setVariable(
"TEXT_SOLUTION", $this->
lng->txt(
"suggested_solution"));
1209 $template->setVariable(
"VALUE_SOLUTION",
" <a href=\"$href\" target=\"content\">" . $this->
lng->txt(
"view") .
"</a> ");
1210 $template->parseCurrentBlock();
1212 $solution->isOfTypeFile()
1213 && $solution->getFilename()
1215 $href = $this->
object->getSuggestedSolutionPathWeb() . $solution->getFilename();
1216 $link =
" <a href=\"$href\" target=\"content\">" 1219 $template->setCurrentBlock(
"preview");
1220 $template->setVariable(
"TEXT_SOLUTION", $this->
lng->txt(
"suggested_solution"));
1221 $template->setVariable(
"VALUE_SOLUTION", $link);
1222 $template->parseCurrentBlock();
1225 $template->setVariable(
"TEXT_TYPE", $this->
lng->txt(
"type"));
1226 $template->setVariable(
"VALUE_TYPE", $options[$solution->getType()]);
1228 $title->
setHtml($template->get());
1230 $deletesolution->setOptionTitle($this->
lng->txt(
"deleteSuggestedSolution"));
1231 $title->addSubItem($deletesolution);
1232 $form->addItem($title);
1234 if ($solution->isOfTypeFile()) {
1237 $file->enableFileNameSelection(
"filename");
1240 if ($save && $_FILES && $_FILES[
"file"][
"tmp_name"] && $file->checkInput()) {
1241 if (!file_exists($this->
object->getSuggestedSolutionPath())) {
1246 $_FILES[
"file"][
"tmp_name"],
1247 $_FILES[
"file"][
"name"],
1248 $this->
object->getSuggestedSolutionPath() . $_FILES[
"file"][
"name"]
1254 if ($solution->getFilename()) {
1255 @unlink($this->
object->getSuggestedSolutionPath() . $solution->getFilename());
1258 $file->setValue($_FILES[
"file"][
"name"]);
1259 $solution = $solution
1260 ->withFilename($_FILES[
"file"][
"name"])
1261 ->withMime($_FILES[
"file"][
"type"])
1262 ->withSize($_FILES[
"file"][
"size"])
1263 ->withTitle($_POST[
"filename"]);
1267 $originalexists = $this->
object->getOriginalId() &&
1268 $this->questioninfo->questionExistsInPool($this->
object->getOriginalId());
1269 if ($this->request->raw(
"calling_test") && $originalexists
1274 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"suggested_solution_added_successfully"),
true);
1275 $this->
ctrl->redirect($this,
"suggestedsolution");
1279 $this->tpl->setOnScreenMessage(
'info', $res);
1282 if ($solution->getFilename()) {
1283 $file->setValue($solution->getFilename());
1284 $file->setFilename($solution->getTitle());
1287 $form->addItem($file);
1289 $hidden->setValue(
"file");
1290 $form->addItem($hidden);
1292 if ($ilAccess->checkAccess(
"write",
"", $this->request->getRefId())) {
1293 $form->addCommandButton(
'cancelSuggestedSolution', $this->
lng->txt(
'cancel'));
1294 $form->addCommandButton(
'saveSuggestedSolution', $this->
lng->txt(
'save'));
1298 if ($form->checkInput()) {
1299 if ($solution->isOfTypeFile()) {
1300 $solution = $solution->withTitle($_POST[
"filename"]);
1303 if (!$solution->isOfTypeLink()) {
1307 $originalexists = !is_null($this->
object->getOriginalId()) &&
1308 $this->questioninfo->questionExistsInPool($this->object->getOriginalId());
1309 if ($this->request->raw(
"calling_test") && $originalexists
1314 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
1315 $this->
ctrl->redirect($this,
"suggestedsolution");
1320 $output = $form->getHTML();
1323 $savechange = $this->
ctrl->getCmd() ===
"saveSuggestedSolutionType";
1326 if ($ilAccess->checkAccess(
"write",
"", $this->request->getRefId())) {
1328 $formchange->setFormAction($this->
ctrl->getFormAction($this));
1330 $title = $solution ? $this->
lng->txt(
"changeSuggestedSolution") : $this->
lng->txt(
"addSuggestedSolution");
1331 $formchange->setTitle($title);
1332 $formchange->setMultipart(
false);
1333 $formchange->setTableWidth(
"100%");
1334 $formchange->setId(
"suggestedsolution");
1337 foreach ($options as $opt_value => $opt_caption) {
1341 $solutiontype->setValue($solution->getType());
1343 $solutiontype->setRequired(
true);
1344 $formchange->addItem($solutiontype);
1346 $formchange->addCommandButton(
"saveSuggestedSolutionType", $this->
lng->txt(
"select"));
1349 $formchange->checkInput();
1351 $changeoutput = $formchange->getHTML();
1354 $this->tpl->setVariable(
"ADM_CONTENT", $changeoutput . $output);
1359 $type = $this->request->raw(
"link_new_type");
1360 $search = $this->request->raw(
"search_link_type");
1361 $this->
ctrl->setParameter($this,
"link_new_type", $type);
1362 $this->
ctrl->setParameter($this,
"search_link_type", $search);
1363 $this->
ctrl->saveParameter($this, array(
"subquestion_index",
"link_new_type",
"search_link_type"));
1365 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"select_object_to_link"));
1367 $parent_ref_id = $this->tree->getParentId($this->request->getRefId());
1369 $exp->
setExpand($this->request->raw(
'expand_sol') ? $this->request->raw(
'expand_sol') : $parent_ref_id);
1370 $exp->setExpandTarget($this->
ctrl->getLinkTarget($this,
'outSolutionExplorer'));
1371 $exp->setTargetGet(
"ref_id");
1372 $exp->setRefId($this->request->getRefId());
1373 $exp->addFilter($type);
1374 $exp->setSelectableType($type);
1375 if ($this->request->isset(
'expandCurrentPath') && $this->request->raw(
'expandCurrentPath')) {
1376 $exp->expandPathByRefId($parent_ref_id);
1382 $template =
new ilTemplate(
"tpl.il_as_qpl_explorer.html",
true,
true,
"Modules/TestQuestionPool");
1383 $template->setVariable(
"EXPLORER_TREE", $exp->getOutput());
1384 $template->setVariable(
"BUTTON_CANCEL", $this->
lng->txt(
"cancel"));
1385 $template->setVariable(
"FORMACTION", $this->
ctrl->getFormAction($this,
"suggestedsolution"));
1386 $this->tpl->setVariable(
"ADM_CONTENT", $template->get());
1391 switch ($_POST[
"solutiontype"]) {
1414 if (isset($_POST[
'solutiontype'])) {
1415 $this->
ctrl->setParameter($this,
'expandCurrentPath', 1);
1417 $this->
ctrl->setParameter($this,
"link_new_type", $type);
1418 $this->
ctrl->setParameter($this,
"search_link_type", $search);
1419 $this->
ctrl->redirect($this,
"outSolutionExplorer");
1424 $this->
ctrl->redirect($this,
"suggestedsolution");
1429 $this->
ctrl->setParameter($this,
'q_id', $this->
object->getId());
1434 $shownpages = array();
1435 $tree = $cont_obj->getLMTree();
1440 foreach ($chapters as $chapter) {
1442 foreach ($chapterpages as $page) {
1443 if ($page[
'type'] == $this->request->raw(
'search_link_type')) {
1444 array_push($shownpages, $page[
'obj_id']);
1446 if ($tree->
isInTree($page[
'obj_id'])) {
1452 $this->
ctrl->setParameter($this, $page[
'type'], $page[
'obj_id']);
1454 'title' => $page[
'title'],
1456 'text_add' => $this->
lng->txt(
'add'),
1457 'href_add' => $this->
ctrl->getLinkTarget($this,
'add' . strtoupper($page[
'type']))
1462 foreach ($pages as $page) {
1463 if (!in_array($page[
'obj_id'], $shownpages)) {
1464 $this->
ctrl->setParameter($this, $page[
'type'], $page[
'obj_id']);
1466 'title' => $page[
'title'],
1467 'description' =>
'---',
1468 'text_add' => $this->
lng->txt(
'add'),
1469 'href_add' => $this->
ctrl->getLinkTarget($this,
'add' . strtoupper($page[
'type']))
1476 $table->setData($rows);
1478 $this->tpl->setContent($table->getHTML());
1483 $this->
ctrl->setParameter($this,
'q_id', $this->
object->getId());
1487 $ctree = $cont_obj->getLMTree();
1488 $nodes = $ctree->getSubtree($ctree->getNodeData($ctree->getRootId()));
1492 foreach ($nodes as $node) {
1493 if ($node[
'type'] == $this->request->raw(
'search_link_type')) {
1494 $this->
ctrl->setParameter($this, $node[
'type'], $node[
'obj_id']);
1496 'title' => $node[
'title'],
1497 'description' =>
'',
1498 'text_add' => $this->
lng->txt(
'add'),
1499 'href_add' => $this->
ctrl->getLinkTarget($this,
'add' . strtoupper($node[
'type']))
1506 $table->setData($rows);
1508 $this->tpl->setContent($table->getHTML());
1513 $this->
ctrl->setParameter($this,
'q_id', $this->
object->getId());
1515 $glossary =
new ilObjGlossary($this->request->raw(
'source_id'),
true);
1520 foreach ($terms as $term) {
1521 $this->
ctrl->setParameter($this,
'git', $term[
'id']);
1523 'title' => $term[
'term'],
1524 'description' =>
'',
1525 'text_add' => $this->
lng->txt(
'add'),
1526 'href_add' => $this->
ctrl->getLinkTarget($this,
'addGIT')
1531 $table->setTitle($this->
lng->txt(
'glossary_term'));
1532 $table->setData($rows);
1534 $this->tpl->setContent($table->getHTML());
1540 $question_id = $this->
object->getId();
1541 $subquestion_index = ($this->request->raw(
"subquestion_index") > 0) ? $this->request->raw(
"subquestion_index") : 0;
1543 $solution = $repo->create($question_id, $type)
1544 ->withSubquestionIndex($subquestion_index)
1545 ->withInternalLink($target);
1547 $repo->update([$solution]);
1552 $this->
ctrl->saveParameter($this, array(
"subquestion_index",
"link_new_type",
"search_link_type"));
1553 switch ($this->request->raw(
"search_link_type")) {
1564 $target =
"il__lm_" . $this->request->raw(
"source_id");
1566 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"suggested_solution_added_successfully"),
true);
1567 $this->
ctrl->redirect($this,
"suggestedsolution");
1574 $target =
"il__pg_" . $this->request->raw(
"pg");
1576 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"suggested_solution_added_successfully"),
true);
1577 $this->
ctrl->redirect($this,
"suggestedsolution");
1582 $target =
"il__st_" . $this->request->raw(
"st");
1584 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"suggested_solution_added_successfully"),
true);
1585 $this->
ctrl->redirect($this,
"suggestedsolution");
1590 $target =
"il__git_" . $this->request->raw(
"git");
1592 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"suggested_solution_added_successfully"),
true);
1593 $this->
ctrl->redirect($this,
"suggestedsolution");
1598 return in_array($this->
ctrl->getCmd(), array(
'save',
'saveEdit',
'saveReturn'));
1602 string $guiClassName,
1603 string $cmdConstantNameBegin =
'CMD_' 1610 $commands = array();
1612 foreach ($reflectionClass->getConstants() as $constName => $constValue) {
1613 if (substr($constName, 0, strlen($cmdConstantNameBegin)) == $cmdConstantNameBegin) {
1614 $commands[] = $constValue;
1624 $this->ilTabs->clearTargets();
1633 $this->
ctrl->setParameterByClass(
"ilAssQuestionPageGUI",
"q_id", $this->request->getQuestionId());
1634 $q_type = $this->
object->getQuestionType();
1636 if (strlen($q_type)) {
1637 $classname = $q_type .
"GUI";
1638 $this->
ctrl->setParameterByClass(strtolower($classname),
"sel_question_types", $q_type);
1639 $this->
ctrl->setParameterByClass(strtolower($classname),
"q_id", $this->request->getQuestionId());
1642 if ($this->request->isset(
"q_id")) {
1664 if ($this->request->getQuestionId()) {
1666 "suggested_solution",
1667 $this->
ctrl->getLinkTargetByClass($classname,
"suggestedsolution"),
1668 array(
"suggestedsolution",
"saveSuggestedSolution",
"outSolutionExplorer",
"cancel",
1669 "addSuggestedSolution",
"cancelExplorer",
"linkChilds",
"removeSuggestedSolution" 1684 return array(
'editQuestion',
'save',
'saveEdit',
'originalSyncForm');
1694 $tabCommands = self::getCommandsFromClassConstants(
'ilAssQuestionFeedbackEditingGUI');
1698 $tabs->
addTarget(
'feedback', $tabLink, $tabCommands, $this->
ctrl->getCmdClass(),
'');
1703 switch ($this->
ctrl->getCmdClass()) {
1704 case 'ilassquestionhintsgui':
1705 $tabCommands = self::getCommandsFromClassConstants(
'ilAssQuestionHintsGUI');
1708 case 'ilassquestionhintgui':
1709 $tabCommands = self::getCommandsFromClassConstants(
'ilAssQuestionHintGUI');
1714 $tabCommands = array();
1719 $tabs->
addTarget(
'tst_question_hints_tab', $tabLink, $tabCommands, $this->
ctrl->getCmdClass(),
'');
1726 $this->
ctrl->getLinkTargetByClass(
1727 array(
'ilrepositorygui',
'ilobjquestionpoolgui', get_class($this)),
1741 $graphicalOutput =
false,
1742 $result_output =
false,
1743 $show_question_only =
true,
1744 $show_feedback =
false,
1745 $show_correct_solution =
false,
1746 $show_manual_scoring =
false,
1747 $show_question_text =
true 1751 mixed $user_solutions,
1754 bool $graphical_output =
false,
1755 bool $result_output =
false,
1756 bool $show_question_only =
true,
1757 bool $show_feedback =
false,
1758 bool $show_correct_solution =
false,
1759 bool $show_manual_scoring =
false,
1760 bool $show_question_text =
true,
1761 bool $show_autosave_title =
false,
1762 bool $show_inline_feedback =
false,
1770 $reachedPoints = $this->
object->getAdjustedReachedPoints((
int) $activeId, (
int) $passIndex,
true);
1771 $maximumPoints = $this->
object->getMaximumPoints();
1773 return $reachedPoints == $maximumPoints;
1783 $this->
object->setTitle($_POST[
"title"]);
1784 $this->
object->setAuthor($_POST[
"author"]);
1785 $this->
object->setComment($_POST[
"comment"] ??
'');
1786 if ($this->
object->getSelfAssessmentEditingMode()) {
1787 $this->
object->setNrOfTries((
int) ($_POST[
'nr_of_tries'] ?? 0));
1800 abstract public function getPreview($show_question_only =
false, $showInlineFeedback =
false);
1806 bool $is_question_postponed =
false,
1807 $user_post_solutions =
false,
1808 bool $show_specific_inline_feedback =
false 1815 $is_question_postponed,
1816 $user_post_solutions,
1817 $show_specific_inline_feedback
1822 $this->tpl->setVariable(
"QUESTION_OUTPUT", $test_output);
1823 $this->tpl->setVariable(
"FORMACTION", $formaction);
1825 $this->tpl->setVariable(
"FORM_TIMESTAMP", (
string) time());
1844 $is_question_postponed,
1845 $user_post_solutions,
1846 $show_specific_inline_feedback
1851 return self::FORM_ENCODING_URLENCODE;
1856 $this->
ctrl->saveParameterByClass(ilAssQuestionPreviewGUI::class,
'prev_qid');
1858 $this->
lng->txt(
'backtocallingpage'),
1879 $form->setFormAction($this->
ctrl->getFormAction($this));
1880 $form->setId($this->
getType());
1882 $form->setTableWidth(
'100%');
1883 $form->setMultipart(
true);
1894 return str_replace([
'{',
'}'], [
'{',
'}'], $text);
1899 $this->editQuestion(
true);
1905 return '<div id="focus"></div>';
1926 $table->setQuestionIndex($questionIndex);
1928 $table->initColumns();
1947 switch ($correctness) {
1948 case self::CORRECTNESS_NOT_OK:
1949 $icon_name =
'standard/icon_not_ok.svg';
1950 $label = $this->
lng->txt(
"answer_is_wrong");
1952 case self::CORRECTNESS_MOSTLY_OK:
1953 $icon_name =
'standard/icon_mostly_ok.svg';
1954 $label = $this->
lng->txt(
"answer_is_not_correct_but_positive");
1956 case self::CORRECTNESS_OK:
1957 $icon_name =
'standard/icon_ok.svg';
1958 $label = $this->
lng->txt(
"answer_is_right");
1964 $icon = $this->
ui->factory()->symbol()->icon()->custom(
1968 return $this->
ui->renderer()->render($icon);
1980 ?
string $txt_output,
1981 bool $prepare_for_latex_output =
false,
1982 bool $omitNl2BrWhenTextArea =
false 1984 if ($txt_output === null || $txt_output ===
'') {
1988 $result = $txt_output;
1991 if (strlen(strip_tags($result)) < strlen($result)) {
1997 if (!$omitNl2BrWhenTextArea) {
1999 $result = preg_replace(
"/[\n]/",
"<br />", $result);
2003 if (preg_match_all(
"/(<pre>.*?<\/pre>)/ims", $result, $matches)) {
2004 foreach ($matches[0] as $found) {
2006 if (strpos(
"\n", $found) ===
false) {
2007 $replacement =
"\n";
2009 $removed = preg_replace(
"/<br\s*?\/>/ims", $replacement, $found);
2010 $result = str_replace($found, $removed, $result);
2017 if ($prepare_for_latex_output) {
2022 if ($prepare_for_latex_output) {
2025 $result = str_replace(
"{",
"{", $result);
2026 $result = str_replace(
"}",
"}", $result);
2027 $result = str_replace(
"\\",
"\", $result);
2036 if (is_null($this->suggestedsolution_repo)) {
2038 $this->suggestedsolution_repo =
$dic[
'question.repo.suggestedsolutions'];
2049 if (!is_array($answer_text)) {
2064 self::ALLOWED_PLAIN_TEXT_TAGS
2074 $this->parent_type_is_lm = $flag;
2079 $this->tpl->addOnloadCode(
" 2080 let form = document.querySelector('#ilContentContainer form'); 2081 let button = form.querySelector('input[name=\"cmd[save]\"]'); 2082 if (form && button) { 2083 form.addEventListener('keydown', function (e) { 2084 if (e.key === 'Enter' 2085 && e.target.type !== 'textarea' 2086 && e.target.type !== 'submit' 2087 && e.target.type !== 'file' 2090 form.requestSubmit(button); 2100 bool $graphical_output =
false,
2101 bool $result_output =
false,
2102 bool $show_question_only =
true,
2103 bool $show_feedback =
false,
2104 bool $show_correct_solution =
false,
2105 bool $show_manual_scoring =
false,
2106 bool $show_question_text =
true,
2107 bool $show_autosave_title =
false,
2108 bool $show_inline_feedback =
false 2110 $autosave_solutions = $this->
object->getSolutionValues($active_id, $pass,
false);
2111 if ($autosave_solutions === []) {
2115 $autosave_solutions,
2120 $show_question_only,
2122 $show_correct_solution,
2123 $show_manual_scoring,
2124 $show_question_text,
2125 $show_autosave_title,
2126 $show_inline_feedback
isTestPresentationContext()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const ADDITIONAL_CONTENT_EDITING_MODE_IPE
setDefaultTabs(ilTabsGUI $ilTabs)
hasCorrectSolution($activeId, $passIndex)
saveCorrectionsFormProperties(ilPropertyFormGUI $form)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getInstance($identifier)
Readable part of repository interface to ilComponentDataDB.
genericFeedbackOutputBuilder(string $feedback_correct, string $feedback_incorrect, int $active_id, ?int $pass)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getTestOutput( $active_id, $pass, $is_question_postponed, $user_post_solutions, $show_specific_inline_feedback)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
generateCorrectnessIconsForCorrectness(int $correctness)
getAnswersFrequency($relevantAnswers, $questionIndex)
getNodeData(int $a_node_id, ?int $a_tree_pk=null)
get all information of a node.
static stripSlashesRecursive($a_data, bool $a_strip_html=true, string $a_allow="")
getPreview($show_question_only=false, $showInlineFeedback=false)
int $sequence_no
sequence number in test
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getPreviousSolutionConfirmationCheckboxHtml()
addTab_SuggestedSolution(ilTabsGUI $tabs, string $classname)
getAutoSavedSolutionOutput(int $active_id, int $pass, bool $graphical_output=false, bool $result_output=false, bool $show_question_only=true, bool $show_feedback=false, bool $show_correct_solution=false, bool $show_manual_scoring=false, bool $show_question_text=true, bool $show_autosave_title=false, bool $show_inline_feedback=false)
writePref(string $a_keyword, string $a_value)
addTab_QuestionHints(ilTabsGUI $tabs)
ilTestQuestionNavigationGUI $navigationGUI
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getGUIClassNameForId($a_q_id)
setTaxonomyIds(array $taxonomyIds)
addTarget(string $a_text, string $a_link, $a_cmd="", $a_cmdClass="", string $a_frame="", bool $a_activate=false, bool $a_dir_text=false)
setOutputMode(string $a_mode=self::PRESENTATION)
int $question_count
question count in test
getEditQuestionTabCommands()
Abstract basic class which is to be extended by the concrete assessment question type classes...
getSuggestedSolutionsRepo()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilPropertyFormGUI $editForm
const SESSION_PREVIEW_DATA_BASE_INDEX
buildBasicEditFormObject()
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
createSuggestedSolutionLinkingTo(string $type, string $target)
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
addBasicQuestionFormProperties(ilPropertyFormGUI $form)
getBasicEditQuestionTabCommands()
static _getInternalLinkHref(string $target="")
isInTree(?int $a_node_id)
get all information of a node.
static prepareTextareaOutput(?string $txt_output, bool $prepare_for_latex_output=false, bool $omitNl2BrWhenTextArea=false)
Prepares a string for a text area output where latex code may be in it If the text is HTML-free...
setQuestionHeaderBlockBuilder(\ilQuestionHeaderBlockBuilder $questionHeaderBlockBuilder)
renderSolutionOutput(mixed $user_solutions, int $active_id, int $pass, bool $graphical_output=false, bool $result_output=false, bool $show_question_only=true, bool $show_feedback=false, bool $show_correct_solution=false, bool $show_manual_scoring=false, bool $show_question_text=true, bool $show_autosave_title=false, bool $show_inline_feedback=false,)
getAsValueAttribute(string $a_value)
const CORRECTNESS_MOSTLY_OK
escapeTemplatePlaceholders(string $text)
getPresentationJavascripts()
string $questionActionCmd
getGenericFeedbackOutputForCorrectSolution()
const SUGGESTED_SOLUTION_COMMANDS_CANCEL
writePostData(bool $always=false)
Evaluates a posted edit form and writes the form data in the question object.
bool $previousSolutionPrefilled
getUseUnchangedAnswerCheckboxHtml()
ilGlobalPageTemplate $tpl
originalSyncForm(string $return_to="", string $return_to_feedback='')
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static makeDirParents(string $a_dir)
Create a new directory and all parent directories.
isInLearningModuleContext()
isRenderPurposePlayback()
setQuestionCount(int $a_question_count)
static _questionExistsInTest(int $question_id, int $test_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
populateTaxonomyFormSection(ilPropertyFormGUI $form)
static _getQuestionGUI(string $question_type='', int $question_id=-1)
Creates a question gui representation and returns the alias to the question gui.
const CMD_SHOW_LIST
command constants
const CMD_SHOW
command constants
addNewIdListener($a_object, string $a_method, string $a_parameters="")
Add a listener that is notified with the new question ID, when a new question is saved.
addQuestionFormCommandButtons(ilPropertyFormGUI $form)
setPreviewSession(ilAssQuestionPreviewSession $previewSession)
isAnswerFrequencyStatisticSupported()
getContextPath($cont_obj, int $a_endnode_id, int $a_startnode_id=1)
get context path in content object tree
prepareReprintableCorrectionsForm(ilPropertyFormGUI $form)
ILIAS Notes GUIService $notes_gui
populateJavascriptFilesRequiredForWorkForm(ilGlobalTemplateInterface $tpl)
setValue(string $a_value)
static renameExecutables(string $a_dir)
const SUGGESTED_SOLUTION_COMMANDS_SAVE
getType()
needed for page editor compliance
getChildsByType(int $a_node_id, string $a_type)
get child nodes of given node by object type
setPresentationContext(string $presentationContext)
populateCorrectionsFormProperties(ilPropertyFormGUI $form)
hasSpecialQuestionCommands()
setErrorMessage(string $errormessage)
writeQuestionGenericPostData()
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
setQuestionActionCmd(string $questionActionCmd)
const PRESENTATION_CONTEXT_RESULTS
static getReturnToPageLink($q_id=null)
isRenderPurposeDemoplay()
getTermList(string $searchterm="", string $a_letter="", string $a_def="", int $a_tax_node=0, bool $a_include_offline_childs=false, bool $a_add_amet_fields=false, array $a_amet_filter=null, bool $a_omit_virtual=false, bool $a_include_references=false)
setAdjustmentEditContext()
setInLearningModuleContext(bool $flag)
const FORM_ENCODING_MULTIPART
Repository for suggested solutions.
setBackTarget(string $a_title, string $a_target, string $a_frame="")
isAdjustmentEditContext()
addTab_Question(ilTabsGUI $tabsGUI)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const EDIT_CONTEXT_ADJUSTMENT
static _getUsedHTMLTagsAsString(string $a_module="")
Returns a string of all allowed HTML tags for text editing.
addTab_QuestionFeedback(ilTabsGUI $tabs)
isRenderPurposeInputValue()
addJavaScript(string $a_js_file, bool $a_add_version_parameter=true, int $a_batch=2)
Add a javascript file that should be included in the header.
const RENDER_PURPOSE_DEMOPLAY
setTargetGui($linkTargetGui)
static moveUploadedFile(string $a_file, string $a_name, string $a_target, bool $a_raise_errors=true, string $a_mode="move_uploaded")
move uploaded file
setTargetGuiClass($targetGuiClass)
Basic GUI class for assessment questions.
callNewIdListeners(int $a_new_id)
setPref(string $a_keyword, ?string $a_value)
const EDIT_CONTEXT_AUTHORING
const PRESENTATION_CONTEXT_TEST
setSequenceNumber(int $nr)
getAssignmentsOfItem(int $a_item_id)
Get assignments for item.
static _getClassNameForQType($q_type)
ILIAS TestQuestionPool InternalRequestService $request
setRenderPurpose(string $renderPurpose)
completeTestOutputFormAction($formAction, $active_id, $pass)
static redirect(string $a_script)
const RETURN_AFTER_EXISTING_WITH_ORIGINAL_SAVE
getPreviousSolutionProvidedMessage()
const FORM_ENCODING_URLENCODE
const RENDER_PURPOSE_PLAYBACK
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setEditContext(string $editContext)
getGenericFeedbackOutputForIncorrectSolution()
setQuestionHTML(array $question_html)
saveTaxonomyAssignments()
getSpecificFeedbackOutput(array $userSolution)
Returns the answer specific feedback for the question.
const ALLOWED_PLAIN_TEXT_TAGS
sk - 12.05.2023: This const is also used in ilKprimChoiceWizardInputGUI.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getILIASPage(string $html="")
Returns the ILIAS Page around a question.
const HAS_SPECIAL_QUESTION_COMMANDS
addSaveOnEnterOnLoadCode()
outQuestionPage($a_temp_var, $a_postponed=false, $active_id="", $html="", $inlineFeedbackEnabled=false)
static getInstance()
Singleton: get instance for use in ILIAS requests with a config loaded from the settings.
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)
static getPageList(int $lm_id)
getAdditionalEditQuestionCommands()
This class represents a text area property in a property form.
addBackTab(ilTabsGUI $ilTabs)
ilComponentRepository $component_repository
getQuestionHeaderBlockBuilder()
Class ilObjContentObjectGUI.
setQuestionSpecificTabs(ilTabsGUI $ilTabs)
cleanupAnswerText(array $answer_text, bool $is_rte)
sk - 12.05.2023: This is one more of those that we need, but don't want.
const RENDER_PURPOSE_PRINT_PDF
addErrorMessage(string $errormessage)
string $presentationContext
isRenderPurposePrintPdf()
saveSuggestedSolutionType()
static _isWriteable(int $question_id, int $user_id)
setPreviousSolutionPrefilled(bool $previousSolutionPrefilled)
const SUGGESTED_SOLUTION_COMMANDS_DEFAULT
isPreviousSolutionPrefilled()
addNumberOfTriesToFormIfNecessary(ilPropertyFormGUI $form)
setSubObject(?string $sub_obj_type, ?int $sub_obj_id)
Set sub object attributes.
static _lookupType(int $id, bool $reference=false)
static getManualFeedback(int $active_id, int $question_id, ?int $pass)
Retrieves the feedback comment for a question in a test if it is finalized.
ilObjectDataCache $ilObjDataCache
outAdditionalOutput()
Why are you here? Some magic for plugins?
const RENDER_PURPOSE_INPUT_VALUE
const RENDER_PURPOSE_PREVIEW
setVariable(string $variable, $value='')
Sets the given variable to the given value.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getAnswerFrequencyTableGUI($parentGui, $parentCmd, $relevantAnswers, $questionIndex)
ilQuestionHeaderBlockBuilder $questionHeaderBlockBuilder
outQuestionForTest(string $formaction, int $active_id, ?int $pass, bool $is_question_postponed=false, $user_post_solutions=false, bool $show_specific_inline_feedback=false)
setExpand($a_node_id)
set the expand option this value is stored in a SESSION variable to save it different view (lo view...
static getCommandsFromClassConstants(string $guiClassName, string $cmdConstantNameBegin='CMD_')
static _getUsedHTMLTags(string $a_module="")
Returns an array of all allowed HTML tags for text editing.
ILIAS TestQuestionPool QuestionInfoService $questioninfo
setNavigationGUI(?ilTestQuestionNavigationGUI $navigationGUI)
renderEditForm(ilPropertyFormGUI $form)
assQuestionSuggestedSolutionsDatabaseRepository $suggestedsolution_repo
const RETURN_AFTER_EXISTING_SAVE
static getFeedbackClassNameByQuestionType(string $questionType)
static stripOnlySlashes(string $a_str)
renderPurposeSupportsFormHtml()
getGenericFeedbackOutput(int $active_id, ?int $pass)