19 require_once
'./Modules/Test/classes/inc.AssessmentConstants.php';
50 include_once
"./Modules/TestQuestionPool/classes/class.assMultipleChoice.php";
53 $this->
object->loadFromDb(
$id);
62 return $this->
object->feedbackOBJ->isSpecificAnswerFeedbackAvailable($this->
object->getId());
70 $hasErrors = (!$always) ? $this->
editQuestion(
true) :
false;
74 $form->setValuesByPost();
75 require_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
94 if ($this->
object->getSelfAssessmentEditingMode()) {
95 return $this->
object->isSingleline();
99 $types = $_POST[
'types'] ??
'0';
100 return $types ===
'0' ? true :
false;
103 $lastChange = $this->
object->getLastChange();
104 if (empty($lastChange) && !isset($_POST[
'types'])) {
106 return $this->
object->getMultilineAnswerSetting() ? false :
true;
109 return $this->
object->isSingleline();
129 if ($is_singleline) {
130 $form->setMultipart(
true);
132 $form->setMultipart(
false);
138 $form->getItemByPostVar(
'selection_limit')->setMaxValue(count((array) $_POST[
'choice'][
'answer']));
140 $form->setValuesByPost();
141 $errors = !$form->checkInput();
148 $this->tpl->setVariable(
"QUESTION_DATA", $form->getHTML());
155 parent::addBasicQuestionFormProperties($form);
174 $position = key($_POST[
'cmd'][
'removeimagechoice']);
175 $this->
object->removeAnswerImage($position);
185 $position = key($_POST[
'cmd'][
'addchoice']);
186 $this->
object->addAnswer(
"", 0, 0, $position + 1);
196 $position = key($_POST[
'cmd'][
'removechoice']);
197 $this->
object->deleteAnswer($position);
217 $graphicalOutput =
false,
218 $result_output =
false,
219 $show_question_only =
true,
220 $show_feedback =
false,
221 $show_correct_solution =
false,
222 $show_manual_scoring =
false,
223 $show_question_text =
true 229 $user_solution = array();
230 if (($active_id > 0) && (!$show_correct_solution)) {
231 $solutions = $this->
object->getSolutionValues($active_id, $pass);
232 foreach ($solutions as $idx => $solution_value) {
233 array_push($user_solution, $solution_value[
"value1"]);
238 $points_checked = $answer->getPointsChecked();
239 $points_unchecked = $answer->getPointsUnchecked();
240 if ($points_checked > $points_unchecked) {
241 if ($points_checked > 0) {
242 array_push($user_solution,
$index);
249 include_once
"./Services/UICore/classes/class.ilTemplate.php";
250 $template =
new ilTemplate(
"tpl.il_as_qpl_mc_mr_output_solution.html",
true,
true,
"Modules/TestQuestionPool");
251 $solutiontemplate =
new ilTemplate(
"tpl.il_as_tst_solution_output.html",
true,
true,
"Modules/TestQuestionPool");
252 foreach (
$keys as $answer_id) {
253 $answer = $this->
object->answers[$answer_id];
254 if (($active_id > 0) && (!$show_correct_solution)) {
255 if ($graphicalOutput) {
259 foreach ($user_solution as $mc_solution) {
260 if (strcmp($mc_solution, $answer_id) == 0) {
265 if ($answer->getPointsChecked() > $answer->getPointsUnchecked()) {
266 $ok = self::CORRECTNESS_OK;
268 $ok = self::CORRECTNESS_NOT_OK;
271 if ($answer->getPointsChecked() > $answer->getPointsUnchecked()) {
272 $ok = self::CORRECTNESS_NOT_OK;
274 $ok = self::CORRECTNESS_OK;
278 $template->setCurrentBlock(
"icon_ok");
279 $template->setVariable(
"ICON_OK", $icon);
280 $template->parseCurrentBlock();
283 if (strlen($answer->getImage())) {
284 $template->setCurrentBlock(
"answer_image");
285 if ($this->
object->getThumbSize()) {
286 $template->setVariable(
"ANSWER_IMAGE_URL", $this->
object->getImagePathWeb() . $this->
object->getThumbPrefix() . $answer->getImage());
288 $template->setVariable(
"ANSWER_IMAGE_URL", $this->
object->getImagePathWeb() . $answer->getImage());
290 $alt = $answer->getImage();
291 if (strlen($answer->getAnswertext())) {
292 $alt = $answer->getAnswertext();
294 $alt = preg_replace(
"/<[^>]*?>/",
"", $alt);
297 $template->parseCurrentBlock();
300 if ($show_feedback) {
301 if ($this->
object->getSpecificFeedbackSetting() == 2) {
302 foreach ($user_solution as $mc_solution) {
303 if (strcmp($mc_solution, $answer_id) == 0) {
304 $fb = $this->
object->feedbackOBJ->getSpecificAnswerFeedbackTestPresentation(
310 $template->setCurrentBlock(
"feedback");
311 $template->setVariable(
"FEEDBACK", $this->
object->prepareTextareaOutput($fb,
true));
312 $template->parseCurrentBlock();
318 if ($this->
object->getSpecificFeedbackSetting() == 1) {
319 $fb = $this->
object->feedbackOBJ->getSpecificAnswerFeedbackTestPresentation(
325 $template->setCurrentBlock(
"feedback");
326 $template->setVariable(
"FEEDBACK", $this->
object->prepareTextareaOutput($fb,
true));
327 $template->parseCurrentBlock();
331 if ($this->
object->getSpecificFeedbackSetting() == 3) {
332 $answer = $this->
object->getAnswer($answer_id);
334 if ($answer->getPoints() > 0) {
335 $fb = $this->
object->feedbackOBJ->getSpecificAnswerFeedbackTestPresentation(
341 $template->setCurrentBlock(
"feedback");
342 $template->setVariable(
"FEEDBACK", $this->
object->prepareTextareaOutput($fb,
true));
343 $template->parseCurrentBlock();
348 $template->setCurrentBlock(
"answer_row");
349 $template->setVariable(
"ANSWER_TEXT", $this->
object->prepareTextareaOutput($answer->getAnswertext(),
true));
351 if ($result_output) {
352 $pointschecked = $this->
object->answers[$answer_id]->getPointsChecked();
353 $pointsunchecked = $this->
object->answers[$answer_id]->getPointsUnchecked();
354 $resulttextchecked = ($pointschecked == 1) || ($pointschecked == -1) ?
"%s " . $this->
lng->txt(
"point") :
"%s " . $this->
lng->txt(
"points");
355 $resulttextunchecked = ($pointsunchecked == 1) || ($pointsunchecked == -1) ?
"%s " . $this->
lng->txt(
"point") :
"%s " . $this->
lng->txt(
"points");
356 $template->setVariable(
"RESULT_OUTPUT", sprintf(
"(" . $this->
lng->txt(
"checkbox_checked") .
" = $resulttextchecked, " . $this->
lng->txt(
"checkbox_unchecked") .
" = $resulttextunchecked)", $pointschecked, $pointsunchecked));
358 foreach ($user_solution as $mc_solution) {
359 if (strcmp($mc_solution, $answer_id) == 0) {
362 $template->setVariable(
"SOLUTION_ALT", $this->
lng->txt(
"checked"));
364 $template->setVariable(
'QID', $this->
object->getId());
365 $template->setVariable(
'SUFFIX', $show_correct_solution ?
'bestsolution' :
'usersolution');
366 $template->setVariable(
'SOLUTION_VALUE', $answer_id);
367 $template->setVariable(
'SOLUTION_CHECKED',
'checked');
375 $template->setVariable(
"SOLUTION_ALT", $this->
lng->txt(
"unchecked"));
377 $template->setVariable(
'QID', $this->
object->getId());
378 $template->setVariable(
'SUFFIX', $show_correct_solution ?
'bestsolution' :
'usersolution');
379 $template->setVariable(
'SOLUTION_VALUE', $answer_id);
382 $template->parseCurrentBlock();
384 $questiontext = $this->
object->getQuestionForHTMLOutput();
388 if ($show_question_text ==
true) {
389 $template->setVariable(
"QUESTIONTEXT", $this->
object->prepareTextareaOutput($questiontext,
true));
391 $questionoutput = $template->get();
394 if (strlen($feedback)) {
400 $solutiontemplate->setVariable(
"ILC_FB_CSS_CLASS", $cssClass);
401 $solutiontemplate->setVariable(
"FEEDBACK", $this->
object->prepareTextareaOutput($feedback,
true));
403 $solutiontemplate->setVariable(
"SOLUTION_OUTPUT", $questionoutput);
405 $solutionoutput = $solutiontemplate->get();
407 if (!$show_question_only) {
411 return $solutionoutput;
414 public function getPreview($show_question_only =
false, $showInlineFeedback =
false): string
421 include_once
"./Services/UICore/classes/class.ilTemplate.php";
422 $this->tpl->addOnLoadCode(
'ilAssMultipleChoiceCharCounterInit();');
423 $template =
new ilTemplate(
"tpl.il_as_qpl_mc_mr_output.html",
true,
true,
"Modules/TestQuestionPool");
424 foreach (
$keys as $answer_id) {
425 $answer = $this->
object->answers[$answer_id];
426 if (strlen($answer->getImage())) {
427 if ($this->
object->getThumbSize()) {
428 $template->setCurrentBlock(
"preview");
429 $template->setVariable(
"URL_PREVIEW", $this->
object->getImagePathWeb() . $answer->getImage());
430 $template->setVariable(
"TEXT_PREVIEW", $this->
lng->txt(
'preview'));
432 $template->setVariable(
"ANSWER_IMAGE_URL", $this->
object->getImagePathWeb() . $this->
object->getThumbPrefix() . $answer->getImage());
433 list($width, $height,
$type, $attr) = getimagesize($this->
object->getImagePath() . $answer->getImage());
434 $alt = $answer->getImage();
435 if (strlen($answer->getAnswertext())) {
436 $alt = $answer->getAnswertext();
438 $alt = preg_replace(
"/<[^>]*?>/",
"", $alt);
441 $template->parseCurrentBlock();
443 $template->setCurrentBlock(
"answer_image");
444 $template->setVariable(
"ANSWER_IMAGE_URL", $this->
object->getImagePathWeb() . $answer->getImage());
445 list($width, $height,
$type, $attr) = getimagesize($this->
object->getImagePath() . $answer->getImage());
446 $alt = $answer->getImage();
447 if (strlen($answer->getAnswertext())) {
448 $alt = $answer->getAnswertext();
450 $alt = preg_replace(
"/<[^>]*?>/",
"", $alt);
451 $template->setVariable(
"ATTR", $attr);
454 $template->parseCurrentBlock();
458 if ($showInlineFeedback) {
462 $template->setCurrentBlock(
"answer_row");
463 $template->setVariable(
"QID", $this->
object->getId());
464 $template->setVariable(
"ANSWER_ID", $answer_id);
465 $template->setVariable(
"ANSWER_TEXT", $this->
object->prepareTextareaOutput($answer->getAnswertext(),
true));
466 foreach ($user_solution as $mc_solution) {
467 if (strcmp($mc_solution, $answer_id) == 0) {
468 $template->setVariable(
"CHECKED_ANSWER",
" checked=\"checked\"");
471 $template->parseCurrentBlock();
473 if ($this->
object->getSelectionLimit()) {
474 $template->setVariable(
'SELECTION_LIMIT_HINT', sprintf(
475 $this->
lng->txt(
'ass_mc_sel_lim_hint'),
476 $this->
object->getSelectionLimit(),
477 $this->
object->getAnswerCount()
480 $template->setVariable(
'SELECTION_LIMIT_VALUE', $this->
object->getSelectionLimit());
482 $template->setVariable(
'SELECTION_LIMIT_VALUE',
'null');
484 $template->setVariable(
"QUESTION_ID", $this->
object->getId());
485 $questiontext = $this->
object->getQuestionForHTMLOutput();
489 $template->setVariable(
"QUESTIONTEXT", $this->
object->prepareTextareaOutput($questiontext,
true));
490 $questionoutput = $template->get();
491 if (!$show_question_only) {
495 return $questionoutput;
512 $is_postponed =
false,
513 $use_post_solutions =
false,
514 $show_feedback =
false 520 $user_solution = array();
522 $solutions = $this->
object->getTestOutputSolutions($active_id, $pass);
524 foreach ($solutions as $idx => $solution_value) {
526 if ($solution_value[
"value1"] ==
'mc_none_above') {
531 $user_solution[] = $solution_value[
"value1"];
535 if (empty($user_solution) && $this->
object->getTestPresentationConfig()->isWorkedThrough()) {
540 $this->tpl->addJavaScript(
'Modules/TestQuestionPool/js/ilAssMultipleChoice.js');
541 $this->tpl->addOnLoadCode(
'ilAssMultipleChoiceCharCounterInit();');
542 include_once
"./Services/UICore/classes/class.ilTemplate.php";
543 $template =
new ilTemplate(
"tpl.il_as_qpl_mc_mr_output.html",
true,
true,
"Modules/TestQuestionPool");
544 foreach (
$keys as $answer_id) {
545 $answer = $this->
object->answers[$answer_id];
546 if (strlen($answer->getImage())) {
547 if ($this->
object->getThumbSize()) {
548 $template->setCurrentBlock(
"preview");
549 $template->setVariable(
"URL_PREVIEW", $this->
object->getImagePathWeb() . $answer->getImage());
550 $template->setVariable(
"TEXT_PREVIEW", $this->
lng->txt(
'preview'));
552 $template->setVariable(
"ANSWER_IMAGE_URL", $this->
object->getImagePathWeb() . $this->
object->getThumbPrefix() . $answer->getImage());
553 list($width, $height,
$type, $attr) = getimagesize($this->
object->getImagePath() . $answer->getImage());
554 $alt = $answer->getImage();
555 if (strlen($answer->getAnswertext())) {
556 $alt = $answer->getAnswertext();
558 $alt = preg_replace(
"/<[^>]*?>/",
"", $alt);
561 $template->parseCurrentBlock();
563 $template->setCurrentBlock(
"answer_image");
564 $template->setVariable(
"ANSWER_IMAGE_URL", $this->
object->getImagePathWeb() . $answer->getImage());
565 list($width, $height,
$type, $attr) = getimagesize($this->
object->getImagePath() . $answer->getImage());
566 $alt = $answer->getImage();
567 if (strlen($answer->getAnswertext())) {
568 $alt = $answer->getAnswertext();
570 $alt = preg_replace(
"/<[^>]*?>/",
"", $alt);
571 $template->setVariable(
"ATTR", $attr);
574 $template->parseCurrentBlock();
578 if ($show_feedback) {
582 $template->setCurrentBlock(
"answer_row");
583 $template->setVariable(
"QID", $this->
object->getId());
584 $template->setVariable(
"ANSWER_ID", $answer_id);
585 $template->setVariable(
"ANSWER_TEXT", $this->
object->prepareTextareaOutput($answer->getAnswertext(),
true));
586 foreach ($user_solution as $mc_solution) {
587 if (strcmp($mc_solution, $answer_id) == 0) {
588 $template->setVariable(
"CHECKED_ANSWER",
" checked=\"checked\"");
591 $template->parseCurrentBlock();
594 $template->setVariable(
"QUESTIONTEXT", $this->
object->getQuestionForHTMLOutput());
595 $template->setVariable(
"QUESTION_ID", $this->
object->getId());
596 if ($this->
object->getSelectionLimit()) {
597 $template->setVariable(
'SELECTION_LIMIT_HINT', sprintf(
598 $this->
lng->txt(
'ass_mc_sel_lim_hint'),
599 $this->
object->getSelectionLimit(),
600 $this->
object->getAnswerCount()
603 $template->setVariable(
'SELECTION_LIMIT_VALUE', $this->
object->getSelectionLimit());
605 $template->setVariable(
'SELECTION_LIMIT_VALUE',
'null');
607 $questionoutput = $template->get();
608 $pageoutput = $this->
outQuestionPage(
"", $is_postponed, $active_id, $questionoutput, $show_feedback);
627 $this->tpl->addJavaScript(
'Modules/TestQuestionPool/js/ilAssMultipleChoice.js');
629 $tpl =
new ilTemplate(
'tpl.tst_question_additional_behaviour_checkbox.html',
true,
true,
'Modules/TestQuestionPool');
641 $tpl->
setVariable(
'TXT_FORCE_FORM_DIFF_LABEL', $this->
object->getTestPresentationConfig()->getUseUnchangedAnswerLabel());
649 return array(
'Modules/TestQuestionPool/js/ilAssMultipleChoice.js');
661 if ($this->
object->getShuffle()) {
672 return $this->
object->prepareTextareaOutput($output,
true);
677 $this->
object->setShuffle($_POST[
"shuffle"] ??
'0');
680 $this->
object->setSelectionLimit($selectionLimit > 0 ? $selectionLimit : null);
682 if (isset($_POST[
'feedback_setting'])) {
683 $this->
object->setSpecificFeedbackSetting($_POST[
'feedback_setting']);
686 $types = (
int) ($_POST[
'types'] ??
'0');
687 $this->
object->setMultilineAnswerSetting($types);
688 if (isset($_POST[
'choice'][
'imagename']) && is_array($_POST[
'choice'][
'imagename']) && $types === 1) {
689 $this->
object->setIsSingleline(
true);
690 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
'info_answer_type_change'),
true);
692 $this->
object->setIsSingleline(($types === 0) ?
true :
false);
694 if (isset($_POST[
"thumb_size"])) {
695 $this->
object->setThumbSize((
int) $_POST[
"thumb_size"]);
702 $this->
object->flushAnswers();
704 if ($this->
object->isSingleline()) {
705 foreach ($choice[
'answer'] as
$index => $answertext) {
706 $answertext = htmlentities($answertext);
707 $picturefile = $choice[
'imagename'][
$index] ??
'';
708 $file_org_name = $_FILES[
'choice'][
'name'][
'image'][
$index] ??
'';
709 $file_temp_name = $_FILES[
'choice'][
'tmp_name'][
'image'][
$index] ??
'';
711 if ($file_temp_name !==
'') {
713 $parts = explode(
".", $file_org_name);
714 $suffix = strtolower(array_pop(
$parts));
715 if (in_array($suffix, [
"jpg",
"jpeg",
"png",
"gif"])) {
717 $filename = $this->
object->buildHashedImageFilename($file_org_name);
724 $this->
object->addAnswer(
726 (
float) str_replace(
',',
'.', $choice[
'points'][
$index]),
727 (
float) str_replace(
',',
'.', $choice[
'points_unchecked'][$index]),
730 $choice[
'answer_id'][$index]
734 foreach ($choice[
'answer'] as
$index => $answer) {
735 $answertext = $answer;
736 $this->
object->addAnswer(
738 (
float) str_replace(
',',
'.', $choice[
'points'][
$index]),
739 (
float) str_replace(
',',
'.', $choice[
'points_unchecked'][$index]),
742 (
int) $choice[
'answer_id'][$index]
753 $shuffle->setChecked($this->
object->getShuffle());
754 $shuffle->setRequired(
false);
757 require_once
'Services/Form/classes/class.ilNumberInputGUI.php';
758 $selLim =
new ilNumberInputGUI($this->
lng->txt(
'ass_mc_sel_lim_setting'),
'selection_limit');
759 $selLim->
setInfo($this->
lng->txt(
'ass_mc_sel_lim_setting_desc'));
761 $selLim->setRequired(
false);
762 $selLim->allowDecimals(
false);
763 $selLim->setMinvalueShouldBeGreater(
false);
764 $selLim->setMaxvalueShouldBeLess(
false);
765 $selLim->setMinValue(1);
766 $selLim->setMaxValue($this->
object->getAnswerCount());
767 $selLim->setValue($this->
object->getSelectionLimit());
770 if ($this->
object->getId()) {
772 $hidden->setValue($this->
object->getId());
776 if (!$this->
object->getSelfAssessmentEditingMode()) {
779 $types->setRequired(
false);
780 $types->setValue(($is_singleline) ? 0 : 1);
782 0 => $this->
lng->txt(
'answers_singleline'),
783 1 => $this->
lng->txt(
'answers_multiline'),
788 if ($is_singleline) {
791 $thumb_size->
setSuffix($this->
lng->txt(
'thumb_size_unit_pixel'));
792 $thumb_size->setMinValue($this->
object->getMinimumThumbSize());
793 $thumb_size->setMaxValue($this->
object->getMaximumThumbSize());
794 $thumb_size->setDecimals(0);
795 $thumb_size->setSize(6);
796 $thumb_size->setInfo($this->
lng->txt(
'thumb_size_info'));
797 $thumb_size->setValue($this->
object->getThumbSize());
798 $thumb_size->setRequired(
true);
801 $thumb_size->setValue($this->
object->getThumbSize());
811 include_once
"./Modules/TestQuestionPool/classes/class.ilMultipleChoiceWizardInputGUI.php";
814 $choices->setQuestionObject($this->
object);
815 $choices->setSingleline($is_singleline);
816 $choices->setAllowMove(
false);
817 if ($this->
object->getSelfAssessmentEditingMode()) {
818 $choices->setSize(40);
820 if ($this->
object->getAnswerCount() == 0) {
821 $this->
object->addAnswer(
"", 0, 0, 0);
823 $choices->setValues(array_map(
825 $value->setAnswerText(html_entity_decode($value->getAnswerText()));
828 $this->
object->getAnswers()
875 public function aggregateAnswers($relevant_answers_chosen, $answers_defined_on_question): array
877 $aggregate = array();
878 foreach ($answers_defined_on_question as $answer) {
879 $aggregated_info_for_answer = array();
880 $aggregated_info_for_answer[
'answertext'] = $answer->getAnswerText();
881 $aggregated_info_for_answer[
'count_checked'] = 0;
883 foreach ($relevant_answers_chosen as $relevant_answer) {
884 if ($relevant_answer[
'value1'] == $answer->getOrder()) {
885 $aggregated_info_for_answer[
'count_checked']++;
888 $aggregated_info_for_answer[
'count_unchecked'] =
889 ceil(count($relevant_answers_chosen) / count($answers_defined_on_question))
890 - $aggregated_info_for_answer[
'count_checked'];
892 $aggregate[] = $aggregated_info_for_answer;
904 $tpl =
new ilTemplate(
'tpl.il_as_aggregated_answers_table.html',
true,
true,
"Modules/TestQuestionPool");
914 foreach ($aggregate as $line_data) {
925 if ($this->
object->getSpecificFeedbackSetting() == 2) {
926 foreach ($user_solution as $mc_solution) {
927 if (strcmp($mc_solution, $answer_id) == 0) {
928 $fb = $this->
object->feedbackOBJ->getSpecificAnswerFeedbackTestPresentation($this->
object->getId(), 0, $answer_id);
930 $template->setCurrentBlock(
"feedback");
931 $template->setVariable(
"FEEDBACK", $this->
object->prepareTextareaOutput($fb,
true));
932 $template->parseCurrentBlock();
938 if ($this->
object->getSpecificFeedbackSetting() == 1) {
939 $fb = $this->
object->feedbackOBJ->getSpecificAnswerFeedbackTestPresentation($this->
object->getId(), 0, $answer_id);
941 $template->setCurrentBlock(
"feedback");
942 $template->setVariable(
"FEEDBACK", $this->
object->prepareTextareaOutput($fb,
true));
943 $template->parseCurrentBlock();
947 if ($this->
object->getSpecificFeedbackSetting() == 3) {
948 $answer = $this->
object->getAnswer($answer_id);
950 if ($answer->getPoints() > 0) {
951 $fb = $this->
object->feedbackOBJ->getSpecificAnswerFeedbackTestPresentation($this->
object->getId(), 0, $answer_id);
953 $template->setCurrentBlock(
"feedback");
954 $template->setVariable(
"FEEDBACK", $this->
object->prepareTextareaOutput($fb,
true));
955 $template->parseCurrentBlock();
970 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
972 $form->setFormAction($this->
ctrl->getFormAction($this));
974 $form->setTableWidth(
"100%");
975 $form->setId(
"assmultiplechoice");
991 foreach ($agg as $ans) {
993 'answer' => $ans[
'answertext'],
994 'frequency' => $ans[
'count_checked']
1003 require_once
'Modules/TestQuestionPool/classes/forms/class.ilAssMultipleChoiceCorrectionsInputGUI.php';
1006 $choices->setQuestionObject($this->
object);
1007 $choices->setValues($this->
object->getAnswers());
1017 $answerElements = $input->getValues();
1019 foreach ($this->
object->getAnswers() as
$index => $answer) {
1021 $answer->setPointsChecked((
float) str_replace(
',',
'.', $answerElements[$index]->getPointsChecked()));
1022 $answer->setPointsUnchecked((
float) str_replace(
',',
'.', $answerElements[$index]->getPointsUnchecked()));
isTestPresentationContext()
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)
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.
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
removechoice()
Remove an answer.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
populateTaxonomyFormSection(ilPropertyFormGUI $form)
removeimagechoice()
Remove an image.
addQuestionFormCommandButtons(ilPropertyFormGUI $form)
addchoice()
Add a new answer.
editQuestion($checkonly=false)
Creates an output of the edit form for the question.
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 $_POST and applies them to the data object.
getPreview($show_question_only=false, $showInlineFeedback=false)
static getHtmlPath(string $relative_path)
get url of path
writeQuestionSpecificPostData(ilPropertyFormGUI $form)
Extracts the question specific values from $_POST and applies them to the data object.
const CSS_CLASS_FEEDBACK_WRONG
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
aggregateAnswers($relevant_answers_chosen, $answers_defined_on_question)
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.
getEditAnswersSingleLine($checkonly=false)
Get the single/multiline editing of answers.
__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)
renderAggregateView($aggregate)
__construct(Container $dic, ilPlugin $plugin)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
uploadchoice()
Upload an image.
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()
getTestOutput( $active_id, $pass, $is_postponed=false, $use_post_solutions=false, $show_feedback=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
buildEditForm(bool $is_singleline=true)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getSolutionOutput( $active_id, $pass=null, $graphicalOutput=false, $result_output=false, $show_question_only=true, $show_feedback=false, $show_correct_solution=false, $show_manual_scoring=false, $show_question_text=true)
Get the question solution output.
getSpecificFeedbackOutput(array $userSolution)
populateSpecificFeedbackInline($user_solution, $answer_id, $template)
setVariable(string $variable, $value='')
Sets the given variable to the given value.
getAggregatedAnswersView(array $relevant_answers)
Returns an html string containing a question specific representation of the answers so far given in t...
addBasicQuestionFormProperties(ilPropertyFormGUI $form)
renderPurposeSupportsFormHtml()
getGenericFeedbackOutput(int $active_id, ?int $pass)