19 require_once 
'./Modules/Test/classes/inc.AssessmentConstants.php';
    52             $this->
object->loadFromDb(
$id);
    61         return $this->
object->feedbackOBJ->isSpecificAnswerFeedbackAvailable($this->
object->getId());
    69         $hasErrors = (!$always) ? $this->
editQuestion(
true) : 
false;
    73             $form->setValuesByPost();
    92         if ($this->
object->getSelfAssessmentEditingMode()) {
    93             return $this->
object->isSingleline();
    97             $types = $_POST[
'types'] ?? 
'0';
    98             return $types === 
'0' ? true : 
false;
   101         $lastChange = $this->
object->getLastChange();
   102         if (empty($lastChange) && !isset($_POST[
'types'])) {
   104             return $this->
object->getMultilineAnswerSetting() ? false : 
true;
   107             return $this->
object->isSingleline();
   127         if ($is_singleline) {
   128             $form->setMultipart(
true);
   130             $form->setMultipart(
false);
   136             $form->getItemByPostVar(
'selection_limit')->setMaxValue(count((array) $_POST[
'choice'][
'answer']));
   138             $form->setValuesByPost();
   139             $errors = !$this->checkMaxPointsNotNegative($form) || !$form->checkInput();
   146             $this->tpl->setVariable(
"QUESTION_DATA", $form->getHTML());
   158         $answers = $choice->getValues();
   159         $total_max_points = 0;
   161         foreach ($answers as $answer) {
   162             $total_max_points += max($answer->getPointsChecked(), $answer->getPointsUnchecked());
   165         if ($total_max_points < 0) {
   166             $choice->setAlert($this->
lng->txt(
'total_max_points_cannot_be_negative'));
   175         parent::addBasicQuestionFormProperties($form);
   194         $position = key($_POST[
'cmd'][
'removeimagechoice']);
   195         $this->
object->removeAnswerImage($position);
   205         $position = key($_POST[
'cmd'][
'addchoice']);
   206         $this->
object->addAnswer(
"", 0, 0, $position + 1);
   216         $position = key($_POST[
'cmd'][
'removechoice']);
   217         $this->
object->deleteAnswer($position);
   237         $graphicalOutput = 
false,
   238         $result_output = 
false,
   239         $show_question_only = 
true,
   240         $show_feedback = 
false,
   241         $show_correct_solution = 
false,
   242         $show_manual_scoring = 
false,
   243         $show_question_text = 
true,
   244         bool $show_inline_feedback = 
true   246         if ($active_id > 0 && !$show_correct_solution) {
   247             $user_solution = $this->
object->getSolutionValues($active_id, $pass);
   250             foreach ($this->
object->answers as $index => $answer) {
   251                 $points_checked = $answer->getPointsChecked();
   252                 $points_unchecked = $answer->getPointsUnchecked();
   253                 if ($points_checked > $points_unchecked && $points_checked > 0) {
   254                     $user_solution[] = [
'value1' => $index];
   267             $show_correct_solution,
   268             $show_manual_scoring,
   271             $show_inline_feedback,
   276         mixed $user_solutions,
   279         bool $graphical_output = 
false,
   280         bool $result_output = 
false,
   281         bool $show_question_only = 
true,
   282         bool $show_feedback = 
false,
   283         bool $show_correct_solution = 
false,
   284         bool $show_manual_scoring = 
false,
   285         bool $show_question_text = 
true,
   286         bool $show_autosave_title = 
false,
   287         bool $show_inline_feedback = 
false,
   291         foreach ($user_solutions as $idx => $solution_value) {
   292             array_push($user_solution, $solution_value[
'value1']);
   296         $template = 
new ilTemplate(
"tpl.il_as_qpl_mc_mr_output_solution.html", 
true, 
true, 
"Modules/TestQuestionPool");
   297         $solutiontemplate = 
new ilTemplate(
"tpl.il_as_tst_solution_output.html", 
true, 
true, 
"Modules/TestQuestionPool");
   298         foreach ($keys as $answer_id) {
   299             $answer = $this->
object->answers[$answer_id];
   300             if (($active_id > 0) && (!$show_correct_solution)) {
   301                 if ($graphical_output) {
   305                     foreach ($user_solution as $mc_solution) {
   306                         if ((
string) $mc_solution === (
string) $answer_id) {
   311                         if ($answer->getPointsChecked() > $answer->getPointsUnchecked()) {
   312                             $ok = self::CORRECTNESS_OK;
   314                             $ok = self::CORRECTNESS_NOT_OK;
   317                         if ($answer->getPointsChecked() > $answer->getPointsUnchecked()) {
   318                             $ok = self::CORRECTNESS_NOT_OK;
   320                             $ok = self::CORRECTNESS_OK;
   324                     $template->setCurrentBlock(
"icon_ok");
   325                     $template->setVariable(
"ICON_OK", $icon);
   326                     $template->parseCurrentBlock();
   329             if ($answer->hasImage()) {
   330                 $template->setCurrentBlock(
"answer_image");
   331                 if ($this->
object->getThumbSize()) {
   332                     $template->setVariable(
"ANSWER_IMAGE_URL", $this->
object->getImagePathWeb() . $this->
object->getThumbPrefix() . $answer->getImage());
   334                     $template->setVariable(
"ANSWER_IMAGE_URL", $this->
object->getImagePathWeb() . $answer->getImage());
   336                 $alt = $answer->getImage();
   337                 if (strlen($answer->getAnswertext())) {
   338                     $alt = $answer->getAnswertext();
   340                 $alt = preg_replace(
"/<[^>]*?>/", 
"", $alt);
   343                 $template->parseCurrentBlock();
   348                 if ($this->
object->getSpecificFeedbackSetting() == 2) {
   349                     foreach ($user_solution as $mc_solution) {
   350                         if ((
string) $mc_solution === (string) $answer_id) {
   351                             $fb = $this->
object->feedbackOBJ->getSpecificAnswerFeedbackTestPresentation(
   357                                 $template->setCurrentBlock(
"feedback");
   359                                 $template->parseCurrentBlock();
   365                 if ($this->
object->getSpecificFeedbackSetting() == 1) {
   366                     $fb = $this->
object->feedbackOBJ->getSpecificAnswerFeedbackTestPresentation(
   372                         $template->setCurrentBlock(
"feedback");
   374                         $template->parseCurrentBlock();
   378             if ($show_feedback) {
   379                 if ($this->
object->getSpecificFeedbackSetting() == 3) {
   380                     $answer = $this->
object->getAnswer($answer_id);
   382                     if ($answer->getPoints() > 0) {
   383                         $fb = $this->
object->feedbackOBJ->getSpecificAnswerFeedbackTestPresentation(
   389                             $template->setCurrentBlock(
"feedback");
   391                             $template->parseCurrentBlock();
   399             $template->setCurrentBlock(
"answer_row");
   402             if ($result_output) {
   403                 $pointschecked = $this->
object->answers[$answer_id]->getPointsChecked();
   404                 $pointsunchecked = $this->
object->answers[$answer_id]->getPointsUnchecked();
   405                 $resulttextchecked = ($pointschecked == 1) || ($pointschecked == -1) ? 
"%s " . $this->
lng->txt(
"point") : 
"%s " . $this->
lng->txt(
"points");
   406                 $resulttextunchecked = ($pointsunchecked == 1) || ($pointsunchecked == -1) ? 
"%s " . $this->
lng->txt(
"point") : 
"%s " . $this->
lng->txt(
"points");
   407                 $template->setVariable(
"RESULT_OUTPUT", sprintf(
"(" . $this->
lng->txt(
"checkbox_checked") . 
" = $resulttextchecked, " . $this->
lng->txt(
"checkbox_unchecked") . 
" = $resulttextunchecked)", $pointschecked, $pointsunchecked));
   409             foreach ($user_solution as $mc_solution) {
   410                 if ((
string) $mc_solution === (string) $answer_id) {
   413                         $template->setVariable(
"SOLUTION_ALT", $this->
lng->txt(
"checked"));
   415                         $template->setVariable(
'QID', $this->
object->getId());
   416                         $template->setVariable(
'SUFFIX', $show_correct_solution ? 
'bestsolution' : 
'usersolution');
   417                         $template->setVariable(
'SOLUTION_VALUE', $answer_id);
   418                         $template->setVariable(
'SOLUTION_CHECKED', 
'checked');
   426                     $template->setVariable(
"SOLUTION_ALT", $this->
lng->txt(
"unchecked"));
   428                     $template->setVariable(
'QID', $this->
object->getId());
   429                     $template->setVariable(
'SUFFIX', $show_correct_solution ? 
'bestsolution' : 
'usersolution');
   430                     $template->setVariable(
'SOLUTION_VALUE', $answer_id);
   433             $template->parseCurrentBlock();
   435         $questiontext = $this->
object->getQuestionForHTMLOutput();
   439         if ($show_question_text == 
true) {
   442         $questionoutput = $template->get();
   445         if (strlen($feedback)) {
   451             $solutiontemplate->setVariable(
"ILC_FB_CSS_CLASS", $cssClass);
   454         $solutiontemplate->setVariable(
"SOLUTION_OUTPUT", $questionoutput);
   456         $solutionoutput = $solutiontemplate->get();
   458         if (!$show_question_only) {
   462         return $solutionoutput;
   465     public function getPreview($show_question_only = 
false, $showInlineFeedback = 
false): string
   471         $this->tpl->addOnLoadCode(
'ilAssMultipleChoiceCharCounterInit();');
   472         $template = 
new ilTemplate(
"tpl.il_as_qpl_mc_mr_output.html", 
true, 
true, 
"Modules/TestQuestionPool");
   473         foreach ($keys as $answer_id) {
   474             $answer = $this->
object->answers[$answer_id];
   475             if ($answer->hasImage()) {
   476                 if ($this->
object->getThumbSize()) {
   477                     $template->setCurrentBlock(
"preview");
   478                     $template->setVariable(
"URL_PREVIEW", $this->
object->getImagePathWeb() . $answer->getImage());
   479                     $template->setVariable(
"TEXT_PREVIEW", $this->
lng->txt(
'preview'));
   481                     $template->setVariable(
"ANSWER_IMAGE_URL", $this->
object->getImagePathWeb() . $this->
object->getThumbPrefix() . $answer->getImage());
   482                     list($width, $height, $type, $attr) = getimagesize($this->
object->getImagePath() . $answer->getImage());
   483                     $alt = $answer->getImage();
   484                     if (strlen($answer->getAnswertext())) {
   485                         $alt = $answer->getAnswertext();
   487                     $alt = preg_replace(
"/<[^>]*?>/", 
"", $alt);
   490                     $template->parseCurrentBlock();
   492                     $template->setCurrentBlock(
"answer_image");
   493                     $template->setVariable(
"ANSWER_IMAGE_URL", $this->
object->getImagePathWeb() . $answer->getImage());
   494                     list($width, $height, $type, $attr) = getimagesize($this->
object->getImagePath() . $answer->getImage());
   495                     $alt = $answer->getImage();
   496                     if (strlen($answer->getAnswertext())) {
   497                         $alt = $answer->getAnswertext();
   499                     $alt = preg_replace(
"/<[^>]*?>/", 
"", $alt);
   500                     $template->setVariable(
"ATTR", $attr);
   503                     $template->parseCurrentBlock();
   507             if ($showInlineFeedback) {
   511             $template->setCurrentBlock(
"answer_row");
   512             $template->setVariable(
"QID", $this->
object->getId());
   513             $template->setVariable(
"ANSWER_ID", $answer_id);
   515             foreach ($user_solution as $mc_solution) {
   516                 if ((
string) $mc_solution === (string) $answer_id) {
   517                     $template->setVariable(
"CHECKED_ANSWER", 
" checked=\"checked\"");
   520             $template->parseCurrentBlock();
   522         if ($this->
object->getSelectionLimit()) {
   523             $template->setVariable(
'SELECTION_LIMIT_HINT', sprintf(
   524                 $this->
lng->txt(
'ass_mc_sel_lim_hint'),
   525                 $this->
object->getSelectionLimit(),
   526                 $this->
object->getAnswerCount()
   529             $template->setVariable(
'SELECTION_LIMIT_VALUE', $this->
object->getSelectionLimit());
   531             $template->setVariable(
'SELECTION_LIMIT_VALUE', 
'null');
   533         $template->setVariable(
"QUESTION_ID", $this->
object->getId());
   534         $questiontext = $this->
object->getQuestionForHTMLOutput();
   539         $questionoutput = $template->get();
   540         if (!$show_question_only) {
   544         return $questionoutput;
   561         $is_postponed = 
false,
   562         $use_post_solutions = 
false,
   563         $show_feedback = 
false   571             $solutions = $this->
object->getTestOutputSolutions($active_id, $pass);
   573             foreach ($solutions as $idx => $solution_value) {
   575                 if ($solution_value[
'value1'] == 
'mc_none_above') {
   580                 $user_solution[] = $solution_value[
'value1'];
   584             if (empty($user_solution) && $this->
object->getTestPresentationConfig()->isWorkedThrough()) {
   589         $this->tpl->addJavaScript(
'Modules/TestQuestionPool/js/ilAssMultipleChoice.js');
   590         $this->tpl->addOnLoadCode(
'ilAssMultipleChoiceCharCounterInit();');
   592         $template = 
new ilTemplate(
"tpl.il_as_qpl_mc_mr_output.html", 
true, 
true, 
"Modules/TestQuestionPool");
   593         foreach ($keys as $answer_id) {
   594             $answer = $this->
object->answers[$answer_id];
   595             if ($answer->hasImage()) {
   596                 if ($this->
object->getThumbSize()) {
   597                     $template->setCurrentBlock(
"preview");
   598                     $template->setVariable(
"URL_PREVIEW", $this->
object->getImagePathWeb() . $answer->getImage());
   599                     $template->setVariable(
"TEXT_PREVIEW", $this->
lng->txt(
'preview'));
   601                     $template->setVariable(
"ANSWER_IMAGE_URL", $this->
object->getImagePathWeb() . $this->
object->getThumbPrefix() . $answer->getImage());
   602                     list($width, $height, $type, $attr) = getimagesize($this->
object->getImagePath() . $answer->getImage());
   603                     $alt = $answer->getImage();
   604                     if (strlen($answer->getAnswertext())) {
   605                         $alt = $answer->getAnswertext();
   607                     $alt = preg_replace(
"/<[^>]*?>/", 
"", $alt);
   610                     $template->parseCurrentBlock();
   612                     $template->setCurrentBlock(
"answer_image");
   613                     $template->setVariable(
"ANSWER_IMAGE_URL", $this->
object->getImagePathWeb() . $answer->getImage());
   614                     list($width, $height, $type, $attr) = getimagesize($this->
object->getImagePath() . $answer->getImage());
   615                     $alt = $answer->getImage();
   616                     if (strlen($answer->getAnswertext())) {
   617                         $alt = $answer->getAnswertext();
   619                     $alt = preg_replace(
"/<[^>]*?>/", 
"", $alt);
   620                     $template->setVariable(
"ATTR", $attr);
   623                     $template->parseCurrentBlock();
   627             if ($show_feedback) {
   631             $template->setCurrentBlock(
"answer_row");
   632             $template->setVariable(
"QID", $this->
object->getId());
   633             $template->setVariable(
"ANSWER_ID", $answer_id);
   635             foreach ($user_solution as $mc_solution) {
   636                 if ((
string) $mc_solution === (string) $answer_id) {
   637                     $template->setVariable(
"CHECKED_ANSWER", 
" checked=\"checked\"");
   640             $template->parseCurrentBlock();
   643         $template->setVariable(
"QUESTIONTEXT", $this->
object->getQuestionForHTMLOutput());
   644         $template->setVariable(
"QUESTION_ID", $this->
object->getId());
   645         if ($this->
object->getSelectionLimit()) {
   646             $template->setVariable(
'SELECTION_LIMIT_HINT', sprintf(
   647                 $this->
lng->txt(
'ass_mc_sel_lim_hint'),
   648                 $this->
object->getSelectionLimit(),
   649                 $this->
object->getAnswerCount()
   652             $template->setVariable(
'SELECTION_LIMIT_VALUE', $this->
object->getSelectionLimit());
   654             $template->setVariable(
'SELECTION_LIMIT_VALUE', 
'null');
   656         $questionoutput = $template->get();
   657         $pageoutput = $this->
outQuestionPage(
"", $is_postponed, $active_id, $questionoutput, $show_feedback);
   676         $this->tpl->addJavaScript(
'Modules/TestQuestionPool/js/ilAssMultipleChoice.js');
   678         $tpl = 
new ilTemplate(
'tpl.tst_question_additional_behaviour_checkbox.html', 
true, 
true, 
'Modules/TestQuestionPool');
   690         $tpl->
setVariable(
'TXT_FORCE_FORM_DIFF_LABEL', $this->
object->getTestPresentationConfig()->getUseUnchangedAnswerLabel());
   698         return [
'Modules/TestQuestionPool/js/ilAssMultipleChoice.js'];
   708         $choice_keys = array_keys($this->
object->answers);
   710         if ($this->
object->getShuffle()) {
   711             $choice_keys = $this->
object->getShuffler()->transform($choice_keys);
   726         $this->
object->setShuffle($_POST[
"shuffle"] ?? 
'0');
   729         $this->
object->setSelectionLimit($selectionLimit > 0 ? $selectionLimit : null);
   731         if (isset($_POST[
'feedback_setting'])) {
   732             $this->
object->setSpecificFeedbackSetting($_POST[
'feedback_setting']);
   735         $types = (
int) ($_POST[
'types'] ?? 
'0');
   736         $this->
object->setMultilineAnswerSetting($types);
   737         if (isset($_POST[
'choice'][
'imagename']) && is_array($_POST[
'choice'][
'imagename']) && $types === 1) {
   738             $this->
object->setIsSingleline(
true);
   739             $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
'info_answer_type_change'), 
true);
   741             $this->
object->setIsSingleline(($types === 0) ? 
true : 
false);
   743         if (isset($_POST[
"thumb_size"])
   744             && (
int) $_POST[
"thumb_size"] !== $this->
object->getThumbSize()) {
   745             $this->
object->setThumbSize((
int) $_POST[
"thumb_size"]);
   746             $this->rebuild_thumbnails = 
true;
   753         $this->
object->flushAnswers();
   755         if (!$this->
object->isSingleline()) {
   756             foreach ($choice[
'answer'] as $index => $answer) {
   757                 $answertext = $answer;
   758                 $this->
object->addAnswer(
   760                     (
float) str_replace(
',', 
'.', $choice[
'points'][$index]),
   761                     (
float) str_replace(
',', 
'.', $choice[
'points_unchecked'][$index]),
   764                     (
int) $choice[
'answer_id'][$index]
   770         foreach ($choice[
'answer'] as $index => $answertext) {
   771             $answertext = htmlentities($answertext);
   772             $picturefile = $choice[
'imagename'][$index] ?? null;
   773             $file_org_name = $_FILES[
'choice'][
'name'][
'image'][$index] ?? 
'';
   774             $file_temp_name = $_FILES[
'choice'][
'tmp_name'][
'image'][$index] ?? 
'';
   776             if ($file_temp_name !== 
'') {
   778                 $parts = explode(
".", $file_org_name);
   779                 $suffix = strtolower(array_pop(
$parts));
   780                 if (in_array($suffix, [
"jpg", 
"jpeg", 
"png", 
"gif"])) {
   782                     $filename = $this->
object->buildHashedImageFilename($file_org_name);
   789             $this->
object->addAnswer(
   791                 (
float) str_replace(
',', 
'.', $choice[
'points'][$index]),
   792                 (
float) str_replace(
',', 
'.', $choice[
'points_unchecked'][$index]),
   795                 $choice[
'answer_id'][$index]
   799         if ($this->rebuild_thumbnails) {
   800             $this->
object->setAnswers(
   801                 $this->
object->rebuildThumbnails(
   802                     $this->object->isSingleline(),
   803                     $this->
object->getThumbSize(),
   804                     $this->
object->getImagePath(),
   805                     $this->
object->getAnswers()
   815         $shuffle->setValue(1);
   816         $shuffle->setChecked($this->
object->getShuffle());
   817         $shuffle->setRequired(
false);
   820         $selLim = 
new ilNumberInputGUI($this->
lng->txt(
'ass_mc_sel_lim_setting'), 
'selection_limit');
   821         $selLim->setInfo($this->
lng->txt(
'ass_mc_sel_lim_setting_desc'));
   823         $selLim->setRequired(
false);
   824         $selLim->allowDecimals(
false);
   825         $selLim->setMinvalueShouldBeGreater(
false);
   826         $selLim->setMaxvalueShouldBeLess(
false);
   827         $selLim->setMinValue(1);
   828         $selLim->setMaxValue($this->
object->getAnswerCount());
   829         $selLim->setValue($this->
object->getSelectionLimit());
   832         if ($this->
object->getId()) {
   834             $hidden->setValue($this->
object->getId());
   838         if (!$this->
object->getSelfAssessmentEditingMode()) {
   842             $types->setValue(($is_singleline) ? 0 : 1);
   844                 0 => $this->
lng->txt(
'answers_singleline'),
   845                 1 => $this->
lng->txt(
'answers_multiline'),
   850         if ($is_singleline) {
   853             $thumb_size->setSuffix($this->
lng->txt(
'thumb_size_unit_pixel'));
   854             $thumb_size->setMinValue($this->
object->getMinimumThumbSize());
   855             $thumb_size->setMaxValue($this->
object->getMaximumThumbSize());
   856             $thumb_size->setDecimals(0);
   857             $thumb_size->setSize(6);
   858             $thumb_size->setInfo($this->
lng->txt(
'thumb_size_info'));
   859             $thumb_size->setValue($this->
object->getThumbSize());
   860             $thumb_size->setRequired(
true);
   863             $thumb_size->setValue($this->
object->getThumbSize());
   874         $choices->setQuestionObject($this->
object);
   875         $choices->setSingleline($is_singleline);
   876         $choices->setAllowMove(
false);
   877         if ($this->
object->getSelfAssessmentEditingMode()) {
   878             $choices->setSize(40);
   880         if ($this->
object->getAnswerCount() == 0) {
   881             $this->
object->addAnswer(
"", 0, 0, 0);
   883         $choices->setValues(array_map(
   885                 $value->setAnswerText(html_entity_decode($value->getAnswerText()));
   888             $this->
object->getAnswers()
   935     public function aggregateAnswers($relevant_answers_chosen, $answers_defined_on_question): array
   938         foreach ($answers_defined_on_question as $answer) {
   939             $aggregated_info_for_answer = [];
   940             $aggregated_info_for_answer[
'answertext'] = $answer->getAnswerText();
   941             $aggregated_info_for_answer[
'count_checked'] = 0;
   943             foreach ($relevant_answers_chosen as $relevant_answer) {
   944                 if ($relevant_answer[
'value1'] == $answer->getOrder()) {
   945                     $aggregated_info_for_answer[
'count_checked']++;
   948             $aggregated_info_for_answer[
'count_unchecked'] =
   949                 ceil(count($relevant_answers_chosen) / count($answers_defined_on_question))
   950                 - $aggregated_info_for_answer[
'count_checked'];
   952             $aggregate[] = $aggregated_info_for_answer;
   964         $tpl = 
new ilTemplate(
'tpl.il_as_aggregated_answers_table.html', 
true, 
true, 
"Modules/TestQuestionPool");
   974         foreach ($aggregate as $line_data) {
   985         if ($this->
object->getSpecificFeedbackSetting() == 2) {
   986             foreach ($user_solution as $mc_solution) {
   987                 if ((
string) $mc_solution === (string) $answer_id) {
   988                     $fb = $this->
object->feedbackOBJ->getSpecificAnswerFeedbackTestPresentation($this->
object->getId(), 0, $answer_id);
   990                         $template->setCurrentBlock(
"feedback");
   992                         $template->parseCurrentBlock();
   998         if ($this->
object->getSpecificFeedbackSetting() == 1) {
   999             $fb = $this->
object->feedbackOBJ->getSpecificAnswerFeedbackTestPresentation($this->
object->getId(), 0, $answer_id);
  1001                 $template->setCurrentBlock(
"feedback");
  1003                 $template->parseCurrentBlock();
  1007         if ($this->
object->getSpecificFeedbackSetting() == 3) {
  1008             $answer = $this->
object->getAnswer($answer_id);
  1010             if ($answer->getPoints() > 0) {
  1011                 $fb = $this->
object->feedbackOBJ->getSpecificAnswerFeedbackTestPresentation($this->
object->getId(), 0, $answer_id);
  1013                     $template->setCurrentBlock(
"feedback");
  1015                     $template->parseCurrentBlock();
  1034         $form->
setId(
"assmultiplechoice");
  1050         foreach ($agg as $ans) {
  1052                 'answer' => $ans[
'answertext'],
  1053                 'frequency' => $ans[
'count_checked']
  1064         $choices->setQuestionObject($this->
object);
  1065         $choices->setValues($this->
object->getAnswers());
  1075         $answerElements = $input->getValues();
  1077         foreach ($this->
object->getAnswers() as $index => $answer) {
  1079             $answer->setPointsChecked((
float) str_replace(
',', 
'.', $answerElements[$index]->getPointsChecked()));
  1080             $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. 
 
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)
 
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, bool $show_inline_feedback=true)
Get the question solution output. 
 
const CSS_CLASS_FEEDBACK_CORRECT
 
ilGlobalPageTemplate $tpl
 
Class for multiple choice tests. 
 
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
 
Basic GUI class for assessment questions. 
 
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)
 
$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...
 
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)
 
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,)
 
renderPurposeSupportsFormHtml()
 
getGenericFeedbackOutput(int $active_id, ?int $pass)