19declare(strict_types=1);
166 $this->
lng = $DIC[
'lng'];
167 $this->tpl =
$DIC[
'tpl'];
168 $this->
ctrl = $DIC[
'ilCtrl'];
169 $this->current_user =
$DIC[
'ilUser'];
170 $this->
ui = $DIC->ui();
171 $this->ilObjDataCache =
$DIC[
'ilObjDataCache'];
172 $this->
access = $DIC->access();
174 $this->tabs_gui =
$DIC[
'ilTabs'];
175 $this->rbacsystem =
$DIC[
'rbacsystem'];
176 $this->tree =
$DIC[
'tree'];
177 $this->db =
$DIC->database();
178 $this->
logger = $DIC[
'ilLog'];
179 $this->component_repository =
$DIC[
'component.repository'];
182 $local_dic = QuestionPoolDIC::dic();
184 $this->request_data_collector = $local_dic[
'request_data_collector'];
185 $this->questionrepository = $local_dic[
'question.general_properties.repository'];
187 $this->errormessage = $this->
lng->txt(
"fill_out_all_required_fields");
188 $this->notes_gui =
$DIC->notes()->gui();
192 bool $checkonly =
false,
193 ?
bool $is_save_cmd =
null
205 bool $graphical_output =
false,
206 bool $result_output =
false,
207 bool $show_question_only =
true,
208 bool $show_feedback =
false,
209 bool $show_correct_solution =
false,
210 bool $show_manual_scoring =
false,
211 bool $show_question_text =
true,
212 bool $show_inline_feedback =
true
216 bool $show_question_only =
false,
217 bool $show_inline_feedback =
false
223 bool $is_question_postponed =
false,
224 array|
bool $user_post_solutions =
false,
225 bool $show_specific_inline_feedback =
false
229 mixed $user_solutions,
232 bool $graphical_output =
false,
233 bool $result_output =
false,
234 bool $show_question_only =
true,
235 bool $show_feedback =
false,
236 bool $show_correct_solution =
false,
237 bool $show_manual_scoring =
false,
238 bool $show_question_text =
true,
239 bool $show_autosave_title =
false,
240 bool $show_inline_feedback =
false,
252 return $this->object;
261 $this->
object = $question;
266 $this->copy_to_existing_pool_on_save = $pool_ref_id;
271 return $this->copy_to_existing_pool_on_save;
276 $this->copy_to_new_pool_on_save = $pool_title;
281 return $this->copy_to_new_pool_on_save;
286 $this->move_after_question_with_id = $question_id;
291 return $this->move_after_question_with_id;
305 echo $this->getHeaderAction() . $this->
ui->mainTemplate()->getOnLoadCodeForAsynch();
311 $parentObjType = $this->ilObjDataCache->lookupType($this->
object->getObjId());
317 $this->request_data_collector->getRefId(),
318 $this->object->getObjId()
321 $dispatcher->setSubObject(
"quest", $this->
object->getId());
323 $ha = $dispatcher->initHeaderAction();
324 $ha->enableComments(
true,
false);
326 return $ha->getHeaderAction($this->
ui->mainTemplate());
331 $comment_gui =
new ilCommentGUI($this->
object->getObjId(), $this->object->getId(),
'quest');
332 return $comment_gui->getListHTML();
337 $this->
ilHelp->setScreenIdComponent(
'qpl');
339 $next_class = $this->
ctrl->getNextClass($this);
341 switch ($next_class) {
342 case 'ilformpropertydispatchgui':
343 $form = $this->buildEditForm();
345 $form_prop_dispatch->setItem($form->getItemByPostVar(
ilUtil::stripSlashes($this->request_data_collector->string(
'postvar'))));
346 $this->
ctrl->forwardCommand($form_prop_dispatch);
349 $cmd = $this->
ctrl->getCmd(
'editQuestion');
351 case self::SUGGESTED_SOLUTION_COMMANDS_CANCEL:
352 case self::SUGGESTED_SOLUTION_COMMANDS_SAVE:
353 case self::SUGGESTED_SOLUTION_COMMANDS_DEFAULT:
354 case 'saveSuggestedSolutionType':
355 case 'saveContentsSuggestedSolution':
356 case 'deleteSuggestedSolution':
358 case 'cancelExplorer':
359 case 'outSolutionExplorer':
365 case self::CMD_SYNC_QUESTION:
366 case self::CMD_SYNC_QUESTION_AND_RETURN:
371 if (method_exists($this, $cmd)) {
380 return static::HAS_SPECIAL_QUESTION_COMMANDS;
386 return $this->getQuestionType();
391 return $this->presentationContext;
396 $this->presentationContext = $presentationContext;
401 return $this->getPresentationContext() == self::PRESENTATION_CONTEXT_TEST;
407 return $this->previousSolutionPrefilled;
412 $this->previousSolutionPrefilled = $previousSolutionPrefilled;
418 return $this->renderPurpose;
423 $this->renderPurpose = $renderPurpose;
428 return $this->getRenderPurpose() == self::RENDER_PURPOSE_PRINT_PDF;
433 return $this->getRenderPurpose() == self::RENDER_PURPOSE_PREVIEW;
438 return $this->getRenderPurpose() == self::RENDER_PURPOSE_INPUT_VALUE;
443 return $this->getRenderPurpose() == self::RENDER_PURPOSE_PLAYBACK;
448 return $this->getRenderPurpose() == self::RENDER_PURPOSE_DEMOPLAY;
453 if ($this->isRenderPurposePrintPdf()) {
457 if ($this->isRenderPurposeInputValue()) {
466 return $this->editContext;
471 $this->editContext = $editContext;
476 return $this->getEditContext() == self::EDIT_CONTEXT_AUTHORING;
481 return $this->getEditContext() == self::EDIT_CONTEXT_ADJUSTMENT;
486 $this->setEditContext(self::EDIT_CONTEXT_ADJUSTMENT);
491 return $this->navigationGUI;
496 $this->navigationGUI = $navigationGUI;
501 $this->taxonomyIds = $taxonomyIds;
506 return $this->taxonomyIds;
511 $this->setTargetGuiClass(get_class($linkTargetGui));
516 $this->targetGuiClass = $targetGuiClass;
521 return $this->targetGuiClass;
526 $this->questionHeaderBlockBuilder = $questionHeaderBlockBuilder;
532 return $this->questionHeaderBlockBuilder;
538 $this->questionActionCmd = $questionActionCmd;
540 if (is_object($this->
object)) {
541 $this->
object->questionActionCmd = $questionActionCmd;
547 return $this->questionActionCmd;
564 $this->tpl->setContent(implode(
'<br />', [
565 $stats_table->getHTML(),
566 $usage_table->getHTML()
576 $ilCtrl =
$DIC[
'ilCtrl'];
580 if (($question_type ===
'') && ($question_id > 0)) {
581 $question_type = QuestionPoolDIC::dic()[
'question.general_properties.repository']
582 ->getForQuestionId($question_id)?->getClassName();
585 if ($question_type ===
null || $question_type ===
'') {
589 $question_type_gui = $question_type .
'GUI';
590 $question =
new $question_type_gui();
593 $question->object->feedbackOBJ =
new $feedbackObjectClassname($question->object, $ilCtrl,
$ilDB,
$lng);
595 if ($question_id > 0) {
596 $question->object->loadFromDb($question_id);
604 foreach ($this->getPresentationJavascripts() as $jsFile) {
617 if (!$this->tpl->blockExists(
'adm_content')) {
618 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.il_as_question.html',
'components/ILIAS/TestQuestionPool');
624 $this->addSaveOnEnterOnLoadCode();
625 $this->getQuestionTemplate();
626 $this->tpl->setVariable(
'QUESTION_DATA', $form->
getHTML() . $this->question_sync_modal);
635 $page_gui->setFileDownloadLink($this->buildFileDownloadLink());
636 $page_gui->setQuestionHTML(
637 [$this->
object->getId() => $html]
639 $presentation = $page_gui->presentation();
640 $presentation = preg_replace(
"/src=\"\\.\\//ims",
"src=\"" . ILIAS_HTTP_PATH .
"/", $presentation);
641 return $presentation;
644 public function outQuestionPage($a_temp_var, $a_postponed =
false, $active_id =
"", $html =
"", $inlineFeedbackEnabled =
false): string
646 if ($this->
object->getTestPresentationConfig()->isSolutionInitiallyPrefilled()) {
648 $this->tpl->setOnScreenMessage(
'info', $this->getPreviousSolutionProvidedMessage());
649 $html .= $this->getPreviousSolutionConfirmationCheckboxHtml();
650 } elseif ($this->
object->getTestPresentationConfig()->isUnchangedAnswerPossible()) {
651 $html .= $this->getUseUnchangedAnswerCheckboxHtml();
654 $this->
lng->loadLanguageModule(
"content");
657 $page_gui->setFileDownloadLink($this->buildFileDownloadLink());
658 $page_gui->setOutputMode(
'presentation');
659 $page_gui->setTemplateTargetVar($a_temp_var);
661 if ($this->getNavigationGUI()) {
662 $html .= $this->getNavigationGUI()->getHTML();
663 $page_gui->setQuestionActionsHTML($this->getNavigationGUI()->getActionsHTML());
667 $page_gui->setQuestionHTML([$this->
object->getId() => $html]);
670 $page_gui->setPresentationTitle($this->questionHeaderBlockBuilder->getPresentationTitle());
671 $page_gui->setQuestionInfoHTML($this->questionHeaderBlockBuilder->getQuestionInfoHTML());
673 return $page_gui->presentation();
678 $tpl =
new ilTemplate(
'tpl.tst_question_additional_behaviour_checkbox.html',
true,
true,
'components/ILIAS/TestQuestionPool');
679 $tpl->
setVariable(
'TXT_FORCE_FORM_DIFF_LABEL', $this->
object->getTestPresentationConfig()->getUseUnchangedAnswerLabel());
685 return $this->
lng->txt(
'use_previous_solution_advice');
690 $tpl =
new ilTemplate(
'tpl.tst_question_additional_behaviour_checkbox.html',
true,
true,
'components/ILIAS/TestQuestionPool');
691 $tpl->
setVariable(
'TXT_FORCE_FORM_DIFF_LABEL', $this->
lng->txt(
'use_previous_solution'));
697 $original_id = $this->
object->getOriginalId();
698 if ($original_id !==
null) {
699 $this->
object->syncWithOriginal();
700 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
706 $old_id = $this->request_data_collector->getQuestionId();
707 $this->setAdditionalContentEditingModeFromPost();
708 $result = $this->writePostData();
710 $this->tabs_gui->setTabActive(
'edit_question');
714 $this->
object->getCurrentUser()->setPref(
'tst_lastquestiontype', $this->
object->getQuestionType());
715 $this->
object->getCurrentUser()->writePref(
'tst_lastquestiontype', $this->
object->getQuestionType());
716 $this->
object->saveToDb($old_id);
718 $this->questionrepository->questionExistsInPool($this->
object->getOriginalId());
719 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'msg_obj_modified'),
true);
725 $this->setAdditionalContentEditingModeFromPost();
726 $result = $this->writePostData();
727 $this->tabs_gui->activateTab(
'edit_question');
733 $this->
object->getCurrentUser()->setPref(
'tst_lastquestiontype', $this->
object->getQuestionType());
734 $this->
object->getCurrentUser()->writePref(
'tst_lastquestiontype', $this->
object->getQuestionType());
736 if ($this->request_data_collector->getQuestionId() === 0) {
737 if ($this->
object->getId() < 1) {
738 $this->
object->createNewQuestion();
740 $this->setQuestionTabs();
743 if ($this->needsSyncQuery()) {
744 $cmd = strpos($this->
ctrl->getCmd(),
'Return') ===
false
745 ? self::CMD_SYNC_QUESTION
746 : self::CMD_SYNC_QUESTION_AND_RETURN;
747 $this->question_sync_modal = $this->getQuestionSyncModal($cmd);
750 $this->
object->saveToDb();
756 $additional_content_editing_mode = $this->request_data_collector->string(
'additional_content_editing_mode');
757 if ($additional_content_editing_mode !==
''
758 && in_array($additional_content_editing_mode, $this->
object->getValidAdditionalContentEditingModes())) {
759 $this->
object->setAdditionalContentEditingMode($additional_content_editing_mode);
765 if ($this->request_data_collector->isset(
'pool_ref')) {
766 $this->copy_to_existing_pool_on_save = $this->request_data_collector->int(
'pool_ref');
769 if ($this->request_data_collector->isset(
'pool_title')) {
770 $this->copy_to_new_pool_on_save = $this->request_data_collector->string(
'pool_title');
773 if ($this->request_data_collector->isset(
'move_after_question_with_id')) {
774 $this->move_after_question_with_id = $this->request_data_collector->int(
'move_after_question_with_id');
781 public function getContextPath($cont_obj,
int $a_endnode_id,
int $a_startnode_id = 1): string
785 $tmpPath = $cont_obj->getLMTree()->getPathFull($a_endnode_id, $a_startnode_id);
788 for ($i = 1; $i < (count($tmpPath) - 1); $i++) {
793 $path .= $tmpPath[$i][
"title"];
801 $this->sequence_no = $nr;
806 return $this->sequence_no;
811 $this->question_count = $a_question_count;
816 return $this->question_count;
821 return $this->errormessage;
826 $this->errormessage = $errormessage;
831 $this->errormessage .= ((strlen($this->errormessage)) ?
"<br />" :
"") . $errormessage;
836 return $this->
object->getQuestionType();
842 if (strlen($a_value)) {
843 $result =
" value=\"$a_value\" ";
850 if (!$this->
object->getSelfAssessmentEditingMode()) {
859 $title->setMaxLength(100);
860 $title->setValue($this->
object->getTitle());
861 $title->setRequired(
true);
864 if (!$this->
object->getSelfAssessmentEditingMode()) {
867 $author->setValue($this->
object->getAuthor());
868 $author->setMaxLength(512);
869 $author->setRequired(
true);
874 $description->setValue($this->
object->getComment());
875 $description->setRequired(
false);
876 $description->setMaxLength(1000);
882 if (trim($author) ==
"") {
885 $hi->setValue($author);
891 $lifecycle->setOptions($this->
object->getLifecycle()->getSelectOptions($this->lng));
897 $question->setValue($this->
object->getQuestion());
898 $question->setRequired(
true);
899 $question->setRows(10);
900 $question->setCols(80);
902 if (!$this->
object->getSelfAssessmentEditingMode()) {
904 $question->setUseRte(
true);
906 $question->setRTESupport($this->
object->getId(),
'qpl',
'assessment');
910 $question->setUseTagsForRteOnly(
false);
912 $question->setInfo($this->
lng->txt(
'latex_edit_info'));
916 $question_type->setValue((
string) $this->getQuestionType());
917 $form->
addItem($question_type);
919 if ($this->copy_to_existing_pool_on_save !==
null) {
921 $pool_ref->setValue((
string) $this->copy_to_existing_pool_on_save);
925 if ($this->copy_to_new_pool_on_save !==
null) {
927 $pool_title->setValue($this->copy_to_new_pool_on_save);
931 if ($this->move_after_question_with_id !==
null) {
932 $move_after_question_id =
new ilHiddenInputGUI(
'move_after_question_with_id');
933 $move_after_question_id->setValue((
string) $this->move_after_question_with_id);
934 $form->
addItem($move_after_question_id);
937 $additional_content_editing_mode =
new ilHiddenInputGUI(
'additional_content_editing_mode');
938 $additional_content_editing_mode->setValue($this->
object->getAdditionalContentEditingMode());
939 $form->
addItem($additional_content_editing_mode);
941 $this->addNumberOfTriesToFormIfNecessary($form);
946 if (!$this->
object->getSelfAssessmentEditingMode()) {
950 $nr_tries = $this->
object->getNrOfTries() ?? $this->
object->getDefaultNrOfTries();
957 $ni->setValue((
string) $nr_tries);
960 $ni->setMaxLength(5);
966 if (count($this->getTaxonomyIds())) {
967 foreach ($this->getTaxonomyIds() as $taxonomyId) {
968 $postvar =
"tax_node_assign_$taxonomyId";
972 $tax_node_assign->saveInput(
"qpl", $this->
object->getObjId(),
"quest", $this->object->getId());
979 if ($this->getTaxonomyIds() !== []) {
981 $sectHeader->setTitle($this->
lng->txt(
'qpl_qst_edit_form_taxonomy_section'));
984 foreach ($this->getTaxonomyIds() as $taxonomyId) {
986 $label = sprintf($this->
lng->txt(
'qpl_qst_edit_form_taxonomy'), $taxonomy->getTitle());
987 $postvar =
"tax_node_assign_$taxonomyId";
990 $taxSelect->setTitle($label);
994 $assignedNodes = $taxNodeAssignments->getAssignmentsOfItem($this->
object->getId());
996 $taxSelect->setValue(array_map(
function ($assignedNode) {
997 return $assignedNode[
'node_id'];
1010 if ($manual_feedback !==
'') {
1011 return $manual_feedback;
1014 $output = $this->genericFeedbackOutputBuilder($active_id, $pass);
1016 if ($this->
object->isAdditionalContentEditingModePageObject()) {
1026 if ($pass === null) {
1029 $reached_points = $this->
object->calculateReachedPoints($active_id, $pass);
1030 $max_points = $this->
object->getMaximumPoints();
1032 $is_correct =
false;
1033 if ($reached_points == $max_points) {
1037 return $this->
object->feedbackOBJ->getGenericFeedbackTestPresentation(
1046 $this->
object->feedbackOBJ->getGenericFeedbackTestPresentation($this->object->getId(),
true),
1053 return $this->renderLatex(
1055 $this->
object->feedbackOBJ->getGenericFeedbackTestPresentation($this->object->getId(),
false),
1063 $count = $this->questionrepository->usageCount($this->
object->getId());
1065 if ($this->questionrepository->questionExistsInPool($this->object->getId()) && $count) {
1066 if ($this->rbacsystem->checkAccess(
"write", $this->request_data_collector->getRefId())) {
1067 $this->tpl->setOnScreenMessage(
'info', sprintf($this->
lng->txt(
"qpl_question_is_in_use"), $count));
1071 return $this->
lng->txt($this->
object->getQuestionType());
1076 foreach (SuggestedSolution::TYPES as $k => $v) {
1084 $this->suggestedsolution(
true);
1089 $this->suggestedsolution();
1094 if ($save && $this->request_data_collector->int(
'deleteSuggestedSolution') === 1) {
1095 $this->
object->deleteSuggestedSolutions();
1096 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
1097 $this->
ctrl->redirect($this,
'suggestedsolution');
1102 $solution = $this->
object->getSuggestedSolution();
1103 $options = $this->getTypeOptions();
1105 $solution_type = $this->
ctrl->getCmd() ===
'cancelSuggestedSolution'
1106 ? $solution?->getType()
1107 : $this->request_data_collector->string(
'solutiontype');
1108 if ($solution_type === SuggestedSolution::TYPE_FILE
1109 && ($solution ===
null || $solution->getType() !== SuggestedSolution::TYPE_FILE)
1111 $solution = $this->getSuggestedSolutionsRepo()->create(
1113 SuggestedSolution::TYPE_FILE
1117 $solution_filename = $this->request_data_collector->string(
'filename');
1118 if ($save && !empty($solution_filename)) {
1119 $solution = $solution->withTitle($solution_filename);
1122 if ($solution !==
null) {
1124 $form->setFormAction($this->
ctrl->getFormAction($this));
1125 $form->setTitle($this->
lng->txt(
'solution_hint'));
1126 $form->setMultipart(
true);
1127 $form->setTableWidth(
'100%');
1128 $form->setId(
'suggestedsolutiondisplay');
1132 'tpl.il_as_qpl_suggested_solution_input_presentation.html',
1135 'components/ILIAS/TestQuestionPool'
1138 if ($solution->isOfTypeLink()) {
1139 $href = $this->
object->getInternalLinkHref($solution->getInternalLink());
1140 $template->setCurrentBlock(
'preview');
1141 $template->setVariable(
'TEXT_SOLUTION', $this->
lng->txt(
'suggested_solution'));
1142 $template->setVariable(
1144 " <a href='{$href}' target='content'>{$this->lng->txt('view')}</a> "
1146 $template->parseCurrentBlock();
1148 $solution->isOfTypeFile()
1149 && $solution->getFilename()
1151 $href = $this->
object->getSuggestedSolutionPathWeb() . $solution->getFilename();
1152 $link =
" <a href='{$href}' target='content'>"
1155 $template->setCurrentBlock(
'preview');
1156 $template->setVariable(
'TEXT_SOLUTION', $this->
lng->txt(
'suggested_solution'));
1157 $template->setVariable(
'VALUE_SOLUTION', $link);
1158 $template->parseCurrentBlock();
1161 $template->setVariable(
'TEXT_TYPE', $this->
lng->txt(
'type'));
1162 $template->setVariable(
'VALUE_TYPE',
$options[$solution->getType()]);
1164 $title->setHtml($template->get());
1166 $deletesolution->setOptionTitle($this->
lng->txt(
'deleteSuggestedSolution'));
1167 $title->addSubItem($deletesolution);
1168 $form->addItem($title);
1170 if ($solution->isOfTypeFile()) {
1172 $file->setRequired(
true);
1173 $file->enableFileNameSelection(
'filename');
1175 if ($save && $_FILES && $_FILES[
'file'][
'tmp_name'] && $file->checkInput()) {
1176 if (!file_exists($this->
object->getSuggestedSolutionPath())) {
1181 $_FILES[
'file'][
'tmp_name'],
1182 $_FILES[
'file'][
'name'],
1183 $this->
object->getSuggestedSolutionPath() . $_FILES[
'file'][
'name']
1189 if ($solution->getFilename()) {
1190 @unlink($this->
object->getSuggestedSolutionPath() . $solution->getFilename());
1193 $file->setValue($_FILES[
'file'][
'name']);
1194 $solution = $solution
1195 ->withFilename($_FILES[
'file'][
'name'])
1196 ->withMime($_FILES[
'file'][
'type'])
1197 ->withSize($_FILES[
'file'][
'size'])
1198 ->withTitle($this->request_data_collector->string(
'filename'));
1200 $this->getSuggestedSolutionsRepo()->update([$solution]);
1202 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'suggested_solution_added_successfully'),
true);
1203 $this->
ctrl->redirect($this,
'suggestedsolution');
1206 $this->tpl->setOnScreenMessage(
'info',
$res);
1209 if ($solution->getFilename()) {
1210 $file->setValue($solution->getFilename());
1211 $file->setFilename($solution->getTitle());
1214 $form->addItem($file);
1216 $hidden->setValue(
'file');
1217 $form->addItem($hidden);
1219 if ($this->
access->checkAccess(
'write',
'', $this->request_data_collector->getRefId())) {
1220 $form->addCommandButton(
'cancelSuggestedSolution', $this->
lng->txt(
'cancel'));
1221 $form->addCommandButton(
'saveSuggestedSolution', $this->
lng->txt(
'save'));
1225 if ($form->checkInput()) {
1226 if ($solution->isOfTypeFile()) {
1227 $solution = $solution->withTitle($this->request_data_collector->string(
'filename'));
1230 if (!$solution->isOfTypeLink()) {
1231 $this->getSuggestedSolutionsRepo()->update([$solution]);
1234 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'msg_obj_modified'),
true);
1235 $this->
ctrl->redirect($this,
'suggestedsolution');
1239 $output = $form->getHTML();
1242 $savechange = $this->
ctrl->getCmd() ===
'saveSuggestedSolutionType';
1245 if ($this->
access->checkAccess(
'write',
'', $this->request_data_collector->getRefId())) {
1247 $formchange->setFormAction($this->
ctrl->getFormAction($this));
1249 $title = $solution ? $this->
lng->txt(
'changeSuggestedSolution') : $this->
lng->txt(
'addSuggestedSolution');
1250 $formchange->setTitle($title);
1251 $formchange->setMultipart(
false);
1252 $formchange->setTableWidth(
'100%');
1253 $formchange->setId(
'suggestedsolution');
1256 foreach (
$options as $opt_value => $opt_caption) {
1257 $solutiontype->addOption(
new ilRadioOption($opt_caption, $opt_value));
1260 $solutiontype->setValue($solution->getType());
1262 $solutiontype->setRequired(
true);
1263 $formchange->addItem($solutiontype);
1265 $formchange->addCommandButton(
'saveSuggestedSolutionType', $this->
lng->txt(
'select'));
1268 $formchange->checkInput();
1270 $changeoutput = $formchange->getHTML();
1272 $this->tabs_gui->activateTab(
'suggested_solution');
1273 $this->tpl->setVariable(
'ADM_CONTENT', $changeoutput . $output);
1278 $type = $this->request_data_collector->string(
"link_new_type");
1279 $search = $this->request_data_collector->string(
"search_link_type");
1280 $this->
ctrl->setParameter($this,
"link_new_type", $type);
1281 $this->
ctrl->setParameter($this,
"search_link_type", $search);
1282 $this->
ctrl->saveParameter($this, [
"subquestion_index",
"link_new_type",
"search_link_type"]);
1284 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"select_object_to_link"));
1286 $parent_ref_id = $this->tree->getParentId($this->request_data_collector->getRefId());
1288 $exp->setExpand($this->request_data_collector->raw(
'expand_sol') ? $this->request_data_collector->raw(
'expand_sol') : $parent_ref_id);
1289 $exp->setExpandTarget($this->
ctrl->getLinkTarget($this,
'outSolutionExplorer'));
1290 $exp->setTargetGet(
"ref_id");
1291 $exp->setRefId($this->request_data_collector->getRefId());
1292 $exp->addFilter($type);
1293 $exp->setSelectableType($type);
1294 if ($this->request_data_collector->isset(
'expandCurrentPath') && $this->request_data_collector->raw(
'expandCurrentPath')) {
1295 $exp->expandPathByRefId($parent_ref_id);
1301 $template =
new ilTemplate(
"tpl.il_as_qpl_explorer.html",
true,
true,
"components/ILIAS/TestQuestionPool");
1302 $template->setVariable(
"EXPLORER_TREE", $exp->getOutput());
1303 $template->setVariable(
"BUTTON_CANCEL", $this->
lng->txt(
"cancel"));
1304 $template->setVariable(
"FORMACTION", $this->
ctrl->getFormAction($this,
"suggestedsolution"));
1305 $this->tpl->setVariable(
"ADM_CONTENT", $template->get());
1310 $solution_type = $this->request_data_collector->string(
'solutiontype');
1312 switch ($solution_type) {
1332 $this->suggestedsolution();
1336 if (isset($solution_type)) {
1337 $this->
ctrl->setParameter($this,
'expandCurrentPath', 1);
1339 $this->
ctrl->setParameter($this,
'link_new_type', $type);
1340 $this->
ctrl->setParameter($this,
'search_link_type', $search);
1341 $this->
ctrl->redirect($this,
'outSolutionExplorer');
1346 $this->
ctrl->redirect($this,
'suggestedsolution');
1351 $this->
ctrl->setParameter($this,
'q_id', $this->
object->getId());
1353 $cont_obj_gui =
new ilObjContentObjectGUI(
'', $this->request_data_collector->int(
'source_id'),
true);
1354 $cont_obj = $cont_obj_gui->getObject();
1357 $tree = $cont_obj->getLMTree();
1362 foreach ($chapters as $chapter) {
1364 foreach ($chapterpages as $page) {
1365 if ($page[
'type'] == $this->request_data_collector->raw(
'search_link_type')) {
1366 array_push($shownpages, $page[
'obj_id']);
1368 if ($tree->
isInTree($page[
'obj_id'])) {
1369 $path_str = $this->getContextPath($cont_obj, $page[
'obj_id']);
1374 $this->
ctrl->setParameter($this, $page[
'type'], $page[
'obj_id']);
1376 'title' => $page[
'title'],
1378 'text_add' => $this->
lng->txt(
'add'),
1379 'href_add' => $this->
ctrl->getLinkTarget($this,
'add' . strtoupper($page[
'type']))
1384 foreach ($pages as $page) {
1385 if (!in_array($page[
'obj_id'], $shownpages)) {
1386 $this->
ctrl->setParameter($this, $page[
'type'], $page[
'obj_id']);
1388 'title' => $page[
'title'],
1389 'description' =>
'---',
1390 'text_add' => $this->
lng->txt(
'add'),
1391 'href_add' => $this->
ctrl->getLinkTarget($this,
'add' . strtoupper($page[
'type']))
1397 $table->setTitle($this->
lng->txt(
'obj_' .
ilUtil::stripSlashes($this->request_data_collector->string(
'search_link_type'))));
1398 $table->setData($rows);
1400 $this->tpl->setContent($table->getHTML());
1405 $this->
ctrl->setParameter($this,
'q_id', $this->
object->getId());
1407 $cont_obj_gui =
new ilObjContentObjectGUI(
'', $this->request_data_collector->int(
'source_id'),
true);
1408 $cont_obj = $cont_obj_gui->getObject();
1409 $ctree = $cont_obj->getLMTree();
1410 $nodes = $ctree->getSubtree($ctree->getNodeData($ctree->getRootId()));
1414 foreach ($nodes as $node) {
1415 if ($node[
'type'] == $this->request_data_collector->raw(
'search_link_type')) {
1416 $this->
ctrl->setParameter($this, $node[
'type'], $node[
'obj_id']);
1418 'title' => $node[
'title'],
1419 'description' =>
'',
1420 'text_add' => $this->
lng->txt(
'add'),
1421 'href_add' => $this->
ctrl->getLinkTarget($this,
'add' . strtoupper($node[
'type']))
1427 $table->setTitle($this->
lng->txt(
'obj_' .
ilUtil::stripSlashes($this->request_data_collector->string(
'search_link_type'))));
1428 $table->setData($rows);
1430 $this->tpl->setContent($table->getHTML());
1435 $this->
ctrl->setParameter($this,
'q_id', $this->
object->getId());
1437 $glossary =
new ilObjGlossary($this->request_data_collector->int(
'source_id'),
true);
1438 $terms = $glossary->getTermList();
1442 foreach ($terms as $term) {
1443 $this->
ctrl->setParameter($this,
'git', $term[
'id']);
1445 'title' => $term[
'term'],
1446 'description' =>
'',
1447 'text_add' => $this->
lng->txt(
'add'),
1448 'href_add' => $this->
ctrl->getLinkTarget($this,
'addGIT')
1453 $table->setTitle($this->
lng->txt(
'glossary_term'));
1454 $table->setData($rows);
1456 $this->tpl->setContent($table->getHTML());
1461 $repo = $this->getSuggestedSolutionsRepo();
1462 $question_id = $this->
object->getId();
1463 $subquestion_index = $this->request_data_collector->int(
'subquestion_index');
1464 $subquestion_index = ($subquestion_index > 0) ? $subquestion_index : 0;
1466 $solution = $repo->create($question_id, $type)
1467 ->withSubquestionIndex($subquestion_index)
1468 ->withInternalLink($target);
1470 $repo->update([$solution]);
1475 $this->
ctrl->saveParameter($this, [
"subquestion_index",
"link_new_type",
"search_link_type"]);
1476 switch ($this->request_data_collector->string(
"search_link_type")) {
1478 $this->outPageSelector();
1481 $this->outChapterSelector();
1484 $this->outGlossarySelector();
1487 $target =
"il__lm_" . $this->request_data_collector->raw(
"source_id");
1488 $this->createSuggestedSolutionLinkingTo(
'lm', $target);
1489 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"suggested_solution_added_successfully"),
true);
1490 $this->
ctrl->redirect($this,
'suggestedsolution');
1497 $target =
"il__pg_" . $this->request_data_collector->raw(
"pg");
1498 $this->createSuggestedSolutionLinkingTo(
'pg', $target);
1499 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"suggested_solution_added_successfully"),
true);
1500 $this->
ctrl->redirect($this,
'suggestedsolution');
1505 $target =
"il__st_" . $this->request_data_collector->raw(
"st");
1506 $this->createSuggestedSolutionLinkingTo(
'st', $target);
1507 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"suggested_solution_added_successfully"),
true);
1508 $this->
ctrl->redirect($this,
'suggestedsolution');
1513 $target =
"il__git_" . $this->request_data_collector->raw(
"git");
1514 $this->createSuggestedSolutionLinkingTo(
'git', $target);
1515 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"suggested_solution_added_successfully"),
true);
1516 $this->
ctrl->redirect($this,
'suggestedsolution');
1521 return in_array($this->
ctrl->getCmd(), self::QUESTION_SAVE_CMDS);
1525 string $guiClassName,
1526 string $cmdConstantNameBegin =
'CMD_'
1528 $reflectionClass = new ReflectionClass($guiClassName);
1532 if ($reflectionClass instanceof ReflectionClass) {
1535 foreach ($reflectionClass->getConstants() as $constName => $constValue) {
1536 if (substr($constName, 0, strlen($cmdConstantNameBegin)) == $cmdConstantNameBegin) {
1537 $commands[] = $constValue;
1547 $this->tabs_gui->clearTargets();
1549 if ($this->
object->getId() > 0) {
1550 $this->setDefaultTabs($this->tabs_gui);
1551 $this->setQuestionSpecificTabs($this->tabs_gui);
1552 $this->tabs_gui->activateTab(
'edit_question');
1554 $this->addBackTab($this->tabs_gui);
1559 $this->
ctrl->setParameterByClass(ilAssQuestionPageGUI::class,
'q_id', $this->
object->getId());
1560 $this->
ctrl->setParameterByClass(static::class,
'q_id', $this->
object->getId());
1562 $this->addTab_Question($tabs_gui);
1563 $this->addTab_QuestionFeedback($tabs_gui);
1564 $this->addTab_SuggestedSolution($tabs_gui, static::class);
1573 $this->
ctrl->setParameterByClass($classname,
'q_id', $this->
object->getId());
1575 'suggested_solution',
1576 $this->
ctrl->getLinkTargetByClass($classname,
'suggestedsolution'),
1578 'suggestedsolution',
1579 'saveSuggestedSolution',
1580 'outSolutionExplorer',
1582 'addSuggestedSolution',
1585 'removeSuggestedSolution'
1592 return array_merge($this->getBasicEditQuestionTabCommands(), $this->getAdditionalEditQuestionCommands());
1597 return [
'editQuestion',
'save',
'originalSyncForm'];
1607 $this->
ctrl->setParameterByClass(ilAssQuestionFeedbackEditingGUI::class,
'q_id', $this->
object->getId());
1611 $this->
lng->txt(
'tst_feedback'),
1612 $this->ctrl->getLinkTargetByClass(
1613 ilAssQuestionFeedbackEditingGUI::class,
1623 $this->
ctrl->getLinkTargetByClass(
1636 $reachedPoints = $this->
object->getAdjustedReachedPoints((
int) $activeId, (
int) $passIndex,
true);
1637 $maximumPoints = $this->
object->getMaximumPoints();
1639 return $reachedPoints == $maximumPoints;
1649 $this->
object->setTitle($this->request_data_collector->string(
'title'));
1650 $this->
object->setAuthor($this->request_data_collector->string(
'author'));
1651 $this->
object->setComment($this->request_data_collector->string(
'comment'));
1653 $nr_of_tries = $this->request_data_collector->int(
'nr_of_tries');
1654 if ($this->
object->getSelfAssessmentEditingMode()) {
1655 $this->
object->setNrOfTries($nr_of_tries);
1660 $this->request_data_collector->string(
'lifecycle')
1666 $this->
object->setQuestion(
1668 $this->request_data_collector->string(
'question')
1672 $this->setTestSpecificProperties();
1679 bool $is_question_postponed =
false,
1680 array|
bool $user_post_solutions =
false,
1681 bool $show_specific_inline_feedback =
false
1683 $formaction = $this->completeTestOutputFormAction($formaction, $active_id, $pass);
1685 $test_output = $this->getTestOutput(
1688 $is_question_postponed,
1689 $user_post_solutions,
1690 $show_specific_inline_feedback
1693 $this->magicAfterTestOutput();
1695 $this->tpl->setVariable(
"QUESTION_OUTPUT", $test_output);
1696 $this->tpl->setVariable(
"FORMACTION", $formaction);
1697 $this->tpl->setVariable(
"ENCTYPE",
'enctype="' . $this->getFormEncodingType() .
'"');
1698 $this->tpl->setVariable(
"FORM_TIMESTAMP", (
string) time());
1702 string $form_action,
1716 return self::FORM_ENCODING_URLENCODE;
1721 if ($this->
object->getId() <= 0) {
1723 $this->
lng->txt(
'cancel'),
1724 $this->ctrl->getParentReturnByClass(
1732 $this->
ctrl->setParameterByClass(
1733 ilAssQuestionPreviewGUI::class,
1737 $this->
ctrl->saveParameterByClass(ilAssQuestionPreviewGUI::class,
'prev_qid');
1739 $this->
lng->txt(
'backtocallingpage'),
1740 $this->ctrl->getLinkTargetByClass(
1741 ilAssQuestionPreviewGUI::class,
1745 $this->
ctrl->clearParameterByClass(ilAssQuestionPreviewGUI::class,
'prev_qid');
1750 $this->preview_session = $preview_session;
1758 return $this->preview_session;
1764 $form->setFormAction($this->
ctrl->getFormAction($this));
1765 $form->setId($this->getType());
1766 $form->setTitle($this->outQuestionType());
1767 $form->setTableWidth(
'100%');
1768 $form->setMultipart(
true);
1774 return str_replace([
'{',
'}'], [
'{',
'}'],
$text);
1779 $this->editQuestion(
true);
1780 return $this->editForm;
1785 return '<div id="focus"></div>';
1806 $table->setQuestionIndex($questionIndex);
1807 $table->setData($this->getAnswersFrequency($relevantAnswers, $questionIndex));
1808 $table->initColumns();
1827 switch ($correctness) {
1828 case self::CORRECTNESS_NOT_OK:
1829 $icon_name =
'standard/icon_not_ok.svg';
1830 $label = $this->
lng->txt(
"answer_is_wrong");
1832 case self::CORRECTNESS_MOSTLY_OK:
1833 $icon_name =
'standard/icon_mostly_ok.svg';
1834 $label = $this->
lng->txt(
"answer_is_not_correct_but_positive");
1836 case self::CORRECTNESS_OK:
1837 $icon_name =
'standard/icon_ok.svg';
1838 $label = $this->
lng->txt(
"answer_is_right");
1844 $icon = $this->
ui->factory()->symbol()->icon()->custom(
1848 return $this->
ui->renderer()->render($icon);
1860 ?
string $txt_output,
1861 bool $prepare_for_latex_output =
false,
1862 bool $omitNl2BrWhenTextArea =
false
1864 if ($txt_output === null || $txt_output ===
'') {
1868 $result = $txt_output;
1871 if (strlen(strip_tags($result)) < strlen($result)) {
1877 if (!$omitNl2BrWhenTextArea) {
1879 $result = preg_replace(
"/[\n]/",
"<br />", $result);
1883 if (preg_match_all(
"/(<pre>.*?<\/pre>)/ims", $result, $matches)) {
1884 foreach ($matches[0] as $found) {
1886 if (strpos(
"\n", $found) ===
false) {
1887 $replacement =
"\n";
1889 $removed = preg_replace(
"/<br\s*?\/>/ims", $replacement, $found);
1890 $result = str_replace($found, $removed, $result);
1895 if ($prepare_for_latex_output) {
1900 $result = str_replace(
"{",
"{", $result);
1901 $result = str_replace(
"}",
"}", $result);
1902 $result = str_replace(
"\\",
"\", $result);
1913 return $this->
ui->renderer()->render($this->
ui->factory()->legacy()->latexContent($content));
1919 if (is_null($this->suggestedsolution_repo)) {
1920 $dic = QuestionPoolDIC::dic();
1921 $this->suggestedsolution_repo =
$dic[
'question.repo.suggestedsolutions'];
1923 return $this->suggestedsolution_repo;
1932 if (!is_array($answer_text)) {
1947 self::ALLOWED_PLAIN_TEXT_TAGS
1953 return $this->parent_type_is_lm;
1957 $this->parent_type_is_lm = $flag;
1962 $this->tpl->addOnloadCode(
"
1963 let form = document.querySelector('#ilContentContainer form');
1964 let button = form.querySelector('input[name=\"cmd[save]\"]');
1965 if (form && button) {
1966 form.addEventListener('keydown', function (e) {
1967 if (e.key === 'Enter'
1968 && e.target.type !== 'textarea'
1969 && e.target.type !== 'submit'
1970 && e.target.type !== 'file'
1973 form.requestSubmit(button);
1982 return in_array($cmd, static::ADDITIONAL_CMDS_NEEDING_EXISTING_QST);
1987 $this->context_allows_sync_to_pool = $sync_allowed;
1992 return $this->context_allows_sync_to_pool
1993 && $this->
object->hasWritableOriginalInQuestionPool();
1998 if ($cmd_class ===
'') {
1999 $cmd_class = static::class;
2001 $modal = $this->
ui->factory()->modal()->interruptive(
2002 $this->
lng->txt(
'confirm'),
2003 $this->lng->txt(
'confirm_sync_questions'),
2004 $this->ctrl->getFormActionByClass($cmd_class, $cmd)
2005 )->withAffectedItems([
2006 $this->
ui->factory()->modal()->interruptiveItem()->standard(
2007 (
string) $this->object->getOriginalId(),
2008 $this->object->getTitleForHTMLOutput()
2010 ])->withActionButtonLabel($this->
lng->txt(
'sync_question_to_pool'));
2011 return $this->
ui->renderer()->render(
2012 $modal->withOnLoad($modal->getShowSignal())
2019 bool $graphical_output =
false,
2020 bool $result_output =
false,
2021 bool $show_question_only =
true,
2022 bool $show_feedback =
false,
2023 bool $show_correct_solution =
false,
2024 bool $show_manual_scoring =
false,
2025 bool $show_question_text =
true,
2026 bool $show_autosave_title =
false,
2027 bool $show_inline_feedback =
false
2029 $autosave_solutions = $this->
object->getSolutionValues($active_id, $pass, false);
2030 if ($autosave_solutions === []) {
2033 return $this->renderSolutionOutput(
2034 $autosave_solutions,
2039 $show_question_only,
2041 $show_correct_solution,
2042 $show_manual_scoring,
2043 $show_question_text,
2044 $show_autosave_title,
2045 $show_inline_feedback
2051 if (strtolower($this->request_data_collector->string(
'cmdClass')) ===
'ilassquestionpreviewgui') {
2052 return $this->
ctrl->getLinkTargetByClass(ilObjQuestionPoolGUI::class,
'downloadFile');
2054 return $this->
ctrl->getLinkTargetByClass(ilObjTestGUI::class,
'downloadFile');
2060 $this->current_user->getId(),
2061 $this->object->getId()
2063 $this->preview_session->setRandomizerSeed(
null);
2064 $this->preview_session->setParticipantsSolution(
null);
2065 $this->preview_session->setInstantResponseActive(
false);
Provides fluid interface to RBAC services.
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...
addTab(string $a_id, string $a_text, string $a_link, string $a_frame="")
Add a Tab.
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'))