19declare(strict_types=1);
165 $this->
lng = $DIC[
'lng'];
166 $this->tpl =
$DIC[
'tpl'];
167 $this->
ctrl = $DIC[
'ilCtrl'];
168 $this->current_user =
$DIC[
'ilUser'];
169 $this->
ui = $DIC->ui();
170 $this->ilObjDataCache =
$DIC[
'ilObjDataCache'];
171 $this->
access = $DIC->access();
173 $this->tabs_gui =
$DIC[
'ilTabs'];
174 $this->rbacsystem =
$DIC[
'rbacsystem'];
175 $this->tree =
$DIC[
'tree'];
176 $this->db =
$DIC->database();
177 $this->
logger = $DIC[
'ilLog'];
178 $this->component_repository =
$DIC[
'component.repository'];
181 $local_dic = QuestionPoolDIC::dic();
183 $this->request_data_collector = $local_dic[
'request_data_collector'];
184 $this->questionrepository = $local_dic[
'question.general_properties.repository'];
186 $this->errormessage = $this->
lng->txt(
"fill_out_all_required_fields");
187 $this->notes_gui =
$DIC->notes()->gui();
191 bool $checkonly =
false,
192 ?
bool $is_save_cmd =
null
204 bool $graphical_output =
false,
205 bool $result_output =
false,
206 bool $show_question_only =
true,
207 bool $show_feedback =
false,
208 bool $show_correct_solution =
false,
209 bool $show_manual_scoring =
false,
210 bool $show_question_text =
true,
211 bool $show_inline_feedback =
true
215 bool $show_question_only =
false,
216 bool $show_inline_feedback =
false
222 bool $is_question_postponed =
false,
223 array|
bool $user_post_solutions =
false,
224 bool $show_specific_inline_feedback =
false
228 mixed $user_solutions,
231 bool $graphical_output =
false,
232 bool $result_output =
false,
233 bool $show_question_only =
true,
234 bool $show_feedback =
false,
235 bool $show_correct_solution =
false,
236 bool $show_manual_scoring =
false,
237 bool $show_question_text =
true,
238 bool $show_autosave_title =
false,
239 bool $show_inline_feedback =
false,
251 return $this->object;
260 $this->
object = $question;
265 $this->copy_to_existing_pool_on_save = $pool_ref_id;
270 return $this->copy_to_existing_pool_on_save;
275 $this->copy_to_new_pool_on_save = $pool_title;
280 return $this->copy_to_new_pool_on_save;
285 $this->move_after_question_with_id = $question_id;
290 return $this->move_after_question_with_id;
304 echo $this->getHeaderAction() . $this->
ui->mainTemplate()->getOnLoadCodeForAsynch();
310 $parentObjType = $this->ilObjDataCache->lookupType($this->
object->getObjId());
316 $this->request_data_collector->getRefId(),
317 $this->object->getObjId()
320 $dispatcher->setSubObject(
"quest", $this->
object->getId());
322 $ha = $dispatcher->initHeaderAction();
323 $ha->enableComments(
true,
false);
325 return $ha->getHeaderAction($this->
ui->mainTemplate());
330 $comment_gui =
new ilCommentGUI($this->
object->getObjId(), $this->object->getId(),
'quest');
331 return $comment_gui->getListHTML();
336 $this->
ilHelp->setScreenIdComponent(
'qpl');
338 $next_class = $this->
ctrl->getNextClass($this);
340 switch ($next_class) {
341 case 'ilformpropertydispatchgui':
342 $form = $this->buildEditForm();
344 $form_prop_dispatch->setItem($form->getItemByPostVar(
ilUtil::stripSlashes($this->request_data_collector->string(
'postvar'))));
345 $this->
ctrl->forwardCommand($form_prop_dispatch);
348 $cmd = $this->
ctrl->getCmd(
'editQuestion');
350 case self::SUGGESTED_SOLUTION_COMMANDS_CANCEL:
351 case self::SUGGESTED_SOLUTION_COMMANDS_SAVE:
352 case self::SUGGESTED_SOLUTION_COMMANDS_DEFAULT:
353 case 'saveSuggestedSolutionType':
354 case 'saveContentsSuggestedSolution':
355 case 'deleteSuggestedSolution':
357 case 'cancelExplorer':
358 case 'outSolutionExplorer':
364 case self::CMD_SYNC_QUESTION:
365 case self::CMD_SYNC_QUESTION_AND_RETURN:
370 if (method_exists($this, $cmd)) {
379 return static::HAS_SPECIAL_QUESTION_COMMANDS;
385 return $this->getQuestionType();
390 return $this->presentationContext;
395 $this->presentationContext = $presentationContext;
400 return $this->getPresentationContext() == self::PRESENTATION_CONTEXT_TEST;
406 return $this->previousSolutionPrefilled;
411 $this->previousSolutionPrefilled = $previousSolutionPrefilled;
417 return $this->renderPurpose;
422 $this->renderPurpose = $renderPurpose;
427 return $this->getRenderPurpose() == self::RENDER_PURPOSE_PRINT_PDF;
432 return $this->getRenderPurpose() == self::RENDER_PURPOSE_PREVIEW;
437 return $this->getRenderPurpose() == self::RENDER_PURPOSE_INPUT_VALUE;
442 return $this->getRenderPurpose() == self::RENDER_PURPOSE_PLAYBACK;
447 return $this->getRenderPurpose() == self::RENDER_PURPOSE_DEMOPLAY;
452 if ($this->isRenderPurposePrintPdf()) {
456 if ($this->isRenderPurposeInputValue()) {
465 return $this->editContext;
470 $this->editContext = $editContext;
475 return $this->getEditContext() == self::EDIT_CONTEXT_AUTHORING;
480 return $this->getEditContext() == self::EDIT_CONTEXT_ADJUSTMENT;
485 $this->setEditContext(self::EDIT_CONTEXT_ADJUSTMENT);
490 return $this->navigationGUI;
495 $this->navigationGUI = $navigationGUI;
500 $this->taxonomyIds = $taxonomyIds;
505 return $this->taxonomyIds;
510 $this->setTargetGuiClass(get_class($linkTargetGui));
515 $this->targetGuiClass = $targetGuiClass;
520 return $this->targetGuiClass;
525 $this->questionHeaderBlockBuilder = $questionHeaderBlockBuilder;
531 return $this->questionHeaderBlockBuilder;
537 $this->questionActionCmd = $questionActionCmd;
539 if (is_object($this->
object)) {
540 $this->
object->questionActionCmd = $questionActionCmd;
546 return $this->questionActionCmd;
563 $this->tpl->setContent(implode(
'<br />', [
564 $stats_table->getHTML(),
565 $usage_table->getHTML()
575 $ilCtrl =
$DIC[
'ilCtrl'];
579 if (($question_type ===
'') && ($question_id > 0)) {
580 $question_type = QuestionPoolDIC::dic()[
'question.general_properties.repository']
581 ->getForQuestionId($question_id)?->getClassName();
584 if ($question_type ===
null || $question_type ===
'') {
588 $question_type_gui = $question_type .
'GUI';
589 $question =
new $question_type_gui();
592 $question->object->feedbackOBJ =
new $feedbackObjectClassname($question->object, $ilCtrl,
$ilDB,
$lng);
594 if ($question_id > 0) {
595 $question->object->loadFromDb($question_id);
603 foreach ($this->getPresentationJavascripts() as $jsFile) {
616 if (!$this->tpl->blockExists(
'adm_content')) {
617 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.il_as_question.html',
'components/ILIAS/TestQuestionPool');
623 $this->addSaveOnEnterOnLoadCode();
624 $this->getQuestionTemplate();
625 $this->tpl->setVariable(
'QUESTION_DATA', $form->
getHTML() . $this->question_sync_modal);
634 $page_gui->setFileDownloadLink($this->buildFileDownloadLink());
635 $page_gui->setQuestionHTML(
636 [$this->
object->getId() => $html]
638 $presentation = $page_gui->presentation();
639 $presentation = preg_replace(
"/src=\"\\.\\//ims",
"src=\"" . ILIAS_HTTP_PATH .
"/", $presentation);
640 return $presentation;
643 public function outQuestionPage($a_temp_var, $a_postponed =
false, $active_id =
"", $html =
"", $inlineFeedbackEnabled =
false): string
645 if ($this->
object->getTestPresentationConfig()->isSolutionInitiallyPrefilled()) {
647 $this->tpl->setOnScreenMessage(
'info', $this->getPreviousSolutionProvidedMessage());
648 $html .= $this->getPreviousSolutionConfirmationCheckboxHtml();
649 } elseif ($this->
object->getTestPresentationConfig()->isUnchangedAnswerPossible()) {
650 $html .= $this->getUseUnchangedAnswerCheckboxHtml();
653 $this->
lng->loadLanguageModule(
"content");
656 $page_gui->setFileDownloadLink($this->buildFileDownloadLink());
657 $page_gui->setOutputMode(
'presentation');
658 $page_gui->setTemplateTargetVar($a_temp_var);
660 if ($this->getNavigationGUI()) {
661 $html .= $this->getNavigationGUI()->getHTML();
662 $page_gui->setQuestionActionsHTML($this->getNavigationGUI()->getActionsHTML());
666 $page_gui->setQuestionHTML([$this->
object->getId() => $html]);
669 $page_gui->setPresentationTitle($this->questionHeaderBlockBuilder->getPresentationTitle());
670 $page_gui->setQuestionInfoHTML($this->questionHeaderBlockBuilder->getQuestionInfoHTML());
672 return $page_gui->presentation();
677 $tpl =
new ilTemplate(
'tpl.tst_question_additional_behaviour_checkbox.html',
true,
true,
'components/ILIAS/TestQuestionPool');
678 $tpl->
setVariable(
'TXT_FORCE_FORM_DIFF_LABEL', $this->
object->getTestPresentationConfig()->getUseUnchangedAnswerLabel());
684 return $this->
lng->txt(
'use_previous_solution_advice');
689 $tpl =
new ilTemplate(
'tpl.tst_question_additional_behaviour_checkbox.html',
true,
true,
'components/ILIAS/TestQuestionPool');
690 $tpl->
setVariable(
'TXT_FORCE_FORM_DIFF_LABEL', $this->
lng->txt(
'use_previous_solution'));
696 $original_id = $this->
object->getOriginalId();
697 if ($original_id !==
null) {
698 $this->
object->syncWithOriginal();
699 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
705 $old_id = $this->request_data_collector->getQuestionId();
706 $this->setAdditionalContentEditingModeFromPost();
707 $result = $this->writePostData();
709 $this->tabs_gui->setTabActive(
'edit_question');
713 $this->
object->getCurrentUser()->setPref(
'tst_lastquestiontype', $this->
object->getQuestionType());
714 $this->
object->getCurrentUser()->writePref(
'tst_lastquestiontype', $this->
object->getQuestionType());
715 $this->
object->saveToDb($old_id);
717 $this->questionrepository->questionExistsInPool($this->
object->getOriginalId());
718 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'msg_obj_modified'),
true);
724 $this->setAdditionalContentEditingModeFromPost();
725 $result = $this->writePostData();
726 $this->tabs_gui->activateTab(
'edit_question');
732 $this->
object->getCurrentUser()->setPref(
'tst_lastquestiontype', $this->
object->getQuestionType());
733 $this->
object->getCurrentUser()->writePref(
'tst_lastquestiontype', $this->
object->getQuestionType());
735 if ($this->request_data_collector->getQuestionId() === 0) {
736 if ($this->
object->getId() < 1) {
737 $this->
object->createNewQuestion();
739 $this->setQuestionTabs();
742 if ($this->needsSyncQuery()) {
743 $cmd = strpos($this->
ctrl->getCmd(),
'Return') ===
false
744 ? self::CMD_SYNC_QUESTION
745 : self::CMD_SYNC_QUESTION_AND_RETURN;
746 $this->question_sync_modal = $this->getQuestionSyncModal($cmd);
749 $this->
object->saveToDb();
755 $additional_content_editing_mode = $this->request_data_collector->string(
'additional_content_editing_mode');
756 if ($additional_content_editing_mode !==
''
757 && in_array($additional_content_editing_mode, $this->
object->getValidAdditionalContentEditingModes())) {
758 $this->
object->setAdditionalContentEditingMode($additional_content_editing_mode);
764 if ($this->request_data_collector->isset(
'pool_ref')) {
765 $this->copy_to_existing_pool_on_save = $this->request_data_collector->int(
'pool_ref');
768 if ($this->request_data_collector->isset(
'pool_title')) {
769 $this->copy_to_new_pool_on_save = $this->request_data_collector->string(
'pool_title');
772 if ($this->request_data_collector->isset(
'move_after_question_with_id')) {
773 $this->move_after_question_with_id = $this->request_data_collector->int(
'move_after_question_with_id');
780 public function getContextPath($cont_obj,
int $a_endnode_id,
int $a_startnode_id = 1): string
784 $tmpPath = $cont_obj->getLMTree()->getPathFull($a_endnode_id, $a_startnode_id);
787 for ($i = 1; $i < (count($tmpPath) - 1); $i++) {
792 $path .= $tmpPath[$i][
"title"];
800 $this->sequence_no = $nr;
805 return $this->sequence_no;
810 $this->question_count = $a_question_count;
815 return $this->question_count;
820 return $this->errormessage;
825 $this->errormessage = $errormessage;
830 $this->errormessage .= ((strlen($this->errormessage)) ?
"<br />" :
"") . $errormessage;
835 return $this->
object->getQuestionType();
841 if (strlen($a_value)) {
842 $result =
" value=\"$a_value\" ";
849 if (!$this->
object->getSelfAssessmentEditingMode()) {
858 $title->setMaxLength(100);
859 $title->setValue($this->
object->getTitle());
860 $title->setRequired(
true);
863 if (!$this->
object->getSelfAssessmentEditingMode()) {
866 $author->setValue($this->
object->getAuthor());
867 $author->setMaxLength(512);
868 $author->setRequired(
true);
873 $description->setValue($this->
object->getComment());
874 $description->setRequired(
false);
875 $description->setMaxLength(1000);
881 if (trim($author) ==
"") {
884 $hi->setValue($author);
890 $lifecycle->setOptions($this->
object->getLifecycle()->getSelectOptions($this->lng));
896 $question->setValue($this->
object->getQuestion());
897 $question->setRequired(
true);
898 $question->setRows(10);
899 $question->setCols(80);
901 if (!$this->
object->getSelfAssessmentEditingMode()) {
903 $question->setUseRte(
true);
905 $question->setRTESupport($this->
object->getId(),
'qpl',
'assessment');
909 $question->setUseTagsForRteOnly(
false);
911 $question->setInfo($this->
lng->txt(
'latex_edit_info'));
915 $question_type->setValue((
string) $this->getQuestionType());
916 $form->
addItem($question_type);
918 if ($this->copy_to_existing_pool_on_save !==
null) {
920 $pool_ref->setValue((
string) $this->copy_to_existing_pool_on_save);
924 if ($this->copy_to_new_pool_on_save !==
null) {
926 $pool_title->setValue($this->copy_to_new_pool_on_save);
930 if ($this->move_after_question_with_id !==
null) {
931 $move_after_question_id =
new ilHiddenInputGUI(
'move_after_question_with_id');
932 $move_after_question_id->setValue((
string) $this->move_after_question_with_id);
933 $form->
addItem($move_after_question_id);
936 $additional_content_editing_mode =
new ilHiddenInputGUI(
'additional_content_editing_mode');
937 $additional_content_editing_mode->setValue($this->
object->getAdditionalContentEditingMode());
938 $form->
addItem($additional_content_editing_mode);
940 $this->addNumberOfTriesToFormIfNecessary($form);
945 if (!$this->
object->getSelfAssessmentEditingMode()) {
949 $nr_tries = $this->
object->getNrOfTries() ?? $this->
object->getDefaultNrOfTries();
956 $ni->setValue((
string) $nr_tries);
959 $ni->setMaxLength(5);
965 if (count($this->getTaxonomyIds())) {
966 foreach ($this->getTaxonomyIds() as $taxonomyId) {
967 $postvar =
"tax_node_assign_$taxonomyId";
971 $tax_node_assign->saveInput(
"qpl", $this->
object->getObjId(),
"quest", $this->object->getId());
978 if ($this->getTaxonomyIds() !== []) {
980 $sectHeader->setTitle($this->
lng->txt(
'qpl_qst_edit_form_taxonomy_section'));
983 foreach ($this->getTaxonomyIds() as $taxonomyId) {
985 $label = sprintf($this->
lng->txt(
'qpl_qst_edit_form_taxonomy'), $taxonomy->getTitle());
986 $postvar =
"tax_node_assign_$taxonomyId";
989 $taxSelect->setTitle($label);
993 $assignedNodes = $taxNodeAssignments->getAssignmentsOfItem($this->
object->getId());
995 $taxSelect->setValue(array_map(
function ($assignedNode) {
996 return $assignedNode[
'node_id'];
1009 if ($manual_feedback !==
'') {
1010 return $manual_feedback;
1013 $output = $this->genericFeedbackOutputBuilder($active_id, $pass);
1015 if ($this->
object->isAdditionalContentEditingModePageObject()) {
1025 if ($pass === null) {
1028 $reached_points = $this->
object->calculateReachedPoints($active_id, $pass);
1029 $max_points = $this->
object->getMaximumPoints();
1031 $is_correct =
false;
1032 if ($reached_points == $max_points) {
1036 return $this->
object->feedbackOBJ->getGenericFeedbackTestPresentation(
1045 $this->
object->feedbackOBJ->getGenericFeedbackTestPresentation($this->object->getId(),
true),
1052 return $this->renderLatex(
1054 $this->
object->feedbackOBJ->getGenericFeedbackTestPresentation($this->object->getId(),
false),
1062 $count = $this->questionrepository->usageCount($this->
object->getId());
1064 if ($this->questionrepository->questionExistsInPool($this->object->getId()) && $count) {
1065 if ($this->rbacsystem->checkAccess(
"write", $this->request_data_collector->getRefId())) {
1066 $this->tpl->setOnScreenMessage(
'info', sprintf($this->
lng->txt(
"qpl_question_is_in_use"), $count));
1070 return $this->
lng->txt($this->
object->getQuestionType());
1075 foreach (SuggestedSolution::TYPES as $k => $v) {
1076 $options[$k] = $this->
lng->txt($v);
1083 $this->suggestedsolution(
true);
1088 $this->suggestedsolution();
1093 if ($save && $this->request_data_collector->int(
'deleteSuggestedSolution') === 1) {
1094 $this->
object->deleteSuggestedSolutions();
1095 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
1096 $this->
ctrl->redirect($this,
'suggestedsolution');
1101 $solution = $this->
object->getSuggestedSolution();
1102 $options = $this->getTypeOptions();
1104 $solution_type = $this->
ctrl->getCmd() ===
'cancelSuggestedSolution'
1105 ? $solution->getType()
1106 : $this->request_data_collector->string(
'solutiontype');
1107 if ($solution_type === SuggestedSolution::TYPE_FILE
1108 && ($solution ===
null || $solution->getType() !== SuggestedSolution::TYPE_FILE)
1110 $solution = $this->getSuggestedSolutionsRepo()->create(
1112 SuggestedSolution::TYPE_FILE
1116 $solution_filename = $this->request_data_collector->string(
'filename');
1117 if ($save && !empty($solution_filename)) {
1118 $solution = $solution->withTitle($solution_filename);
1121 if ($solution !==
null) {
1123 $form->setFormAction($this->
ctrl->getFormAction($this));
1124 $form->setTitle($this->
lng->txt(
'solution_hint'));
1125 $form->setMultipart(
true);
1126 $form->setTableWidth(
'100%');
1127 $form->setId(
'suggestedsolutiondisplay');
1131 'tpl.il_as_qpl_suggested_solution_input_presentation.html',
1134 'components/ILIAS/TestQuestionPool'
1137 if ($solution->isOfTypeLink()) {
1138 $href = $this->
object->getInternalLinkHref($solution->getInternalLink());
1139 $template->setCurrentBlock(
'preview');
1140 $template->setVariable(
'TEXT_SOLUTION', $this->
lng->txt(
'suggested_solution'));
1141 $template->setVariable(
1143 " <a href='{$href}' target='content'>{$this->lng->txt('view')}</a> "
1145 $template->parseCurrentBlock();
1147 $solution->isOfTypeFile()
1148 && $solution->getFilename()
1150 $href = $this->
object->getSuggestedSolutionPathWeb() . $solution->getFilename();
1151 $link =
" <a href='{$href}' target='content'>"
1154 $template->setCurrentBlock(
'preview');
1155 $template->setVariable(
'TEXT_SOLUTION', $this->
lng->txt(
'suggested_solution'));
1156 $template->setVariable(
'VALUE_SOLUTION', $link);
1157 $template->parseCurrentBlock();
1160 $template->setVariable(
'TEXT_TYPE', $this->
lng->txt(
'type'));
1161 $template->setVariable(
'VALUE_TYPE', $options[$solution->getType()]);
1163 $title->setHtml($template->get());
1165 $deletesolution->setOptionTitle($this->
lng->txt(
'deleteSuggestedSolution'));
1166 $title->addSubItem($deletesolution);
1167 $form->addItem($title);
1169 if ($solution->isOfTypeFile()) {
1171 $file->setRequired(
true);
1172 $file->enableFileNameSelection(
'filename');
1174 if ($save && $_FILES && $_FILES[
'file'][
'tmp_name'] && $file->checkInput()) {
1175 if (!file_exists($this->
object->getSuggestedSolutionPath())) {
1180 $_FILES[
'file'][
'tmp_name'],
1181 $_FILES[
'file'][
'name'],
1182 $this->
object->getSuggestedSolutionPath() . $_FILES[
'file'][
'name']
1188 if ($solution->getFilename()) {
1189 @unlink($this->
object->getSuggestedSolutionPath() . $solution->getFilename());
1192 $file->setValue($_FILES[
'file'][
'name']);
1193 $solution = $solution
1194 ->withFilename($_FILES[
'file'][
'name'])
1195 ->withMime($_FILES[
'file'][
'type'])
1196 ->withSize($_FILES[
'file'][
'size'])
1197 ->withTitle($this->request_data_collector->string(
'filename'));
1199 $this->getSuggestedSolutionsRepo()->update([$solution]);
1201 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'suggested_solution_added_successfully'),
true);
1202 $this->
ctrl->redirect($this,
'suggestedsolution');
1205 $this->tpl->setOnScreenMessage(
'info',
$res);
1208 if ($solution->getFilename()) {
1209 $file->setValue($solution->getFilename());
1210 $file->setFilename($solution->getTitle());
1213 $form->addItem($file);
1215 $hidden->setValue(
'file');
1216 $form->addItem($hidden);
1218 if ($this->
access->checkAccess(
'write',
'', $this->request_data_collector->getRefId())) {
1219 $form->addCommandButton(
'cancelSuggestedSolution', $this->
lng->txt(
'cancel'));
1220 $form->addCommandButton(
'saveSuggestedSolution', $this->
lng->txt(
'save'));
1224 if ($form->checkInput()) {
1225 if ($solution->isOfTypeFile()) {
1226 $solution = $solution->withTitle($this->request_data_collector->string(
'filename'));
1229 if (!$solution->isOfTypeLink()) {
1230 $this->getSuggestedSolutionsRepo()->update([$solution]);
1233 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'msg_obj_modified'),
true);
1234 $this->
ctrl->redirect($this,
'suggestedsolution');
1238 $output = $form->getHTML();
1241 $savechange = $this->
ctrl->getCmd() ===
'saveSuggestedSolutionType';
1244 if ($this->
access->checkAccess(
'write',
'', $this->request_data_collector->getRefId())) {
1246 $formchange->setFormAction($this->
ctrl->getFormAction($this));
1248 $title = $solution ? $this->
lng->txt(
'changeSuggestedSolution') : $this->
lng->txt(
'addSuggestedSolution');
1249 $formchange->setTitle($title);
1250 $formchange->setMultipart(
false);
1251 $formchange->setTableWidth(
'100%');
1252 $formchange->setId(
'suggestedsolution');
1255 foreach ($options as $opt_value => $opt_caption) {
1256 $solutiontype->addOption(
new ilRadioOption($opt_caption, $opt_value));
1259 $solutiontype->setValue($solution->getType());
1261 $solutiontype->setRequired(
true);
1262 $formchange->addItem($solutiontype);
1264 $formchange->addCommandButton(
'saveSuggestedSolutionType', $this->
lng->txt(
'select'));
1267 $formchange->checkInput();
1269 $changeoutput = $formchange->getHTML();
1271 $this->tabs_gui->activateTab(
'suggested_solution');
1272 $this->tpl->setVariable(
'ADM_CONTENT', $changeoutput . $output);
1277 $type = $this->request_data_collector->string(
"link_new_type");
1278 $search = $this->request_data_collector->string(
"search_link_type");
1279 $this->
ctrl->setParameter($this,
"link_new_type", $type);
1280 $this->
ctrl->setParameter($this,
"search_link_type", $search);
1281 $this->
ctrl->saveParameter($this, [
"subquestion_index",
"link_new_type",
"search_link_type"]);
1283 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"select_object_to_link"));
1285 $parent_ref_id = $this->tree->getParentId($this->request_data_collector->getRefId());
1287 $exp->setExpand($this->request_data_collector->raw(
'expand_sol') ? $this->request_data_collector->raw(
'expand_sol') : $parent_ref_id);
1288 $exp->setExpandTarget($this->
ctrl->getLinkTarget($this,
'outSolutionExplorer'));
1289 $exp->setTargetGet(
"ref_id");
1290 $exp->setRefId($this->request_data_collector->getRefId());
1291 $exp->addFilter($type);
1292 $exp->setSelectableType($type);
1293 if ($this->request_data_collector->isset(
'expandCurrentPath') && $this->request_data_collector->raw(
'expandCurrentPath')) {
1294 $exp->expandPathByRefId($parent_ref_id);
1300 $template =
new ilTemplate(
"tpl.il_as_qpl_explorer.html",
true,
true,
"components/ILIAS/TestQuestionPool");
1301 $template->setVariable(
"EXPLORER_TREE", $exp->getOutput());
1302 $template->setVariable(
"BUTTON_CANCEL", $this->
lng->txt(
"cancel"));
1303 $template->setVariable(
"FORMACTION", $this->
ctrl->getFormAction($this,
"suggestedsolution"));
1304 $this->tpl->setVariable(
"ADM_CONTENT", $template->get());
1309 $solution_type = $this->request_data_collector->string(
'solutiontype');
1311 switch ($solution_type) {
1331 $this->suggestedsolution();
1335 if (isset($solution_type)) {
1336 $this->
ctrl->setParameter($this,
'expandCurrentPath', 1);
1338 $this->
ctrl->setParameter($this,
'link_new_type', $type);
1339 $this->
ctrl->setParameter($this,
'search_link_type', $search);
1340 $this->
ctrl->redirect($this,
'outSolutionExplorer');
1345 $this->
ctrl->redirect($this,
'suggestedsolution');
1350 $this->
ctrl->setParameter($this,
'q_id', $this->
object->getId());
1352 $cont_obj_gui =
new ilObjContentObjectGUI(
'', $this->request_data_collector->int(
'source_id'),
true);
1353 $cont_obj = $cont_obj_gui->getObject();
1356 $tree = $cont_obj->getLMTree();
1361 foreach ($chapters as $chapter) {
1363 foreach ($chapterpages as $page) {
1364 if ($page[
'type'] == $this->request_data_collector->raw(
'search_link_type')) {
1365 array_push($shownpages, $page[
'obj_id']);
1367 if ($tree->
isInTree($page[
'obj_id'])) {
1368 $path_str = $this->getContextPath($cont_obj, $page[
'obj_id']);
1373 $this->
ctrl->setParameter($this, $page[
'type'], $page[
'obj_id']);
1375 'title' => $page[
'title'],
1377 'text_add' => $this->
lng->txt(
'add'),
1378 'href_add' => $this->
ctrl->getLinkTarget($this,
'add' . strtoupper($page[
'type']))
1383 foreach ($pages as $page) {
1384 if (!in_array($page[
'obj_id'], $shownpages)) {
1385 $this->
ctrl->setParameter($this, $page[
'type'], $page[
'obj_id']);
1387 'title' => $page[
'title'],
1388 'description' =>
'---',
1389 'text_add' => $this->
lng->txt(
'add'),
1390 'href_add' => $this->
ctrl->getLinkTarget($this,
'add' . strtoupper($page[
'type']))
1396 $table->setTitle($this->
lng->txt(
'obj_' .
ilUtil::stripSlashes($this->request_data_collector->string(
'search_link_type'))));
1397 $table->setData($rows);
1399 $this->tpl->setContent($table->getHTML());
1404 $this->
ctrl->setParameter($this,
'q_id', $this->
object->getId());
1406 $cont_obj_gui =
new ilObjContentObjectGUI(
'', $this->request_data_collector->int(
'source_id'),
true);
1407 $cont_obj = $cont_obj_gui->getObject();
1408 $ctree = $cont_obj->getLMTree();
1409 $nodes = $ctree->getSubtree($ctree->getNodeData($ctree->getRootId()));
1413 foreach ($nodes as $node) {
1414 if ($node[
'type'] == $this->request_data_collector->raw(
'search_link_type')) {
1415 $this->
ctrl->setParameter($this, $node[
'type'], $node[
'obj_id']);
1417 'title' => $node[
'title'],
1418 'description' =>
'',
1419 'text_add' => $this->
lng->txt(
'add'),
1420 'href_add' => $this->
ctrl->getLinkTarget($this,
'add' . strtoupper($node[
'type']))
1426 $table->setTitle($this->
lng->txt(
'obj_' .
ilUtil::stripSlashes($this->request_data_collector->string(
'search_link_type'))));
1427 $table->setData($rows);
1429 $this->tpl->setContent($table->getHTML());
1434 $this->
ctrl->setParameter($this,
'q_id', $this->
object->getId());
1436 $glossary =
new ilObjGlossary($this->request_data_collector->int(
'source_id'),
true);
1437 $terms = $glossary->getTermList();
1441 foreach ($terms as $term) {
1442 $this->
ctrl->setParameter($this,
'git', $term[
'id']);
1444 'title' => $term[
'term'],
1445 'description' =>
'',
1446 'text_add' => $this->
lng->txt(
'add'),
1447 'href_add' => $this->
ctrl->getLinkTarget($this,
'addGIT')
1452 $table->setTitle($this->
lng->txt(
'glossary_term'));
1453 $table->setData($rows);
1455 $this->tpl->setContent($table->getHTML());
1460 $repo = $this->getSuggestedSolutionsRepo();
1461 $question_id = $this->
object->getId();
1462 $subquestion_index = $this->request_data_collector->int(
'subquestion_index');
1463 $subquestion_index = ($subquestion_index > 0) ? $subquestion_index : 0;
1465 $solution = $repo->create($question_id, $type)
1466 ->withSubquestionIndex($subquestion_index)
1467 ->withInternalLink($target);
1469 $repo->update([$solution]);
1474 $this->
ctrl->saveParameter($this, [
"subquestion_index",
"link_new_type",
"search_link_type"]);
1475 switch ($this->request_data_collector->string(
"search_link_type")) {
1477 $this->outPageSelector();
1480 $this->outChapterSelector();
1483 $this->outGlossarySelector();
1486 $target =
"il__lm_" . $this->request_data_collector->raw(
"source_id");
1487 $this->createSuggestedSolutionLinkingTo(
'lm', $target);
1488 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"suggested_solution_added_successfully"),
true);
1489 $this->
ctrl->redirect($this,
'suggestedsolution');
1496 $target =
"il__pg_" . $this->request_data_collector->raw(
"pg");
1497 $this->createSuggestedSolutionLinkingTo(
'pg', $target);
1498 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"suggested_solution_added_successfully"),
true);
1499 $this->
ctrl->redirect($this,
'suggestedsolution');
1504 $target =
"il__st_" . $this->request_data_collector->raw(
"st");
1505 $this->createSuggestedSolutionLinkingTo(
'st', $target);
1506 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"suggested_solution_added_successfully"),
true);
1507 $this->
ctrl->redirect($this,
'suggestedsolution');
1512 $target =
"il__git_" . $this->request_data_collector->raw(
"git");
1513 $this->createSuggestedSolutionLinkingTo(
'git', $target);
1514 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"suggested_solution_added_successfully"),
true);
1515 $this->
ctrl->redirect($this,
'suggestedsolution');
1520 return in_array($this->
ctrl->getCmd(), self::QUESTION_SAVE_CMDS);
1524 string $guiClassName,
1525 string $cmdConstantNameBegin =
'CMD_'
1527 $reflectionClass = new ReflectionClass($guiClassName);
1531 if ($reflectionClass instanceof ReflectionClass) {
1534 foreach ($reflectionClass->getConstants() as $constName => $constValue) {
1535 if (substr($constName, 0, strlen($cmdConstantNameBegin)) == $cmdConstantNameBegin) {
1536 $commands[] = $constValue;
1546 $this->tabs_gui->clearTargets();
1548 if ($this->
object->getId() > 0) {
1549 $this->setDefaultTabs($this->tabs_gui);
1550 $this->setQuestionSpecificTabs($this->tabs_gui);
1551 $this->tabs_gui->activateTab(
'edit_question');
1553 $this->addBackTab($this->tabs_gui);
1558 $this->
ctrl->setParameterByClass(ilAssQuestionPageGUI::class,
'q_id', $this->
object->getId());
1559 $this->
ctrl->setParameterByClass(static::class,
'q_id', $this->
object->getId());
1561 $this->addTab_Question($tabs_gui);
1562 $this->addTab_QuestionFeedback($tabs_gui);
1563 $this->addTab_SuggestedSolution($tabs_gui, static::class);
1572 $this->
ctrl->setParameterByClass($classname,
'q_id', $this->
object->getId());
1574 'suggested_solution',
1575 $this->
ctrl->getLinkTargetByClass($classname,
'suggestedsolution'),
1577 'suggestedsolution',
1578 'saveSuggestedSolution',
1579 'outSolutionExplorer',
1581 'addSuggestedSolution',
1584 'removeSuggestedSolution'
1591 return array_merge($this->getBasicEditQuestionTabCommands(), $this->getAdditionalEditQuestionCommands());
1596 return [
'editQuestion',
'save',
'originalSyncForm'];
1606 $tabCommands = self::getCommandsFromClassConstants(ilAssQuestionFeedbackEditingGUI::class);
1608 $this->
ctrl->setParameterByClass(ilAssQuestionFeedbackEditingGUI::class,
'q_id', $this->
object->getId());
1611 $tabs->
addTarget(
'feedback', $tabLink, $tabCommands, $this->
ctrl->getCmdClass(),
'');
1618 $this->
ctrl->getLinkTargetByClass(
1631 $reachedPoints = $this->
object->getAdjustedReachedPoints((
int) $activeId, (
int) $passIndex,
true);
1632 $maximumPoints = $this->
object->getMaximumPoints();
1634 return $reachedPoints == $maximumPoints;
1644 $this->
object->setTitle($this->request_data_collector->string(
'title'));
1645 $this->
object->setAuthor($this->request_data_collector->string(
'author'));
1646 $this->
object->setComment($this->request_data_collector->string(
'comment'));
1648 $nr_of_tries = $this->request_data_collector->int(
'nr_of_tries');
1649 if ($this->
object->getSelfAssessmentEditingMode()) {
1650 $this->
object->setNrOfTries($nr_of_tries);
1655 $this->request_data_collector->string(
'lifecycle')
1661 $this->
object->setQuestion(
1663 $this->request_data_collector->string(
'question')
1667 $this->setTestSpecificProperties();
1674 bool $is_question_postponed =
false,
1675 array|
bool $user_post_solutions =
false,
1676 bool $show_specific_inline_feedback =
false
1678 $formaction = $this->completeTestOutputFormAction($formaction, $active_id, $pass);
1680 $test_output = $this->getTestOutput(
1683 $is_question_postponed,
1684 $user_post_solutions,
1685 $show_specific_inline_feedback
1688 $this->magicAfterTestOutput();
1690 $this->tpl->setVariable(
"QUESTION_OUTPUT", $test_output);
1691 $this->tpl->setVariable(
"FORMACTION", $formaction);
1692 $this->tpl->setVariable(
"ENCTYPE",
'enctype="' . $this->getFormEncodingType() .
'"');
1693 $this->tpl->setVariable(
"FORM_TIMESTAMP", (
string) time());
1697 string $form_action,
1711 return self::FORM_ENCODING_URLENCODE;
1716 if ($this->
object->getId() <= 0) {
1718 $this->
lng->txt(
'cancel'),
1719 $this->ctrl->getParentReturnByClass(
1727 $this->
ctrl->setParameterByClass(
1728 ilAssQuestionPreviewGUI::class,
1732 $this->
ctrl->saveParameterByClass(ilAssQuestionPreviewGUI::class,
'prev_qid');
1734 $this->
lng->txt(
'backtocallingpage'),
1735 $this->ctrl->getLinkTargetByClass(
1736 ilAssQuestionPreviewGUI::class,
1740 $this->
ctrl->clearParameterByClass(ilAssQuestionPreviewGUI::class,
'prev_qid');
1745 $this->preview_session = $preview_session;
1753 return $this->preview_session;
1759 $form->setFormAction($this->
ctrl->getFormAction($this));
1760 $form->setId($this->getType());
1761 $form->setTitle($this->outQuestionType());
1762 $form->setTableWidth(
'100%');
1763 $form->setMultipart(
true);
1769 return str_replace([
'{',
'}'], [
'{',
'}'], $text);
1774 $this->editQuestion(
true);
1775 return $this->editForm;
1780 return '<div id="focus"></div>';
1801 $table->setQuestionIndex($questionIndex);
1802 $table->setData($this->getAnswersFrequency($relevantAnswers, $questionIndex));
1803 $table->initColumns();
1822 switch ($correctness) {
1823 case self::CORRECTNESS_NOT_OK:
1824 $icon_name =
'standard/icon_not_ok.svg';
1825 $label = $this->
lng->txt(
"answer_is_wrong");
1827 case self::CORRECTNESS_MOSTLY_OK:
1828 $icon_name =
'standard/icon_mostly_ok.svg';
1829 $label = $this->
lng->txt(
"answer_is_not_correct_but_positive");
1831 case self::CORRECTNESS_OK:
1832 $icon_name =
'standard/icon_ok.svg';
1833 $label = $this->
lng->txt(
"answer_is_right");
1839 $icon = $this->
ui->factory()->symbol()->icon()->custom(
1843 return $this->
ui->renderer()->render($icon);
1855 ?
string $txt_output,
1856 bool $prepare_for_latex_output =
false,
1857 bool $omitNl2BrWhenTextArea =
false
1859 if ($txt_output === null || $txt_output ===
'') {
1863 $result = $txt_output;
1866 if (strlen(strip_tags($result)) < strlen($result)) {
1872 if (!$omitNl2BrWhenTextArea) {
1874 $result = preg_replace(
"/[\n]/",
"<br />", $result);
1878 if (preg_match_all(
"/(<pre>.*?<\/pre>)/ims", $result, $matches)) {
1879 foreach ($matches[0] as $found) {
1881 if (strpos(
"\n", $found) ===
false) {
1882 $replacement =
"\n";
1884 $removed = preg_replace(
"/<br\s*?\/>/ims", $replacement, $found);
1885 $result = str_replace($found, $removed, $result);
1890 if ($prepare_for_latex_output) {
1895 $result = str_replace(
"{",
"{", $result);
1896 $result = str_replace(
"}",
"}", $result);
1897 $result = str_replace(
"\\",
"\", $result);
1908 return $this->
ui->renderer()->render($this->
ui->factory()->legacy()->latexContent($content));
1914 if (is_null($this->suggestedsolution_repo)) {
1915 $dic = QuestionPoolDIC::dic();
1916 $this->suggestedsolution_repo =
$dic[
'question.repo.suggestedsolutions'];
1918 return $this->suggestedsolution_repo;
1927 if (!is_array($answer_text)) {
1942 self::ALLOWED_PLAIN_TEXT_TAGS
1948 return $this->parent_type_is_lm;
1952 $this->parent_type_is_lm = $flag;
1957 $this->tpl->addOnloadCode(
"
1958 let form = document.querySelector('#ilContentContainer form');
1959 let button = form.querySelector('input[name=\"cmd[save]\"]');
1960 if (form && button) {
1961 form.addEventListener('keydown', function (e) {
1962 if (e.key === 'Enter'
1963 && e.target.type !== 'textarea'
1964 && e.target.type !== 'submit'
1965 && e.target.type !== 'file'
1968 form.requestSubmit(button);
1977 return in_array($cmd, static::ADDITIONAL_CMDS_NEEDING_EXISTING_QST);
1982 $this->context_allows_sync_to_pool = $sync_allowed;
1987 return $this->context_allows_sync_to_pool
1988 && $this->
object->hasWritableOriginalInQuestionPool();
1993 if ($cmd_class ===
'') {
1994 $cmd_class = static::class;
1996 $modal = $this->
ui->factory()->modal()->interruptive(
1997 $this->
lng->txt(
'confirm'),
1998 $this->lng->txt(
'confirm_sync_questions'),
1999 $this->ctrl->getFormActionByClass($cmd_class, $cmd)
2000 )->withAffectedItems([
2001 $this->
ui->factory()->modal()->interruptiveItem()->standard(
2002 (
string) $this->object->getOriginalId(),
2003 $this->object->getTitleForHTMLOutput()
2005 ])->withActionButtonLabel($this->
lng->txt(
'sync_question_to_pool'));
2006 return $this->
ui->renderer()->render(
2007 $modal->withOnLoad($modal->getShowSignal())
2014 bool $graphical_output =
false,
2015 bool $result_output =
false,
2016 bool $show_question_only =
true,
2017 bool $show_feedback =
false,
2018 bool $show_correct_solution =
false,
2019 bool $show_manual_scoring =
false,
2020 bool $show_question_text =
true,
2021 bool $show_autosave_title =
false,
2022 bool $show_inline_feedback =
false
2024 $autosave_solutions = $this->
object->getSolutionValues($active_id, $pass, false);
2025 if ($autosave_solutions === []) {
2028 return $this->renderSolutionOutput(
2029 $autosave_solutions,
2034 $show_question_only,
2036 $show_correct_solution,
2037 $show_manual_scoring,
2038 $show_question_text,
2039 $show_autosave_title,
2040 $show_inline_feedback
2046 if (strtolower($this->request_data_collector->string(
'cmdClass')) ===
'ilassquestionpreviewgui') {
2047 return $this->
ctrl->getLinkTargetByClass(ilObjQuestionPoolGUI::class,
'downloadFile');
2049 return $this->
ctrl->getLinkTargetByClass(ilObjTestGUI::class,
'downloadFile');
2055 $this->current_user->getId(),
2056 $this->object->getId()
2058 $this->preview_session->setRandomizerSeed(
null);
2059 $this->preview_session->setParticipantsSolution(
null);
2060 $this->preview_session->setInstantResponseActive(
false);
Repository for suggested solutions.
const FORM_ENCODING_MULTIPART
isRenderPurposeInputValue()
cmdNeedsExistingQuestion(string $cmd)
populateTaxonomyFormSection(ilPropertyFormGUI $form)
setInLearningModuleContext(bool $flag)
getAsValueAttribute(string $a_value)
getGenericFeedbackOutputForIncorrectSolution()
getQuestionSyncModal(string $cmd, string $cmd_class='')
getGenericFeedbackOutputForCorrectSolution()
saveCorrectionsFormProperties(ilPropertyFormGUI $form)
const SESSION_PREVIEW_DATA_BASE_INDEX
setMoveAfterQuestionId(?int $question_id)
ilAssQuestionPreviewSession $preview_session
const RENDER_PURPOSE_DEMOPLAY
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)
const SUGGESTED_SOLUTION_COMMANDS_SAVE
addTab_Question(ilTabsGUI $tabs_gui)
const PRESENTATION_CONTEXT_TEST
string $presentationContext
getType()
needed for page editor compliance
const ALLOWED_PLAIN_TEXT_TAGS
sk - 12.05.2023: This const is also used in ilKprimChoiceWizardInputGUI.
outQuestionForTest(string $formaction, int $active_id, ?int $pass, bool $is_question_postponed=false, array|bool $user_post_solutions=false, bool $show_specific_inline_feedback=false)
completeTestOutputFormAction(string $form_action, int $active_id, int $pass)
setCopyToNewPoolOnSave(?string $pool_title)
renderLatex($content)
Wrap content with latex in a LatexContent UI component and render it to be processed by MathJax in th...
ilObjectDataCache $ilObjDataCache
int $copy_to_existing_pool_on_save
const CMD_SYNC_QUESTION_AND_RETURN
getContextPath($cont_obj, int $a_endnode_id, int $a_startnode_id=1)
get context path in content object tree
isRenderPurposePrintPdf()
writeQuestionGenericPostData()
static getCommandsFromClassConstants(string $guiClassName, string $cmdConstantNameBegin='CMD_')
getAnswerFrequencyTableGUI($parentGui, $parentCmd, $relevantAnswers, $questionIndex)
static _getQuestionGUI(string $question_type='', int $question_id=-1)
Creates a question gui representation and returns the alias to the question gui.
int $sequence_no
sequence number in test
escapeTemplatePlaceholders(string $text)
addSaveOnEnterOnLoadCode()
getBasicEditQuestionTabCommands()
addBackTab(ilTabsGUI $tabs_gui)
editQuestion(bool $checkonly=false, ?bool $is_save_cmd=null)
const RENDER_PURPOSE_PLAYBACK
setPreviousSolutionPrefilled(bool $previousSolutionPrefilled)
isPreviousSolutionPrefilled()
setQuestionSpecificTabs(ilTabsGUI $tabs_gui)
const CORRECTNESS_MOSTLY_OK
setPresentationContext(string $presentationContext)
readonly RequestDataCollector $request_data_collector
readonly ilTestLegacyFormsHelper $forms_helper
setTargetGui($linkTargetGui)
const ADDITIONAL_CMDS_NEEDING_EXISTING_QST
There are functions that need an existing question.
string $copy_to_new_pool_on_save
setRenderPurpose(string $renderPurpose)
getILIASPage(string $html="")
Returns the ILIAS Page around a question.
populateCorrectionsFormProperties(ilPropertyFormGUI $form)
saveSuggestedSolutionType()
isInLearningModuleContext()
getAdditionalEditQuestionCommands()
const FORM_ENCODING_URLENCODE
isRenderPurposePlayback()
const RENDER_PURPOSE_PRINT_PDF
ilComponentRepository $component_repository
ilGlobalPageTemplate $tpl
prepareReprintableCorrectionsForm(ilPropertyFormGUI $form)
addBasicQuestionFormProperties(ilPropertyFormGUI $form)
getTestOutput(int $active_id, int $pass, bool $is_question_postponed=false, array|bool $user_post_solutions=false, bool $show_specific_inline_feedback=false)
getQuestionHeaderBlockBuilder()
setQuestionHeaderBlockBuilder(\ilQuestionHeaderBlockBuilder $questionHeaderBlockBuilder)
const EDIT_CONTEXT_ADJUSTMENT
setAdjustmentEditContext()
renderEditForm(ilPropertyFormGUI $form)
setSequenceNumber(int $nr)
int $question_count
question count in test
setObject(assQuestion $question)
getPreview(bool $show_question_only=false, bool $show_inline_feedback=false)
setTargetGuiClass(string $targetGuiClass)
cleanupAnswerText(array $answer_text, bool $is_rte)
sk - 12.05.2023: This is one more of those that we need, but don't want.
addTab_SuggestedSolution(ilTabsGUI $tabs, string $classname)
setTestSpecificProperties()
setAdditionalContentEditingModeFromPost()
const CMD_SAVE_AND_RETURN
resetSavedPreviewSession()
setPreviewSession(ilAssQuestionPreviewSession $preview_session)
outQuestionPage($a_temp_var, $a_postponed=false, $active_id="", $html="", $inlineFeedbackEnabled=false)
const EDIT_CONTEXT_AUTHORING
string $question_sync_modal
const SUGGESTED_SOLUTION_COMMANDS_DEFAULT
createSuggestedSolutionLinkingTo(string $type, string $target)
getGenericFeedbackOutput(int $active_id, ?int $pass)
const RENDER_PURPOSE_PREVIEW
renderPurposeSupportsFormHtml()
saveTaxonomyAssignments()
getSpecificFeedbackOutput(array $userSolution)
Returns the answer specific feedback for the question.
setContextAllowsSyncToPool(bool $sync_allowed)
bool $previousSolutionPrefilled
getAnswersFrequency($relevantAnswers, $questionIndex)
addErrorMessage(string $errormessage)
populateJavascriptFilesRequiredForWorkForm(ilGlobalTemplateInterface $tpl)
genericFeedbackOutputBuilder(int $active_id, ?int $pass)
setDefaultTabs(ilTabsGUI $tabs_gui)
setEditContext(string $editContext)
cancelSuggestedSolution()
buildBasicEditFormObject()
const PRESENTATION_CONTEXT_RESULTS
setCopyToExistingPoolOnSave(?int $pool_ref_id)
getPreviousSolutionProvidedMessage()
setQuestionCount(int $a_question_count)
addQuestionFormCommandButtons(ilPropertyFormGUI $form)
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,...
ilQuestionHeaderBlockBuilder $questionHeaderBlockBuilder
getEditQuestionTabCommands()
string $questionActionCmd
setErrorMessage(string $errormessage)
ilTestQuestionNavigationGUI $navigationGUI
bool $context_allows_sync_to_pool
isAnswerFrequencyStatisticSupported()
getSolutionOutput(int $active_id, ?int $pass=null, 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_inline_feedback=true)
getUseUnchangedAnswerCheckboxHtml()
getPresentationJavascripts()
const RENDER_PURPOSE_INPUT_VALUE
ilPropertyFormGUI $editForm
isTestPresentationContext()
isRenderPurposeDemoplay()
writePostData(bool $always=false)
Evaluates a posted edit form and writes the form data in the question object.
setTaxonomyIds(array $taxonomyIds)
GeneralQuestionPropertiesRepository $questionrepository
hasCorrectSolution($activeId, $passIndex)
suggestedsolution(bool $save=false)
hasSpecialQuestionCommands()
addTab_QuestionFeedback(ilTabsGUI $tabs)
setQuestionActionCmd(string $questionActionCmd)
isAdjustmentEditContext()
getCopyToExistingPoolOnSave()
const SUGGESTED_SOLUTION_COMMANDS_CANCEL
generateCorrectnessIconsForCorrectness(int $correctness)
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,)
const HAS_SPECIAL_QUESTION_COMMANDS
getSuggestedSolutionsRepo()
setNavigationGUI(?ilTestQuestionNavigationGUI $navigationGUI)
getPreviousSolutionConfirmationCheckboxHtml()
addNumberOfTriesToFormIfNecessary(ilPropertyFormGUI $form)
int $move_after_question_with_id
const ADDITIONAL_CONTENT_EDITING_MODE_IPE
static getFeedbackClassNameByQuestionType(string $questionType)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static stripSlashesRecursive($a_data, bool $a_strip_html=true, string $a_allow="")
static getInstance($identifier)
Class ilCommonActionDispatcherGUI.
Class ilCtrl provides processing control methods.
static makeDirParents(string $a_dir)
Create a new directory and all parent directories.
static renameExecutables(string $a_dir)
static moveUploadedFile(string $a_file, string $a_name, string $a_target, bool $a_raise_errors=true, string $a_mode="move_uploaded")
move uploaded file
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
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...
static getPageList(int $lm_id)
Component logger with individual log levels by component id.
Class ilObjContentObjectGUI.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getManualFeedback(int $active_id, int $question_id, ?int $pass)
Retrieves the feedback comment for a question in a test if it is finalized.
static getClassByType(string $obj_type)
static _lookupType(int $id, bool $reference=false)
Class ilQuestionUsagesTableGUI.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getUsedHTMLTags(string $module='')
static _getUsedHTMLTagsAsString(string $module='')
static replaceLatexSpan(string $text)
Replace the latex delimiters used by the rich text editor Unfortunately these can't be processed by M...
This class represents an option in a radio group.
class ilRbacSystem system function like checkAccess, addActiveRole ... Supporting system functions ar...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setBackTarget(string $a_title, string $a_target, string $a_frame="")
addTarget(string $a_text, string $a_link, $a_cmd="", $a_cmdClass="", string $a_frame="", bool $a_activate=false, bool $a_dir_text=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
special template class to simplify handling of ITX/PEAR
This class represents a text area property in a property form.
This class represents a text property in a property form.
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
isInTree(?int $a_node_id)
get all information of a node.
getNodeData(int $a_node_id, ?int $a_tree_pk=null)
get all information of a node.
getChildsByType(int $a_node_id, string $a_type)
get child nodes of given node by object type
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
static stripOnlySlashes(string $a_str)
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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.
Interface ilAccessHandler This interface combines all available interfaces which can be called via gl...
Readable part of repository interface to ilComponentDataDB.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
if(!file_exists('../ilias.ini.php'))