50 $this->
object->loadFromDb(
$id);
59 return $this->
object->feedbackOBJ->isSpecificAnswerFeedbackAvailable($this->
object->getId());
67 $hasErrors = (!$always) ? $this->
editQuestion(
true) :
false;
71 $form->setValuesByPost();
90 if ($this->
object->getSelfAssessmentEditingMode()) {
91 return $this->
object->isSingleline();
95 return $this->request_data_collector->int(
'types') === 0;
98 if (empty($this->
object->getLastChange())
99 && !$this->request_data_collector->isset(
'types')) {
101 return $this->
object->getMultilineAnswerSetting() === 0;
104 return $this->
object->isSingleline();
108 bool $checkonly =
false,
109 ?
bool $is_save_cmd =
null 117 if ($is_singleline) {
118 $form->setMultipart(
true);
120 $form->setMultipart(
false);
126 $form->getItemByPostVar(
'selection_limit')->setMaxValue(count($this->request_data_collector->raw(
'choice')[
'answer'] ?? []));
128 $form->setValuesByPost();
129 $errors = !$this->checkMaxPointsNotNegative($form) || !$form->checkInput();
148 $answers = $choice->getValues();
149 $total_max_points = 0;
151 foreach ($answers as $answer) {
152 $total_max_points += max($answer->getPointsChecked(), $answer->getPointsUnchecked());
155 if ($total_max_points < 0) {
156 $choice->setAlert($this->
lng->txt(
'total_max_points_cannot_be_negative'));
165 parent::addBasicQuestionFormProperties($form);
180 $this->
object->removeAnswerImage($this->request_data_collector->getCmdIndex(
'removeimagechoice'));
187 $position = $this->request_data_collector->getCmdIndex(
'addchoice');
188 $this->
object->addAnswer(
"", 0, $position + 1);
195 $this->
object->deleteAnswer($this->request_data_collector->getCmdIndex(
'removechoice'));
202 bool $graphical_output =
false,
203 bool $result_output =
false,
204 bool $show_question_only =
true,
205 bool $show_feedback =
false,
206 bool $show_correct_solution =
false,
207 bool $show_manual_scoring =
false,
208 bool $show_question_text =
true,
209 bool $show_inline_feedback =
true 211 if ($active_id > 0 && !$show_correct_solution) {
212 $user_solution = $this->
object->getSolutionValues($active_id, $pass);
215 foreach ($this->
object->answers as $index => $answer) {
216 $points_checked = $answer->getPointsChecked();
217 $points_unchecked = $answer->getPointsUnchecked();
218 if ($points_checked > $points_unchecked && $points_checked > 0) {
219 $user_solution[] = [
'value1' => $index];
232 $show_correct_solution,
233 $show_manual_scoring,
236 $show_inline_feedback,
241 mixed $user_solutions,
244 bool $graphical_output =
false,
245 bool $result_output =
false,
246 bool $show_question_only =
true,
247 bool $show_feedback =
false,
248 bool $show_correct_solution =
false,
249 bool $show_manual_scoring =
false,
250 bool $show_question_text =
true,
251 bool $show_autosave_title =
false,
252 bool $show_inline_feedback =
false,
256 foreach ($user_solutions as $idx => $solution_value) {
257 array_push($user_solution, $solution_value[
"value1"]);
260 $template =
new ilTemplate(
"tpl.il_as_qpl_mc_mr_output_solution.html",
true,
true,
"components/ILIAS/TestQuestionPool");
261 $solutiontemplate =
new ilTemplate(
"tpl.il_as_tst_solution_output.html",
true,
true,
"components/ILIAS/TestQuestionPool");
263 foreach ($keys as $answer_id) {
264 $answer = $this->
object->answers[$answer_id];
265 if (($active_id > 0) && (!$show_correct_solution)) {
266 if ($graphical_output) {
270 foreach ($user_solution as $mc_solution) {
271 if ((
string) $mc_solution === (
string) $answer_id) {
276 if ($answer->getPointsChecked() > $answer->getPointsUnchecked()) {
277 $ok = self::CORRECTNESS_OK;
279 $ok = self::CORRECTNESS_NOT_OK;
282 if ($answer->getPointsChecked() > $answer->getPointsUnchecked()) {
283 $ok = self::CORRECTNESS_NOT_OK;
285 $ok = self::CORRECTNESS_OK;
289 $template->setCurrentBlock(
"icon_ok");
290 $template->setVariable(
"ICON_OK", $icon);
291 $template->parseCurrentBlock();
294 if ($answer->hasImage()) {
295 $template->setCurrentBlock(
"answer_image");
296 if ($this->
object->getThumbSize()) {
297 $template->setVariable(
"ANSWER_IMAGE_URL", $this->
object->getImagePathWeb() . $this->
object->getThumbPrefix() . $answer->getImage());
299 $template->setVariable(
"ANSWER_IMAGE_URL", $this->
object->getImagePathWeb() . $answer->getImage());
301 $alt = $answer->getImage();
302 if (strlen($answer->getAnswertext())) {
303 $alt = $answer->getAnswertext();
305 $alt = preg_replace(
"/<[^>]*?>/",
"", $alt);
308 $template->parseCurrentBlock();
313 if ($this->
object->getSpecificFeedbackSetting() == 2) {
314 foreach ($user_solution as $mc_solution) {
315 if ((
string) $mc_solution === (string) $answer_id) {
316 $fb = $this->
object->feedbackOBJ->getSpecificAnswerFeedbackTestPresentation(
322 $template->setCurrentBlock(
"feedback");
323 $template->setVariable(
"FEEDBACK", $this->
renderLatex(
326 $template->parseCurrentBlock();
332 if ($this->
object->getSpecificFeedbackSetting() == 1) {
333 $fb = $this->
object->feedbackOBJ->getSpecificAnswerFeedbackTestPresentation(
339 $template->setCurrentBlock(
"feedback");
340 $template->setVariable(
"FEEDBACK", $this->
renderLatex(
343 $template->parseCurrentBlock();
347 if ($show_feedback) {
348 if ($this->
object->getSpecificFeedbackSetting() == 3) {
349 $answer = $this->
object->getAnswer($answer_id);
351 if ($answer->getPoints() > 0) {
352 $fb = $this->
object->feedbackOBJ->getSpecificAnswerFeedbackTestPresentation(
358 $template->setCurrentBlock(
"feedback");
359 $template->setVariable(
"FEEDBACK", $this->
renderLatex(
362 $template->parseCurrentBlock();
370 $template->setCurrentBlock(
"answer_row");
371 $template->setVariable(
"ANSWER_TEXT", $this->
renderLatex(
375 if ($result_output) {
376 $pointschecked = $this->
object->answers[$answer_id]->getPointsChecked();
377 $pointsunchecked = $this->
object->answers[$answer_id]->getPointsUnchecked();
378 $resulttextchecked = ($pointschecked == 1) || ($pointschecked == -1) ?
"%s " . $this->
lng->txt(
"point") :
"%s " . $this->
lng->txt(
"points");
379 $resulttextunchecked = ($pointsunchecked == 1) || ($pointsunchecked == -1) ?
"%s " . $this->
lng->txt(
"point") :
"%s " . $this->
lng->txt(
"points");
380 $template->setVariable(
"RESULT_OUTPUT", sprintf(
"(" . $this->
lng->txt(
"checkbox_checked") .
" = $resulttextchecked, " . $this->
lng->txt(
"checkbox_unchecked") .
" = $resulttextunchecked)", $pointschecked, $pointsunchecked));
382 foreach ($user_solution as $mc_solution) {
383 if ((
string) $mc_solution === (string) $answer_id) {
386 $template->setVariable(
"SOLUTION_ALT", $this->
lng->txt(
"checked"));
388 $template->setVariable(
'QID', $this->
object->getId());
389 $template->setVariable(
'SUFFIX', $show_correct_solution ?
'bestsolution' :
'usersolution');
390 $template->setVariable(
'SOLUTION_VALUE', $answer_id);
391 $template->setVariable(
'SOLUTION_CHECKED',
'checked');
399 $template->setVariable(
"SOLUTION_ALT", $this->
lng->txt(
"unchecked"));
401 $template->setVariable(
'QID', $this->
object->getId());
402 $template->setVariable(
'SUFFIX', $show_correct_solution ?
'bestsolution' :
'usersolution');
403 $template->setVariable(
'SOLUTION_VALUE', $answer_id);
406 $template->parseCurrentBlock();
408 $questiontext = $this->
object->getQuestionForHTMLOutput();
412 if ($show_question_text ==
true) {
413 $template->setVariable(
"QUESTIONTEXT", $this->
renderLatex(
417 $questionoutput = $template->get();
420 if (strlen($feedback)) {
426 $solutiontemplate->setVariable(
"ILC_FB_CSS_CLASS", $cssClass);
427 $solutiontemplate->setVariable(
"FEEDBACK", $this->
renderLatex(
431 $solutiontemplate->setVariable(
"SOLUTION_OUTPUT", $questionoutput);
433 $solutionoutput = $solutiontemplate->get();
435 if (!$show_question_only) {
439 return $solutionoutput;
443 bool $show_question_only =
false,
444 bool $show_inline_feedback =
false 450 $this->tpl->addOnLoadCode(
'ilAssMultipleChoiceCharCounterInit();');
451 $template =
new ilTemplate(
"tpl.il_as_qpl_mc_mr_output.html",
true,
true,
"components/ILIAS/TestQuestionPool");
452 foreach ($keys as $answer_id) {
453 $answer = $this->
object->answers[$answer_id];
454 if ($answer->hasImage()) {
455 if ($this->
object->getThumbSize()) {
456 $template->setCurrentBlock(
"preview");
457 $template->setVariable(
"URL_PREVIEW", $this->
object->getImagePathWeb() . $answer->getImage());
458 $template->setVariable(
"TEXT_PREVIEW", $this->
lng->txt(
'preview'));
460 $template->setVariable(
"ANSWER_IMAGE_URL", $this->
object->getImagePathWeb() . $this->
object->getThumbPrefix() . $answer->getImage());
461 list($width, $height, $type, $attr) = getimagesize($this->
object->getImagePath() . $answer->getImage());
462 $alt = $answer->getImage();
463 if (strlen($answer->getAnswertext())) {
464 $alt = $answer->getAnswertext();
466 $alt = preg_replace(
"/<[^>]*?>/",
"", $alt);
469 $template->parseCurrentBlock();
471 $template->setCurrentBlock(
"answer_image");
472 $template->setVariable(
"ANSWER_IMAGE_URL", $this->
object->getImagePathWeb() . $answer->getImage());
473 list($width, $height, $type, $attr) = getimagesize($this->
object->getImagePath() . $answer->getImage());
474 $alt = $answer->getImage();
475 if (strlen($answer->getAnswertext())) {
476 $alt = $answer->getAnswertext();
478 $alt = preg_replace(
"/<[^>]*?>/",
"", $alt);
479 $template->setVariable(
"ATTR", $attr);
482 $template->parseCurrentBlock();
486 if ($show_inline_feedback) {
490 $template->setCurrentBlock(
"answer_row");
491 $template->setVariable(
"QID", $this->
object->getId());
492 $template->setVariable(
"ANSWER_ID", $answer_id);
493 $template->setVariable(
"ANSWER_TEXT", $this->
renderLatex(
496 foreach ($user_solution as $mc_solution) {
497 if ((
string) $mc_solution === (string) $answer_id) {
498 $template->setVariable(
"CHECKED_ANSWER",
" checked=\"checked\"");
501 $template->parseCurrentBlock();
503 if ($this->
object->getSelectionLimit()) {
504 $template->setVariable(
'SELECTION_LIMIT_HINT', sprintf(
505 $this->
lng->txt(
'ass_mc_sel_lim_hint'),
506 $this->
object->getSelectionLimit(),
507 $this->
object->getAnswerCount()
510 $template->setVariable(
'SELECTION_LIMIT_VALUE', $this->
object->getSelectionLimit());
512 $template->setVariable(
'SELECTION_LIMIT_VALUE',
'null');
514 $template->setVariable(
"QUESTION_ID", $this->
object->getId());
515 $questiontext = $this->
object->getQuestionForHTMLOutput();
519 $template->setVariable(
"QUESTIONTEXT", $this->
renderLatex(
522 $questionoutput = $template->get();
523 if (!$show_question_only) {
527 return $questionoutput;
533 bool $is_question_postponed =
false,
534 array|
bool $user_post_solutions =
false,
535 bool $show_specific_inline_feedback =
false 543 $solutions = $this->
object->getTestOutputSolutions($active_id, $pass);
545 foreach ($solutions as $solution_value) {
547 if ($solution_value[
"value1"] ==
'mc_none_above') {
552 $user_solution[] = $solution_value[
"value1"];
556 if (empty($user_solution) && $this->
object->getTestPresentationConfig()->isWorkedThrough()) {
561 $this->tpl->addJavaScript(
'assets/js/ilAssMultipleChoice.js');
562 $this->tpl->addOnLoadCode(
'ilAssMultipleChoiceCharCounterInit();');
564 $template =
new ilTemplate(
"tpl.il_as_qpl_mc_mr_output.html",
true,
true,
"components/ILIAS/TestQuestionPool");
565 foreach ($keys as $answer_id) {
566 $answer = $this->
object->answers[$answer_id];
567 if ($answer->hasImage()) {
568 if ($this->
object->getThumbSize()) {
569 $template->setCurrentBlock(
"preview");
570 $template->setVariable(
"URL_PREVIEW", $this->
object->getImagePathWeb() . $answer->getImage());
571 $template->setVariable(
"TEXT_PREVIEW", $this->
lng->txt(
'preview'));
573 $template->setVariable(
"ANSWER_IMAGE_URL", $this->
object->getImagePathWeb() . $this->
object->getThumbPrefix() . $answer->getImage());
574 list($width, $height, $type, $attr) = getimagesize($this->
object->getImagePath() . $answer->getImage());
575 $alt = $answer->getImage();
576 if (strlen($answer->getAnswertext())) {
577 $alt = $answer->getAnswertext();
579 $alt = preg_replace(
"/<[^>]*?>/",
"", $alt);
582 $template->parseCurrentBlock();
584 $template->setCurrentBlock(
"answer_image");
585 $template->setVariable(
"ANSWER_IMAGE_URL", $this->
object->getImagePathWeb() . $answer->getImage());
586 list($width, $height, $type, $attr) = getimagesize($this->
object->getImagePath() . $answer->getImage());
587 $alt = $answer->getImage();
588 if (strlen($answer->getAnswertext())) {
589 $alt = $answer->getAnswertext();
591 $alt = preg_replace(
"/<[^>]*?>/",
"", $alt);
592 $template->setVariable(
"ATTR", $attr);
595 $template->parseCurrentBlock();
599 if ($show_specific_inline_feedback) {
603 $template->setCurrentBlock(
"answer_row");
604 $template->setVariable(
"QID", $this->
object->getId());
605 $template->setVariable(
"ANSWER_ID", $answer_id);
606 $template->setVariable(
"ANSWER_TEXT", $this->
renderLatex(
609 foreach ($user_solution as $mc_solution) {
610 if ((
string) $mc_solution === (string) $answer_id) {
611 $template->setVariable(
"CHECKED_ANSWER",
" checked=\"checked\"");
614 $template->parseCurrentBlock();
617 $template->setVariable(
"QUESTIONTEXT", $this->
renderLatex($this->
object->getQuestionForHTMLOutput()));
618 $template->setVariable(
"QUESTION_ID", $this->
object->getId());
619 if ($this->
object->getSelectionLimit()) {
620 $template->setVariable(
'SELECTION_LIMIT_HINT', sprintf(
621 $this->
lng->txt(
'ass_mc_sel_lim_hint'),
622 $this->
object->getSelectionLimit(),
623 $this->
object->getAnswerCount()
626 $template->setVariable(
'SELECTION_LIMIT_VALUE', $this->
object->getSelectionLimit());
628 $template->setVariable(
'SELECTION_LIMIT_VALUE',
'null');
630 $questionoutput = $template->get();
631 $pageoutput = $this->
outQuestionPage(
"", $is_question_postponed, $active_id, $questionoutput, $show_specific_inline_feedback);
650 $this->tpl->addJavaScript(
'assets/js/ilAssMultipleChoice.js');
652 $tpl =
new ilTemplate(
'tpl.tst_question_additional_behaviour_checkbox.html',
true,
true,
'components/ILIAS/TestQuestionPool');
664 $tpl->
setVariable(
'TXT_FORCE_FORM_DIFF_LABEL', $this->
object->getTestPresentationConfig()->getUseUnchangedAnswerLabel());
672 return [
'assets/js/ilAssMultipleChoice.js'];
682 $choice_keys = array_keys($this->
object->answers);
684 if ($this->
object->getShuffle()) {
685 $choice_keys = $this->
object->getShuffler()->transform($choice_keys);
700 $this->
object->setShuffle($this->request_data_collector->bool(
'shuffle') ??
false);
703 $this->
object->setSelectionLimit($selectionLimit > 0 ? $selectionLimit :
null);
705 $feedback_setting = $this->request_data_collector->int(
'feedback_setting');
706 if ($feedback_setting !== 0) {
707 $this->
object->setSpecificFeedbackSetting($feedback_setting);
710 $types = $this->request_data_collector->int(
'types');
711 $this->
object->setMultilineAnswerSetting($types);
713 $choice = $this->request_data_collector->raw(
'choice');
714 if (isset($choice[
'imagename']) && is_array($choice[
'imagename']) && $types === 1) {
715 $this->
object->setIsSingleline(
true);
716 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
'info_answer_type_change'),
true);
718 $this->
object->setIsSingleline($types === 0);
721 $thumb_size = $this->request_data_collector->int(
'thumb_size') ?? $this->
object->getThumbSize();
722 if ($thumb_size !== $this->
object->getThumbSize()) {
723 $this->
object->setThumbSize($thumb_size);
724 $this->rebuild_thumbnails =
true;
731 $this->
object->flushAnswers();
734 $this->request_data_collector->raw(
'choice'),
735 !$this->
object->isSingleline()
738 if (!$this->
object->isSingleline()) {
739 foreach ($choice[
'answer'] as $index => $answer) {
740 $answertext = $answer;
741 $this->
object->addAnswer(
743 (
float) str_replace(
',',
'.', $choice[
'points'][$index]),
744 (
float) str_replace(
',',
'.', $choice[
'points_unchecked'][$index]),
747 (
int) $choice[
'answer_id'][$index]
753 foreach ($choice[
'answer'] as $index => $answertext) {
754 $answertext = htmlentities($answertext);
755 $picturefile = $choice[
'imagename'][$index] ??
null;
756 $file_org_name = $_FILES[
'choice'][
'name'][
'image'][$index] ??
'';
757 $file_temp_name = $_FILES[
'choice'][
'tmp_name'][
'image'][$index] ??
'';
759 if ($file_temp_name !==
'') {
761 $parts = explode(
'.', $file_org_name);
762 $suffix = strtolower(array_pop(
$parts));
763 if (in_array($suffix, [
'jpg',
'jpeg',
'png',
'gif'])) {
765 $filename = $this->
object->buildHashedImageFilename($file_org_name);
772 $this->
object->addAnswer(
774 (
float) str_replace(
',',
'.', $choice[
'points'][$index]),
775 (
float) str_replace(
',',
'.', $choice[
'points_unchecked'][$index]),
778 $choice[
'answer_id'][$index]
782 if ($this->rebuild_thumbnails) {
783 $this->
object->setAnswers(
784 $this->
object->rebuildThumbnails(
785 $this->object->isSingleline(),
786 $this->
object->getThumbSize(),
787 $this->
object->getImagePath(),
788 $this->
object->getAnswers()
798 $shuffle->setValue(1);
799 $shuffle->setChecked($this->
object->getShuffle());
800 $shuffle->setRequired(
false);
803 $selLim =
new ilNumberInputGUI($this->
lng->txt(
'ass_mc_sel_lim_setting'),
'selection_limit');
804 $selLim->
setInfo($this->
lng->txt(
'ass_mc_sel_lim_setting_desc'));
806 $selLim->setRequired(
false);
807 $selLim->allowDecimals(
false);
808 $selLim->setMinvalueShouldBeGreater(
false);
809 $selLim->setMaxvalueShouldBeLess(
false);
810 $selLim->setMinValue(1);
811 $selLim->setMaxValue($this->
object->getAnswerCount());
812 $selLim->setValue($this->
object->getSelectionLimit());
815 if (!$this->
object->getSelfAssessmentEditingMode()) {
820 0 => $this->
lng->txt(
'answers_singleline'),
821 1 => $this->
lng->txt(
'answers_multiline'),
823 $types->setValue($is_singleline ? 0 : 1);
827 if ($is_singleline) {
830 $thumb_size->
setSuffix($this->
lng->txt(
'thumb_size_unit_pixel'));
831 $thumb_size->setMinValue($this->
object->getMinimumThumbSize());
832 $thumb_size->setMaxValue($this->
object->getMaximumThumbSize());
833 $thumb_size->setDecimals(0);
834 $thumb_size->setSize(6);
835 $thumb_size->setInfo($this->
lng->txt(
'thumb_size_info'));
836 $thumb_size->setValue($this->
object->getThumbSize());
837 $thumb_size->setRequired(
true);
840 $thumb_size->setValue($this->
object->getThumbSize());
851 $choices->setQuestionObject($this->
object);
852 $choices->setSingleline($is_singleline);
853 $choices->setAllowMove(
false);
854 if ($this->
object->getSelfAssessmentEditingMode()) {
855 $choices->setSize(40);
857 if ($this->
object->getAnswerCount() == 0) {
858 $this->
object->addAnswer(
"", 0, 0, 0);
862 $value->setAnswerText(html_entity_decode($value->getAnswerText()));
865 $this->
object->getAnswers()
867 $choices->setInfo($this->
lng->txt(
'latex_edit_info'));
900 private function aggregateAnswers($relevant_answers_chosen, $answers_defined_on_question): array
903 foreach ($answers_defined_on_question as $answer) {
904 $aggregated_info_for_answer = [];
905 $aggregated_info_for_answer[
'answertext'] = $answer->getAnswerText();
906 $aggregated_info_for_answer[
'count_checked'] = 0;
908 foreach ($relevant_answers_chosen as $relevant_answer) {
909 if ($relevant_answer[
'value1'] == $answer->getOrder()) {
910 $aggregated_info_for_answer[
'count_checked']++;
913 $aggregated_info_for_answer[
'count_unchecked'] =
914 ceil(count($relevant_answers_chosen) / count($answers_defined_on_question))
915 - $aggregated_info_for_answer[
'count_checked'];
917 $aggregate[] = $aggregated_info_for_answer;
924 if ($this->
object->getSpecificFeedbackSetting() == 2) {
925 foreach ($user_solution as $mc_solution) {
926 if ((
string) $mc_solution === (string) $answer_id) {
927 $fb = $this->
object->feedbackOBJ->getSpecificAnswerFeedbackTestPresentation($this->
object->getId(), 0, $answer_id);
929 $template->setCurrentBlock(
"feedback");
930 $template->setVariable(
"FEEDBACK", $this->
renderLatex(
933 $template->parseCurrentBlock();
939 if ($this->
object->getSpecificFeedbackSetting() == 1) {
940 $fb = $this->
object->feedbackOBJ->getSpecificAnswerFeedbackTestPresentation($this->
object->getId(), 0, $answer_id);
942 $template->setCurrentBlock(
"feedback");
943 $template->setVariable(
"FEEDBACK", $this->
renderLatex(
946 $template->parseCurrentBlock();
950 if ($this->
object->getSpecificFeedbackSetting() == 3) {
951 $answer = $this->
object->getAnswer($answer_id);
953 if ($answer->getPoints() > 0) {
954 $fb = $this->
object->feedbackOBJ->getSpecificAnswerFeedbackTestPresentation($this->
object->getId(), 0, $answer_id);
956 $template->setCurrentBlock(
"feedback");
957 $template->setVariable(
"FEEDBACK", $this->
renderLatex(
960 $template->parseCurrentBlock();
979 $form->
setId(
"assmultiplechoice");
995 foreach ($agg as $ans) {
997 'answer' => $ans[
'answertext'],
998 'frequency' => $ans[
'count_checked']
1009 $choices->setQuestionObject($this->
object);
1010 $choices->setValues($this->
object->getAnswers());
1020 $answerElements = $input->getValues();
1022 foreach ($this->
object->getAnswers() as $index => $answer) {
1024 $answer->setPointsChecked((
float) str_replace(
',',
'.', $answerElements[$index]->getPointsChecked()));
1025 $answer->setPointsUnchecked((
float) str_replace(
',',
'.', $answerElements[$index]->getPointsUnchecked()));
isTestPresentationContext()
setAdditionalContentEditingModeFromPost()
hasCorrectSolution($activeId, $passIndex)
generateCorrectnessIconsForCorrectness(int $correctness)
setCurrentBlock(string $blockname=self::DEFAULT_BLOCK)
Sets the template to the given block.
getAnswersFrequency($relevantAnswers, $questionIndex)
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
setUseEmptySolutionInputChecked($useEmptySolutionInputChecked)
renderLatex($content)
Wrap content with latex in a LatexContent UI component and render it to be processed by MathJax in th...
getAfterParticipationSuppressionAnswerPostVars()
Returns a list of postvars which will be suppressed in the form output when used in scoring adjustmen...
getChoiceKeys()
Create the key index numbers for the array of choices.
ASS_AnswerBinaryStateImage is a class for answers with a binary state indicator (checked/unchecked, set/unset) and an image file.
populateQuestionSpecificFormPart(\ilPropertyFormGUI $form, bool $is_singleline=false)
populateAnswerSpecificFormPart(\ilPropertyFormGUI $form, bool $is_singleline=false)
parseCurrentBlock(string $blockname=self::DEFAULT_BLOCK)
Parses the given block.
saveCorrectionsFormProperties(ilPropertyFormGUI $form)
const CSS_CLASS_FEEDBACK_CORRECT
ilGlobalPageTemplate $tpl
Class for multiple choice tests.
populateTaxonomyFormSection(ilPropertyFormGUI $form)
addQuestionFormCommandButtons(ilPropertyFormGUI $form)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
populateCorrectionsFormProperties(ilPropertyFormGUI $form)
writeQuestionGenericPostData()
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
getUseUnchangedAnswerCheckboxHtml()
writeAnswerSpecificPostData(ilPropertyFormGUI $form)
Extracts the answer specific values from the request and applies them to the data object...
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 getHtmlPath(string $relative_path)
get url of path
writeQuestionSpecificPostData(ilPropertyFormGUI $form)
Extracts the question specific values from the request and applies them to the data object...
const CSS_CLASS_FEEDBACK_WRONG
getEditAnswersSingleLine(bool $checkonly=false)
Get the single/multiline editing of answers.
aggregateAnswers($relevant_answers_chosen, $answers_defined_on_question)
editQuestion(bool $checkonly=false, ?bool $is_save_cmd=null)
getPresentationJavascripts()
getAfterParticipationSuppressionQuestionPostVars()
Returns a list of postvars which will be suppressed in the form output when used in scoring adjustmen...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
isUseEmptySolutionInputChecked()
touchBlock(string $blockname)
overwrites ITX::touchBlock.
__construct($id=-1)
assMultipleChoiceGUI constructor
saveTaxonomyAssignments()
writePostData(bool $always=false)
{}
$useEmptySolutionInputChecked
getILIASPage(string $html="")
Returns the ILIAS Page around a question.
outQuestionPage($a_temp_var, $a_postponed=false, $active_id="", $html="", $inlineFeedbackEnabled=false)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
__construct(Container $dic, ilPlugin $plugin)
cleanupAnswerText(array $answer_text, bool $is_rte)
sk - 12.05.2023: This is one more of those that we need, but don't want.
isRenderPurposePrintPdf()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getPreview(bool $show_question_only=false, bool $show_inline_feedback=false)
buildEditForm(bool $is_singleline=true)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getTestOutput(int $active_id, int $pass, bool $is_question_postponed=false, array|bool $user_post_solutions=false, bool $show_specific_inline_feedback=false)
getSpecificFeedbackOutput(array $userSolution)
populateSpecificFeedbackInline($user_solution, $answer_id, $template)
setVariable(string $variable, $value='')
Sets the given variable to the given value.
addBasicQuestionFormProperties(ilPropertyFormGUI $form)
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,)
renderEditForm(ilPropertyFormGUI $form)
renderPurposeSupportsFormHtml()
getGenericFeedbackOutput(int $active_id, ?int $pass)
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)