ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
assMultipleChoiceGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for assMultipleChoiceGUI:
+ Collaboration diagram for assMultipleChoiceGUI:

Public Member Functions

 __construct ($id=-1)
 assMultipleChoiceGUI constructor More...
 
 hasInlineFeedback ()
 
 editQuestion ($checkonly=false)
 Creates an output of the edit form for the question. More...
 
 addBasicQuestionFormProperties (ilPropertyFormGUI $form)
 
 uploadchoice ()
 Upload an image. More...
 
 removeimagechoice ()
 Remove an image. More...
 
 addchoice ()
 Add a new answer. More...
 
 removechoice ()
 Remove an answer. More...
 
 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. More...
 
 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,)
 
 getPreview ($show_question_only=false, $showInlineFeedback=false)
 
 getTestOutput ( $active_id, $pass, $is_postponed=false, $use_post_solutions=false, $show_feedback=false)
 
 isUseEmptySolutionInputChecked ()
 
 setUseEmptySolutionInputChecked ($useEmptySolutionInputChecked)
 
 getPresentationJavascripts ()
 
 getChoiceKeys ()
 Create the key index numbers for the array of choices. More...
 
 getSpecificFeedbackOutput (array $userSolution)
 
 writeQuestionSpecificPostData (ilPropertyFormGUI $form)
 Extracts the question specific values from $_POST and applies them to the data object. More...
 
 writeAnswerSpecificPostData (ilPropertyFormGUI $form)
 Extracts the answer specific values from $_POST and applies them to the data object. More...
 
 populateQuestionSpecificFormPart (\ilPropertyFormGUI $form, bool $is_singleline=false)
 
 populateAnswerSpecificFormPart (\ilPropertyFormGUI $form, bool $is_singleline=false)
 
 getAfterParticipationSuppressionAnswerPostVars ()
 Returns a list of postvars which will be suppressed in the form output when used in scoring adjustment. More...
 
 getAfterParticipationSuppressionQuestionPostVars ()
 Returns a list of postvars which will be suppressed in the form output when used in scoring adjustment. More...
 
 getAggregatedAnswersView (array $relevant_answers)
 Returns an html string containing a question specific representation of the answers so far given in the test for use in the right column in the scoring adjustment user interface. More...
 
 aggregateAnswers ($relevant_answers_chosen, $answers_defined_on_question)
 
 renderAggregateView ($aggregate)
 
 getAnswersFrequency ($relevantAnswers, $questionIndex)
 
 populateCorrectionsFormProperties (ilPropertyFormGUI $form)
 
 saveCorrectionsFormProperties (ilPropertyFormGUI $form)
 
- Public Member Functions inherited from assQuestionGUI
 hasInlineFeedback ()
 
 addHeaderAction ()
 
 redrawHeaderAction ()
 
 getHeaderAction ()
 
 geCommentsPanelHTML ()
 
 executeCommand ()
 
 getType ()
 needed for page editor compliance More...
 
 getPresentationContext ()
 
 setPresentationContext (string $presentationContext)
 
 isTestPresentationContext ()
 
 isPreviousSolutionPrefilled ()
 
 setPreviousSolutionPrefilled (bool $previousSolutionPrefilled)
 
 getRenderPurpose ()
 
 setRenderPurpose (string $renderPurpose)
 
 isRenderPurposePrintPdf ()
 
 isRenderPurposePreview ()
 
 isRenderPurposeInputValue ()
 
 isRenderPurposePlayback ()
 
 isRenderPurposeDemoplay ()
 
 renderPurposeSupportsFormHtml ()
 
 getEditContext ()
 
 setEditContext (string $editContext)
 
 isAuthoringEditContext ()
 
 isAdjustmentEditContext ()
 
 setAdjustmentEditContext ()
 
 getNavigationGUI ()
 
 setNavigationGUI (?ilTestQuestionNavigationGUI $navigationGUI)
 
 setTaxonomyIds (array $taxonomyIds)
 
 getTaxonomyIds ()
 
 setTargetGui ($linkTargetGui)
 
 setTargetGuiClass ($targetGuiClass)
 
 getTargetGuiClass ()
 
 setQuestionHeaderBlockBuilder (\ilQuestionHeaderBlockBuilder $questionHeaderBlockBuilder)
 
 getQuestionHeaderBlockBuilder ()
 
 setQuestionActionCmd (string $questionActionCmd)
 
 getQuestionActionCmd ()
 
 assessment ()
 
 populateJavascriptFilesRequiredForWorkForm (ilGlobalTemplateInterface $tpl)
 
 getPresentationJavascripts ()
 
 getQuestionTemplate ()
 
 getILIASPage (string $html="")
 Returns the ILIAS Page around a question. More...
 
 outQuestionPage ($a_temp_var, $a_postponed=false, $active_id="", $html="", $inlineFeedbackEnabled=false)
 
 cancel ()
 
 originalSyncForm (string $return_to="", string $return_to_feedback='')
 
 sync ()
 
 cancelSync ()
 
 saveEdit ()
 
 save ()
 
 saveReturn ()
 
 apply ()
 
 getContextPath ($cont_obj, int $a_endnode_id, int $a_startnode_id=1)
 get context path in content object tree More...
 
 setSequenceNumber (int $nr)
 
 getSequenceNumber ()
 
 setQuestionCount (int $a_question_count)
 
 getQuestionCount ()
 
 getErrorMessage ()
 
 setErrorMessage (string $errormessage)
 
 addErrorMessage (string $errormessage)
 
 outAdditionalOutput ()
 Why are you here? Some magic for plugins? More...
 
 getQuestionType ()
 
 getAsValueAttribute (string $a_value)
 
 addNewIdListener ($a_object, string $a_method, string $a_parameters="")
 Add a listener that is notified with the new question ID, when a new question is saved. More...
 
 callNewIdListeners (int $a_new_id)
 
 addQuestionFormCommandButtons (ilPropertyFormGUI $form)
 
 addBasicQuestionFormProperties (ilPropertyFormGUI $form)
 
 getGenericFeedbackOutput (int $active_id, ?int $pass)
 
 getGenericFeedbackOutputForCorrectSolution ()
 
 getGenericFeedbackOutputForIncorrectSolution ()
 
 getSpecificFeedbackOutput (array $userSolution)
 Returns the answer specific feedback for the question. More...
 
 outQuestionType ()
 
 suggestedsolution ()
 
 outSolutionExplorer ()
 
 saveSuggestedSolutionType ()
 
 cancelExplorer ()
 
 outPageSelector ()
 
 outChapterSelector ()
 
 outGlossarySelector ()
 
 linkChilds ()
 
 addPG ()
 
 addST ()
 
 addGIT ()
 
 isSaveCommand ()
 
 setQuestionTabs ()
 
 addTab_SuggestedSolution (ilTabsGUI $tabs, string $classname)
 
 getEditQuestionTabCommands ()
 
 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)
 
 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,)
 
 isAutosaveable ()
 
 getPreview ($show_question_only=false, $showInlineFeedback=false)
 
 outQuestionForTest (string $formaction, int $active_id, ?int $pass, bool $is_question_postponed=false, $user_post_solutions=false, bool $show_specific_inline_feedback=false)
 
 magicAfterTestOutput ()
 
 getTestOutput ( $active_id, $pass, $is_question_postponed, $user_post_solutions, $show_specific_inline_feedback)
 
 getFormEncodingType ()
 
 setPreviewSession (ilAssQuestionPreviewSession $previewSession)
 
 getPreviewSession ()
 
 showHints ()
 
 buildFocusAnchorHtml ()
 
 isAnswerFrequencyStatisticSupported ()
 
 getSubQuestionsIndex ()
 
 getAnswersFrequency ($relevantAnswers, $questionIndex)
 
 getAnswerFrequencyTableGUI ($parentGui, $parentCmd, $relevantAnswers, $questionIndex)
 
 prepareReprintableCorrectionsForm (ilPropertyFormGUI $form)
 
 populateCorrectionsFormProperties (ilPropertyFormGUI $form)
 
 saveCorrectionsFormProperties (ilPropertyFormGUI $form)
 
 isInLearningModuleContext ()
 
 setInLearningModuleContext (bool $flag)
 
 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)
 
- Public Member Functions inherited from ilGuiQuestionScoringAdjustable
 populateQuestionSpecificFormPart (ilPropertyFormGUI $form)
 Adds the question specific forms parts to a question property form gui. More...
 
- Public Member Functions inherited from ilGuiAnswerScoringAdjustable
 populateAnswerSpecificFormPart (ilPropertyFormGUI $form)
 Adds the answer specific form parts to a question property form gui. More...
 

Protected Member Functions

 writePostData (bool $always=false)
 {} More...
 
 getEditAnswersSingleLine ($checkonly=false)
 Get the single/multiline editing of answers. More...
 
 getUseUnchangedAnswerCheckboxHtml ()
 
 buildEditForm (bool $is_singleline=true)
 
- Protected Member Functions inherited from assQuestionGUI
 hasSpecialQuestionCommands ()
 
 writePostData (bool $always=false)
 Evaluates a posted edit form and writes the form data in the question object. More...
 
 renderEditForm (ilPropertyFormGUI $form)
 
 getUseUnchangedAnswerCheckboxHtml ()
 
 getPreviousSolutionProvidedMessage ()
 
 getPreviousSolutionConfirmationCheckboxHtml ()
 
 addNumberOfTriesToFormIfNecessary (ilPropertyFormGUI $form)
 
 saveTaxonomyAssignments ()
 
 populateTaxonomyFormSection (ilPropertyFormGUI $form)
 
 genericFeedbackOutputBuilder (string $feedback_correct, string $feedback_incorrect, int $active_id, ?int $pass)
 
 getTypeOptions ()
 
 createSuggestedSolutionLinkingTo (string $type, string $target)
 
 setDefaultTabs (ilTabsGUI $ilTabs)
 
 setQuestionSpecificTabs (ilTabsGUI $ilTabs)
 
 getBasicEditQuestionTabCommands ()
 
 getAdditionalEditQuestionCommands ()
 
 addTab_QuestionFeedback (ilTabsGUI $tabs)
 
 addTab_QuestionHints (ilTabsGUI $tabs)
 
 addTab_Question (ilTabsGUI $tabsGUI)
 
 hasCorrectSolution ($activeId, $passIndex)
 
 writeQuestionGenericPostData ()
 
 completeTestOutputFormAction ($formAction, $active_id, $pass)
 
 addBackTab (ilTabsGUI $ilTabs)
 
 buildBasicEditFormObject ()
 
 escapeTemplatePlaceholders (string $text)
 
 buildEditForm ()
 
 generateCorrectnessIconsForCorrectness (int $correctness)
 
 getSuggestedSolutionsRepo ()
 
 cleanupAnswerText (array $answer_text, bool $is_rte)
 sk - 12.05.2023: This is one more of those that we need, but don't want. More...
 
 addSaveOnEnterOnLoadCode ()
 

Protected Attributes

 $useEmptySolutionInputChecked = false
 
- Protected Attributes inherited from assQuestionGUI
const SUGGESTED_SOLUTION_COMMANDS_CANCEL = 'cancelSuggestedSolution'
 
const SUGGESTED_SOLUTION_COMMANDS_SAVE = 'saveSuggestedSolution'
 
const SUGGESTED_SOLUTION_COMMANDS_DEFAULT = 'suggestedsolution'
 
const HAS_SPECIAL_QUESTION_COMMANDS = false
 
ilLogger $logger
 
ILIAS TestQuestionPool QuestionInfoService $questioninfo
 
ILIAS Notes GUIService $notes_gui
 
ilCtrl $ctrl
 
Refinery $refinery
 
ilPropertyFormGUI $editForm
 
ILIAS TestQuestionPool InternalRequestService $request
 
bool $parent_type_is_lm = false
 
assQuestionSuggestedSolutionsDatabaseRepository $suggestedsolution_repo = null
 

Private Member Functions

 populateSpecificFeedbackInline ($user_solution, $answer_id, $template)
 

Private Attributes

bool $rebuild_thumbnails = false
 

Additional Inherited Members

- Static Public Member Functions inherited from assQuestionGUI
static _getQuestionGUI (string $question_type='', int $question_id=-1)
 Creates a question gui representation and returns the alias to the question gui. More...
 
static _getGUIClassNameForId ($a_q_id)
 
static _getClassNameForQType ($q_type)
 
static getCommandsFromClassConstants (string $guiClassName, string $cmdConstantNameBegin='CMD_')
 
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, CHR(13) will be converted to a line break. More...
 
- Data Fields inherited from assQuestionGUI
const FORM_MODE_EDIT = 'edit'
 
const FORM_MODE_ADJUST = 'adjust'
 
const FORM_ENCODING_URLENCODE = 'application/x-www-form-urlencoded'
 
const FORM_ENCODING_MULTIPART = 'multipart/form-data'
 
const CORRECTNESS_NOT_OK = 0
 
const CORRECTNESS_MOSTLY_OK = 1
 
const CORRECTNESS_OK = 2
 
const ALLOWED_PLAIN_TEXT_TAGS = "<em>, <strong>"
 sk - 12.05.2023: This const is also used in ilKprimChoiceWizardInputGUI. More...
 
const SESSION_PREVIEW_DATA_BASE_INDEX = 'ilAssQuestionPreviewAnswers'
 
assQuestion $object
 
ilGlobalPageTemplate $tpl
 
ilLanguage $lng
 
 $error
 
string $errormessage
 
int $sequence_no
 sequence number in test More...
 
int $question_count
 question count in test More...
 
const PRESENTATION_CONTEXT_TEST = 'pContextTest'
 
const PRESENTATION_CONTEXT_RESULTS = 'pContextResults'
 
const RENDER_PURPOSE_PLAYBACK = 'renderPurposePlayback'
 
const RENDER_PURPOSE_DEMOPLAY = 'renderPurposeDemoplay'
 
const RENDER_PURPOSE_PREVIEW = 'renderPurposePreview'
 
const RENDER_PURPOSE_PRINT_PDF = 'renderPurposePrintPdf'
 
const RENDER_PURPOSE_INPUT_VALUE = 'renderPurposeInputValue'
 
const EDIT_CONTEXT_AUTHORING = 'authoring'
 
const EDIT_CONTEXT_ADJUSTMENT = 'adjustment'
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Multiple choice question GUI representation

The assMultipleChoiceGUI class encapsulates the GUI representation for multiple choice questions.

Author
Helmut Schottmüller helmu.nosp@m.t.sc.nosp@m.hottm.nosp@m.uell.nosp@m.er@ma.nosp@m.c.co.nosp@m.m
Björn Heyser bheys.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de
Maximilian Becker mbeck.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de
Version
$Id$

assMultipleChoiceGUI: ilFormPropertyDispatchGUI

Definition at line 35 of file class.assMultipleChoiceGUI.php.

Constructor & Destructor Documentation

◆ __construct()

assMultipleChoiceGUI::__construct (   $id = -1)

assMultipleChoiceGUI constructor

The constructor takes possible arguments an creates an instance of the assMultipleChoiceGUI object.

Parameters
integer$idThe database id of a multiple choice question object public

Definition at line 47 of file class.assMultipleChoiceGUI.php.

References $id, and ILIAS\MetaData\Repository\Validation\Data\__construct().

48  {
50  $this->object = new assMultipleChoice();
51  if ($id >= 0) {
52  $this->object->loadFromDb($id);
53  }
54  }
Class for multiple choice tests.
__construct(VocabulariesInterface $vocabularies)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

Member Function Documentation

◆ addBasicQuestionFormProperties()

assMultipleChoiceGUI::addBasicQuestionFormProperties ( ilPropertyFormGUI  $form)

Definition at line 173 of file class.assMultipleChoiceGUI.php.

References ilPropertyFormGUI\getItemByPostVar().

Referenced by buildEditForm().

173  : void
174  {
175  parent::addBasicQuestionFormProperties($form);
176  $form->getItemByPostVar('question')->setInitialRteWidth('100');
177  }
getItemByPostVar(string $a_post_var)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addchoice()

assMultipleChoiceGUI::addchoice ( )

Add a new answer.

Definition at line 202 of file class.assMultipleChoiceGUI.php.

References editQuestion(), and writePostData().

202  : void
203  {
204  $this->writePostData(true);
205  $position = key($_POST['cmd']['addchoice']);
206  $this->object->addAnswer("", 0, 0, $position + 1);
207  $this->editQuestion();
208  }
editQuestion($checkonly=false)
Creates an output of the edit form for the question.
writePostData(bool $always=false)
{}
+ Here is the call graph for this function:

◆ aggregateAnswers()

assMultipleChoiceGUI::aggregateAnswers (   $relevant_answers_chosen,
  $answers_defined_on_question 
)

Definition at line 935 of file class.assMultipleChoiceGUI.php.

Referenced by getAggregatedAnswersView(), and getAnswersFrequency().

935  : array
936  {
937  $aggregate = [];
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;
942 
943  foreach ($relevant_answers_chosen as $relevant_answer) {
944  if ($relevant_answer['value1'] == $answer->getOrder()) {
945  $aggregated_info_for_answer['count_checked']++;
946  }
947  }
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'];
951 
952  $aggregate[] = $aggregated_info_for_answer;
953  }
954  return $aggregate;
955  }
+ Here is the caller graph for this function:

◆ buildEditForm()

assMultipleChoiceGUI::buildEditForm ( bool  $is_singleline = true)
protected
Returns
ilPropertyFormGUI

Definition at line 1028 of file class.assMultipleChoiceGUI.php.

References addBasicQuestionFormProperties(), assQuestionGUI\addQuestionFormCommandButtons(), ILIAS\Repository\ctrl(), assQuestionGUI\outQuestionType(), populateAnswerSpecificFormPart(), populateQuestionSpecificFormPart(), assQuestionGUI\populateTaxonomyFormSection(), ilFormGUI\setFormAction(), ilFormGUI\setId(), ilPropertyFormGUI\setTableWidth(), and ilPropertyFormGUI\setTitle().

1029  {
1030  $form = new ilPropertyFormGUI();
1031  $form->setFormAction($this->ctrl->getFormAction($this));
1032  $form->setTitle($this->outQuestionType());
1033  $form->setTableWidth("100%");
1034  $form->setId("assmultiplechoice");
1035 
1036  $this->addBasicQuestionFormProperties($form);
1037  $this->populateQuestionSpecificFormPart($form, $is_singleline);
1038  $this->populateAnswerSpecificFormPart($form, $is_singleline);
1039  $this->populateTaxonomyFormSection($form);
1040  $this->addQuestionFormCommandButtons($form);
1041  return $form;
1042  }
populateQuestionSpecificFormPart(\ilPropertyFormGUI $form, bool $is_singleline=false)
populateAnswerSpecificFormPart(\ilPropertyFormGUI $form, bool $is_singleline=false)
populateTaxonomyFormSection(ilPropertyFormGUI $form)
addQuestionFormCommandButtons(ilPropertyFormGUI $form)
addBasicQuestionFormProperties(ilPropertyFormGUI $form)
+ Here is the call graph for this function:

◆ editQuestion()

assMultipleChoiceGUI::editQuestion (   $checkonly = false)

Creates an output of the edit form for the question.

Parameters
bool$checkonly
Returns
bool

Definition at line 118 of file class.assMultipleChoiceGUI.php.

References assQuestionGUI\buildEditForm(), getEditAnswersSingleLine(), ilPropertyFormGUI\getItemByPostVar(), assQuestionGUI\getQuestionTemplate(), assQuestionGUI\isSaveCommand(), and ILIAS\Repository\lng().

Referenced by addchoice(), removechoice(), removeimagechoice(), uploadchoice(), and writePostData().

118  : bool
119  {
120  $save = $this->isSaveCommand();
121  $this->getQuestionTemplate();
122 
123  $is_singleline = $this->getEditAnswersSingleLine($checkonly);
124 
125  $form = $this->buildEditForm($is_singleline);
126 
127  if ($is_singleline) {
128  $form->setMultipart(true);
129  } else {
130  $form->setMultipart(false);
131  }
132 
133  $errors = false;
134 
135  if ($save) {
136  $form->getItemByPostVar('selection_limit')->setMaxValue(count((array) $_POST['choice']['answer']));
137 
138  $form->setValuesByPost();
139  $errors = !$this->checkMaxPointsNotNegative($form) || !$form->checkInput();
140  if ($errors) {
141  $checkonly = false;
142  }
143  }
144 
145  if (!$checkonly) {
146  $this->tpl->setVariable("QUESTION_DATA", $form->getHTML());
147  }
148  return $errors;
149  }
getEditAnswersSingleLine($checkonly=false)
Get the single/multiline editing of answers.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAfterParticipationSuppressionAnswerPostVars()

assMultipleChoiceGUI::getAfterParticipationSuppressionAnswerPostVars ( )

Returns a list of postvars which will be suppressed in the form output when used in scoring adjustment.

The form elements will be shown disabled, so the users see the usual form but can only edit the settings, which make sense in the given context.

E.g. array('cloze_type', 'image_filename')

Returns
string[]

Implements ilGuiAnswerScoringAdjustable.

Definition at line 903 of file class.assMultipleChoiceGUI.php.

903  : array
904  {
905  return [];
906  }

◆ getAfterParticipationSuppressionQuestionPostVars()

assMultipleChoiceGUI::getAfterParticipationSuppressionQuestionPostVars ( )

Returns a list of postvars which will be suppressed in the form output when used in scoring adjustment.

The form elements will be shown disabled, so the users see the usual form but can only edit the settings, which make sense in the given context.

E.g. array('cloze_type', 'image_filename')

Returns
string[]

Implements ilGuiQuestionScoringAdjustable.

Definition at line 917 of file class.assMultipleChoiceGUI.php.

917  : array
918  {
919  return [];
920  }

◆ getAggregatedAnswersView()

assMultipleChoiceGUI::getAggregatedAnswersView ( array  $relevant_answers)

Returns an html string containing a question specific representation of the answers so far given in the test for use in the right column in the scoring adjustment user interface.

Parameters
array$relevant_answers
Returns
string

Implements ilGuiQuestionScoringAdjustable.

Definition at line 928 of file class.assMultipleChoiceGUI.php.

References aggregateAnswers(), ILIAS\Repository\object(), and renderAggregateView().

928  : string
929  {
930  return $this->renderAggregateView(
931  $this->aggregateAnswers($relevant_answers, $this->object->getAnswers())
932  )->get();
933  }
aggregateAnswers($relevant_answers_chosen, $answers_defined_on_question)
+ Here is the call graph for this function:

◆ getAnswersFrequency()

assMultipleChoiceGUI::getAnswersFrequency (   $relevantAnswers,
  $questionIndex 
)

Definition at line 1044 of file class.assMultipleChoiceGUI.php.

References aggregateAnswers(), and ILIAS\Repository\object().

1044  : array
1045  {
1046  $agg = $this->aggregateAnswers($relevantAnswers, $this->object->getAnswers());
1047 
1048  $answers = [];
1049 
1050  foreach ($agg as $ans) {
1051  $answers[] = [
1052  'answer' => $ans['answertext'],
1053  'frequency' => $ans['count_checked']
1054  ];
1055  }
1056 
1057  return $answers;
1058  }
aggregateAnswers($relevant_answers_chosen, $answers_defined_on_question)
+ Here is the call graph for this function:

◆ getChoiceKeys()

assMultipleChoiceGUI::getChoiceKeys ( )

Create the key index numbers for the array of choices.

Returns
array

Definition at line 706 of file class.assMultipleChoiceGUI.php.

References ILIAS\Repository\object().

Referenced by getPreview(), getTestOutput(), and renderSolutionOutput().

706  : array
707  {
708  $choice_keys = array_keys($this->object->answers);
709 
710  if ($this->object->getShuffle()) {
711  $choice_keys = $this->object->getShuffler()->transform($choice_keys);
712  }
713 
714  return $choice_keys;
715  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getEditAnswersSingleLine()

assMultipleChoiceGUI::getEditAnswersSingleLine (   $checkonly = false)
protected

Get the single/multiline editing of answers.

  • The settings of an already saved question is preferred
  • A new question will use the setting of the last edited question by the user
    Parameters
    bool$checkonlyget the setting for checking a POST
    Returns
    bool

Definition at line 90 of file class.assMultipleChoiceGUI.php.

References ILIAS\Repository\object().

Referenced by editQuestion(), and writePostData().

90  : bool
91  {
92  if ($this->object->getSelfAssessmentEditingMode()) {
93  return $this->object->isSingleline();
94  }
95 
96  if ($checkonly) {
97  $types = $_POST['types'] ?? '0';
98  return $types === '0' ? true : false;
99  }
100 
101  $lastChange = $this->object->getLastChange();
102  if (empty($lastChange) && !isset($_POST['types'])) {
103  // a new question is edited
104  return $this->object->getMultilineAnswerSetting() ? false : true;
105  } else {
106  // a saved question is edited
107  return $this->object->isSingleline();
108  }
109  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPresentationJavascripts()

assMultipleChoiceGUI::getPresentationJavascripts ( )

Definition at line 696 of file class.assMultipleChoiceGUI.php.

696  : array
697  {
698  return ['Modules/TestQuestionPool/js/ilAssMultipleChoice.js'];
699  }

◆ getPreview()

assMultipleChoiceGUI::getPreview (   $show_question_only = false,
  $showInlineFeedback = false 
)

Definition at line 465 of file class.assMultipleChoiceGUI.php.

References assQuestionGUI\buildFocusAnchorHtml(), getChoiceKeys(), assQuestionGUI\getILIASPage(), ilUtil\getImagePath(), assQuestionGUI\getPreviewSession(), hasInlineFeedback(), ILIAS\Repository\lng(), ILIAS\Repository\object(), populateSpecificFeedbackInline(), ilLegacyFormElementsUtil\prepareFormOutput(), and ilLegacyFormElementsUtil\prepareTextareaOutput().

465  : string
466  {
467  $user_solution = is_object($this->getPreviewSession()) ? (array) $this->getPreviewSession()->getParticipantsSolution() : [];
468  // shuffle output
469  $keys = $this->getChoiceKeys();
470 
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'));
480  $template->setVariable("IMG_PREVIEW", ilUtil::getImagePath('media/enlarge.svg'));
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();
486  }
487  $alt = preg_replace("/<[^>]*?>/", "", $alt);
488  $template->setVariable("ANSWER_IMAGE_ALT", ilLegacyFormElementsUtil::prepareFormOutput($alt));
489  $template->setVariable("ANSWER_IMAGE_TITLE", ilLegacyFormElementsUtil::prepareFormOutput($alt));
490  $template->parseCurrentBlock();
491  } else {
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();
498  }
499  $alt = preg_replace("/<[^>]*?>/", "", $alt);
500  $template->setVariable("ATTR", $attr);
501  $template->setVariable("ANSWER_IMAGE_ALT", ilLegacyFormElementsUtil::prepareFormOutput($alt));
502  $template->setVariable("ANSWER_IMAGE_TITLE", ilLegacyFormElementsUtil::prepareFormOutput($alt));
503  $template->parseCurrentBlock();
504  }
505  }
506 
507  if ($showInlineFeedback) {
508  $this->populateSpecificFeedbackInline($user_solution, $answer_id, $template);
509  }
510 
511  $template->setCurrentBlock("answer_row");
512  $template->setVariable("QID", $this->object->getId());
513  $template->setVariable("ANSWER_ID", $answer_id);
514  $template->setVariable("ANSWER_TEXT", ilLegacyFormElementsUtil::prepareTextareaOutput($answer->getAnswertext(), true));
515  foreach ($user_solution as $mc_solution) {
516  if ((string) $mc_solution === (string) $answer_id) {
517  $template->setVariable("CHECKED_ANSWER", " checked=\"checked\"");
518  }
519  }
520  $template->parseCurrentBlock();
521  }
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()
527  ));
528 
529  $template->setVariable('SELECTION_LIMIT_VALUE', $this->object->getSelectionLimit());
530  } else {
531  $template->setVariable('SELECTION_LIMIT_VALUE', 'null');
532  }
533  $template->setVariable("QUESTION_ID", $this->object->getId());
534  $questiontext = $this->object->getQuestionForHTMLOutput();
535  if ($showInlineFeedback && $this->hasInlineFeedback()) {
536  $questiontext .= $this->buildFocusAnchorHtml();
537  }
538  $template->setVariable("QUESTIONTEXT", ilLegacyFormElementsUtil::prepareTextareaOutput($questiontext, true));
539  $questionoutput = $template->get();
540  if (!$show_question_only) {
541  // get page object output
542  $questionoutput = $this->getILIASPage($questionoutput);
543  }
544  return $questionoutput;
545  }
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)
static prepareFormOutput($a_str, bool $a_strip=false)
getILIASPage(string $html="")
Returns the ILIAS Page around a question.
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...
populateSpecificFeedbackInline($user_solution, $answer_id, $template)
+ Here is the call graph for this function:

◆ getSolutionOutput()

assMultipleChoiceGUI::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.

Parameters
integer$active_idThe active user id
integer$passThe test pass
boolean$graphicalOutputShow visual feedback for right/wrong answers
boolean$result_outputShow the reached points for parts of the question
boolean$show_question_onlyShow the question without the ILIAS content around
boolean$show_feedbackShow the question feedback
boolean$show_correct_solutionShow the correct solution instead of the user solution
boolean$show_manual_scoringShow specific information for the manual scoring output
bool$show_question_text
Returns
string The solution output of the question as HTML code

Definition at line 234 of file class.assMultipleChoiceGUI.php.

References ILIAS\Repository\object(), and renderSolutionOutput().

245  : string {
246  if ($active_id > 0 && !$show_correct_solution) {
247  $user_solution = $this->object->getSolutionValues($active_id, $pass);
248  } else {
249  $user_solution = [];
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];
255  }
256  }
257  }
258 
259  return $this->renderSolutionOutput(
260  $user_solution,
261  $active_id,
262  $pass,
263  $graphicalOutput,
264  $result_output,
265  $show_question_only,
266  $show_feedback,
267  $show_correct_solution,
268  $show_manual_scoring,
269  $show_question_text,
270  false,
271  $show_inline_feedback,
272  );
273  }
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,)
+ Here is the call graph for this function:

◆ getSpecificFeedbackOutput()

assMultipleChoiceGUI::getSpecificFeedbackOutput ( array  $userSolution)

Definition at line 717 of file class.assMultipleChoiceGUI.php.

References ilLegacyFormElementsUtil\prepareTextareaOutput().

717  : string
718  {
719  // No return value, this question type supports inline specific feedback.
720  $output = "";
722  }
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...
+ Here is the call graph for this function:

◆ getTestOutput()

assMultipleChoiceGUI::getTestOutput (   $active_id,
  $pass,
  $is_postponed = false,
  $use_post_solutions = false,
  $show_feedback = false 
)
Parameters
integer$active_id
integer | null$pass
bool$is_postponed
bool$use_post_solutions
bool$show_feedback
Returns
string

Definition at line 556 of file class.assMultipleChoiceGUI.php.

References getChoiceKeys(), ilUtil\getImagePath(), ILIAS\Repository\lng(), ILIAS\Repository\object(), assQuestionGUI\outQuestionPage(), populateSpecificFeedbackInline(), ilLegacyFormElementsUtil\prepareFormOutput(), ilLegacyFormElementsUtil\prepareTextareaOutput(), and setUseEmptySolutionInputChecked().

564  : string {
565  // shuffle output
566  $keys = $this->getChoiceKeys();
567 
568  // get the solution of the user for the active pass or from the last pass if allowed
569  $user_solution = [];
570  if ($active_id) {
571  $solutions = $this->object->getTestOutputSolutions($active_id, $pass);
572  // hey.
573  foreach ($solutions as $idx => $solution_value) {
574  // fau: testNav - don't add the dummy entry for 'none of the above' to the user options
575  if ($solution_value['value1'] == 'mc_none_above') {
576  $this->setUseEmptySolutionInputChecked(true);
577  continue;
578  }
579 
580  $user_solution[] = $solution_value['value1'];
581  // fau.
582  }
583 
584  if (empty($user_solution) && $this->object->getTestPresentationConfig()->isWorkedThrough()) {
585  $this->setUseEmptySolutionInputChecked(true);
586  }
587  }
588  // generate the question output
589  $this->tpl->addJavaScript('Modules/TestQuestionPool/js/ilAssMultipleChoice.js');
590  $this->tpl->addOnLoadCode('ilAssMultipleChoiceCharCounterInit();');
591 
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'));
600  $template->setVariable("IMG_PREVIEW", ilUtil::getImagePath('media/enlarge.svg'));
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();
606  }
607  $alt = preg_replace("/<[^>]*?>/", "", $alt);
608  $template->setVariable("ANSWER_IMAGE_ALT", ilLegacyFormElementsUtil::prepareFormOutput($alt));
609  $template->setVariable("ANSWER_IMAGE_TITLE", ilLegacyFormElementsUtil::prepareFormOutput($alt));
610  $template->parseCurrentBlock();
611  } else {
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();
618  }
619  $alt = preg_replace("/<[^>]*?>/", "", $alt);
620  $template->setVariable("ATTR", $attr);
621  $template->setVariable("ANSWER_IMAGE_ALT", ilLegacyFormElementsUtil::prepareFormOutput($alt));
622  $template->setVariable("ANSWER_IMAGE_TITLE", ilLegacyFormElementsUtil::prepareFormOutput($alt));
623  $template->parseCurrentBlock();
624  }
625  }
626 
627  if ($show_feedback) {
628  $this->populateSpecificFeedbackInline($user_solution, $answer_id, $template);
629  }
630 
631  $template->setCurrentBlock("answer_row");
632  $template->setVariable("QID", $this->object->getId());
633  $template->setVariable("ANSWER_ID", $answer_id);
634  $template->setVariable("ANSWER_TEXT", ilLegacyFormElementsUtil::prepareTextareaOutput($answer->getAnswertext(), true));
635  foreach ($user_solution as $mc_solution) {
636  if ((string) $mc_solution === (string) $answer_id) {
637  $template->setVariable("CHECKED_ANSWER", " checked=\"checked\"");
638  }
639  }
640  $template->parseCurrentBlock();
641  }
642 
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()
650  ));
651 
652  $template->setVariable('SELECTION_LIMIT_VALUE', $this->object->getSelectionLimit());
653  } else {
654  $template->setVariable('SELECTION_LIMIT_VALUE', 'null');
655  }
656  $questionoutput = $template->get();
657  $pageoutput = $this->outQuestionPage("", $is_postponed, $active_id, $questionoutput, $show_feedback);
658  return $pageoutput;
659  }
setUseEmptySolutionInputChecked($useEmptySolutionInputChecked)
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)
static prepareFormOutput($a_str, bool $a_strip=false)
outQuestionPage($a_temp_var, $a_postponed=false, $active_id="", $html="", $inlineFeedbackEnabled=false)
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...
populateSpecificFeedbackInline($user_solution, $answer_id, $template)
+ Here is the call graph for this function:

◆ getUseUnchangedAnswerCheckboxHtml()

assMultipleChoiceGUI::getUseUnchangedAnswerCheckboxHtml ( )
protected

Definition at line 673 of file class.assMultipleChoiceGUI.php.

References assQuestionGUI\$tpl, ilGlobalPageTemplate\get(), isUseEmptySolutionInputChecked(), ILIAS\Repository\object(), ilGlobalPageTemplate\parseCurrentBlock(), ilGlobalPageTemplate\setCurrentBlock(), ilGlobalPageTemplate\setVariable(), and ilGlobalPageTemplate\touchBlock().

673  : string
674  {
675  // hey: prevPassSolutions - use abstracted template to share with other purposes of this kind
676  $this->tpl->addJavaScript('Modules/TestQuestionPool/js/ilAssMultipleChoice.js');
677 
678  $tpl = new ilTemplate('tpl.tst_question_additional_behaviour_checkbox.html', true, true, 'Modules/TestQuestionPool');
679 
680  // HEY: affects next if (!) /// noneAboveChecked repaired but disabled because the checked input ..
681  if (false) { // .. makes the qstEditController initialize the "edit" instead of the "answered" state
682  if ($this->isUseEmptySolutionInputChecked()) {
683  $tpl->setCurrentBlock('checked');
684  $tpl->touchBlock('checked');
686  }
687  }
688 
689  $tpl->setCurrentBlock('checkbox');
690  $tpl->setVariable('TXT_FORCE_FORM_DIFF_LABEL', $this->object->getTestPresentationConfig()->getUseUnchangedAnswerLabel());
692  // hey.
693  return $tpl->get();
694  }
setCurrentBlock(string $blockname=self::DEFAULT_BLOCK)
Sets the template to the given block.
parseCurrentBlock(string $blockname=self::DEFAULT_BLOCK)
Parses the given block.
ilGlobalPageTemplate $tpl
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
touchBlock(string $blockname)
overwrites ITX::touchBlock.
setVariable(string $variable, $value='')
Sets the given variable to the given value.
+ Here is the call graph for this function:

◆ hasInlineFeedback()

assMultipleChoiceGUI::hasInlineFeedback ( )
Returns
bool

Definition at line 59 of file class.assMultipleChoiceGUI.php.

References ILIAS\Repository\object().

Referenced by getPreview(), and renderSolutionOutput().

59  : bool
60  {
61  return $this->object->feedbackOBJ->isSpecificAnswerFeedbackAvailable($this->object->getId());
62  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isUseEmptySolutionInputChecked()

assMultipleChoiceGUI::isUseEmptySolutionInputChecked ( )

Definition at line 663 of file class.assMultipleChoiceGUI.php.

References $useEmptySolutionInputChecked.

Referenced by getUseUnchangedAnswerCheckboxHtml().

663  : bool
664  {
666  }
+ Here is the caller graph for this function:

◆ populateAnswerSpecificFormPart()

assMultipleChoiceGUI::populateAnswerSpecificFormPart ( \ilPropertyFormGUI  $form,
bool  $is_singleline = false 
)

Definition at line 870 of file class.assMultipleChoiceGUI.php.

References ilPropertyFormGUI\addItem(), ILIAS\Repository\lng(), ILIAS\Repository\object(), and ilFormPropertyGUI\setRequired().

Referenced by buildEditForm().

871  {
872  $choices = new ilMultipleChoiceWizardInputGUI($this->lng->txt("answers"), "choice");
873  $choices->setRequired(true);
874  $choices->setQuestionObject($this->object);
875  $choices->setSingleline($is_singleline);
876  $choices->setAllowMove(false);
877  if ($this->object->getSelfAssessmentEditingMode()) {
878  $choices->setSize(40);
879  }
880  if ($this->object->getAnswerCount() == 0) {
881  $this->object->addAnswer("", 0, 0, 0);
882  }
883  $choices->setValues(array_map(
884  function (ASS_AnswerMultipleResponseImage $value) {
885  $value->setAnswerText(html_entity_decode($value->getAnswerText()));
886  return $value;
887  },
888  $this->object->getAnswers()
889  ));
890  $form->addItem($choices);
891  return $form;
892  }
ASS_AnswerBinaryStateImage is a class for answers with a binary state indicator (checked/unchecked, set/unset) and an image file.
setRequired(bool $a_required)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateCorrectionsFormProperties()

assMultipleChoiceGUI::populateCorrectionsFormProperties ( ilPropertyFormGUI  $form)

Definition at line 1060 of file class.assMultipleChoiceGUI.php.

References ilPropertyFormGUI\addItem(), ILIAS\Repository\lng(), ILIAS\Repository\object(), and ilFormPropertyGUI\setRequired().

1060  : void
1061  {
1062  $choices = new ilAssMultipleChoiceCorrectionsInputGUI($this->lng->txt("answers"), "choice");
1063  $choices->setRequired(true);
1064  $choices->setQuestionObject($this->object);
1065  $choices->setValues($this->object->getAnswers());
1066  $form->addItem($choices);
1067  }
setRequired(bool $a_required)
+ Here is the call graph for this function:

◆ populateQuestionSpecificFormPart()

assMultipleChoiceGUI::populateQuestionSpecificFormPart ( \ilPropertyFormGUI  $form,
bool  $is_singleline = false 
)

Definition at line 811 of file class.assMultipleChoiceGUI.php.

References ilPropertyFormGUI\addItem(), ILIAS\Repository\lng(), ILIAS\Repository\object(), and ilFormPropertyGUI\setRequired().

Referenced by buildEditForm().

812  {
813  // shuffle
814  $shuffle = new ilCheckboxInputGUI($this->lng->txt("shuffle_answers"), "shuffle");
815  $shuffle->setValue(1);
816  $shuffle->setChecked($this->object->getShuffle());
817  $shuffle->setRequired(false);
818  $form->addItem($shuffle);
819 
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'));
822  $selLim->setSize(2);
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());
830  $form->addItem($selLim);
831 
832  if ($this->object->getId()) {
833  $hidden = new ilHiddenInputGUI("ID");
834  $hidden->setValue($this->object->getId());
835  $form->addItem($hidden);
836  }
837 
838  if (!$this->object->getSelfAssessmentEditingMode()) {
839  // Answer types
840  $types = new ilSelectInputGUI($this->lng->txt("answer_types"), "types");
841  $types->setRequired(false);
842  $types->setValue(($is_singleline) ? 0 : 1);
843  $types->setOptions([
844  0 => $this->lng->txt('answers_singleline'),
845  1 => $this->lng->txt('answers_multiline'),
846  ]);
847  $form->addItem($types);
848  }
849 
850  if ($is_singleline) {
851  // thumb size
852  $thumb_size = new ilNumberInputGUI($this->lng->txt('thumb_size'), "thumb_size");
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);
861  } else {
862  $thumb_size = new ilHiddenInputGUI('thumb_size');
863  $thumb_size->setValue($this->object->getThumbSize());
864  }
865  $form->addItem($thumb_size);
866 
867  return $form;
868  }
This class represents a selection list property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setRequired(bool $a_required)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateSpecificFeedbackInline()

assMultipleChoiceGUI::populateSpecificFeedbackInline (   $user_solution,
  $answer_id,
  $template 
)
private

Definition at line 983 of file class.assMultipleChoiceGUI.php.

References ILIAS\Repository\object(), and ilLegacyFormElementsUtil\prepareTextareaOutput().

Referenced by getPreview(), and getTestOutput().

983  : void
984  {
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);
989  if (strlen($fb)) {
990  $template->setCurrentBlock("feedback");
991  $template->setVariable("FEEDBACK", ilLegacyFormElementsUtil::prepareTextareaOutput($fb, true));
992  $template->parseCurrentBlock();
993  }
994  }
995  }
996  }
997 
998  if ($this->object->getSpecificFeedbackSetting() == 1) {
999  $fb = $this->object->feedbackOBJ->getSpecificAnswerFeedbackTestPresentation($this->object->getId(), 0, $answer_id);
1000  if (strlen($fb)) {
1001  $template->setCurrentBlock("feedback");
1002  $template->setVariable("FEEDBACK", ilLegacyFormElementsUtil::prepareTextareaOutput($fb, true));
1003  $template->parseCurrentBlock();
1004  }
1005  }
1006 
1007  if ($this->object->getSpecificFeedbackSetting() == 3) {
1008  $answer = $this->object->getAnswer($answer_id);
1009 
1010  if ($answer->getPoints() > 0) {
1011  $fb = $this->object->feedbackOBJ->getSpecificAnswerFeedbackTestPresentation($this->object->getId(), 0, $answer_id);
1012  if (strlen($fb)) {
1013  $template->setCurrentBlock("feedback");
1014  $template->setVariable("FEEDBACK", ilLegacyFormElementsUtil::prepareTextareaOutput($fb, true));
1015  $template->parseCurrentBlock();
1016  }
1017  }
1018  }
1019  }
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...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removechoice()

assMultipleChoiceGUI::removechoice ( )

Remove an answer.

Definition at line 213 of file class.assMultipleChoiceGUI.php.

References editQuestion(), and writePostData().

213  : void
214  {
215  $this->writePostData(true);
216  $position = key($_POST['cmd']['removechoice']);
217  $this->object->deleteAnswer($position);
218  $this->editQuestion();
219  }
editQuestion($checkonly=false)
Creates an output of the edit form for the question.
writePostData(bool $always=false)
{}
+ Here is the call graph for this function:

◆ removeimagechoice()

assMultipleChoiceGUI::removeimagechoice ( )

Remove an image.

Definition at line 191 of file class.assMultipleChoiceGUI.php.

References editQuestion(), and writePostData().

191  : void
192  {
193  $this->writePostData(true);
194  $position = key($_POST['cmd']['removeimagechoice']);
195  $this->object->removeAnswerImage($position);
196  $this->editQuestion();
197  }
editQuestion($checkonly=false)
Creates an output of the edit form for the question.
writePostData(bool $always=false)
{}
+ Here is the call graph for this function:

◆ renderAggregateView()

assMultipleChoiceGUI::renderAggregateView (   $aggregate)
Parameters
$aggregate
Returns
ilTemplate

Definition at line 962 of file class.assMultipleChoiceGUI.php.

References assQuestionGUI\$tpl, ILIAS\Repository\lng(), ilGlobalPageTemplate\parseCurrentBlock(), ilGlobalPageTemplate\setCurrentBlock(), and ilGlobalPageTemplate\setVariable().

Referenced by getAggregatedAnswersView().

962  : ilTemplate
963  {
964  $tpl = new ilTemplate('tpl.il_as_aggregated_answers_table.html', true, true, "Modules/TestQuestionPool");
965 
966  $tpl->setCurrentBlock('headercell');
967  $tpl->setVariable('HEADER', $this->lng->txt('tst_answer_aggr_answer_header'));
969 
970  $tpl->setCurrentBlock('headercell');
971  $tpl->setVariable('HEADER', $this->lng->txt('tst_answer_aggr_frequency_header'));
973 
974  foreach ($aggregate as $line_data) {
975  $tpl->setCurrentBlock('aggregaterow');
976  $tpl->setVariable('OPTION', $line_data['answertext']);
977  $tpl->setVariable('COUNT', $line_data['count_checked']);
979  }
980  return $tpl;
981  }
setCurrentBlock(string $blockname=self::DEFAULT_BLOCK)
Sets the template to the given block.
parseCurrentBlock(string $blockname=self::DEFAULT_BLOCK)
Parses the given block.
ilGlobalPageTemplate $tpl
setVariable(string $variable, $value='')
Sets the given variable to the given value.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderSolutionOutput()

assMultipleChoiceGUI::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 
)

Definition at line 275 of file class.assMultipleChoiceGUI.php.

References assQuestionGUI\buildFocusAnchorHtml(), ilAssQuestionFeedback\CSS_CLASS_FEEDBACK_CORRECT, ilAssQuestionFeedback\CSS_CLASS_FEEDBACK_WRONG, assQuestionGUI\generateCorrectnessIconsForCorrectness(), getChoiceKeys(), assQuestionGUI\getGenericFeedbackOutput(), ilUtil\getHtmlPath(), assQuestionGUI\getILIASPage(), ilUtil\getImagePath(), assQuestionGUI\hasCorrectSolution(), hasInlineFeedback(), assQuestionGUI\isRenderPurposePrintPdf(), assQuestionGUI\isTestPresentationContext(), ILIAS\Repository\lng(), ILIAS\Repository\object(), ilLegacyFormElementsUtil\prepareFormOutput(), ilLegacyFormElementsUtil\prepareTextareaOutput(), and assQuestionGUI\renderPurposeSupportsFormHtml().

Referenced by getSolutionOutput().

288  : ?string {
289  $user_solution = [];
290 
291  foreach ($user_solutions as $idx => $solution_value) {
292  array_push($user_solution, $solution_value['value1']);
293  }
294 
295  $keys = $this->getChoiceKeys();
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) {
302  // output of ok/not ok icons for user entered solutions
303  $ok = false;
304  $checked = false;
305  foreach ($user_solution as $mc_solution) {
306  if ((string) $mc_solution === (string) $answer_id) {
307  $checked = true;
308  }
309  }
310  if ($checked) {
311  if ($answer->getPointsChecked() > $answer->getPointsUnchecked()) {
312  $ok = self::CORRECTNESS_OK;
313  } else {
314  $ok = self::CORRECTNESS_NOT_OK;
315  }
316  } else {
317  if ($answer->getPointsChecked() > $answer->getPointsUnchecked()) {
318  $ok = self::CORRECTNESS_NOT_OK;
319  } else {
320  $ok = self::CORRECTNESS_OK;
321  }
322  }
323  $icon = $this->generateCorrectnessIconsForCorrectness($ok);
324  $template->setCurrentBlock("icon_ok");
325  $template->setVariable("ICON_OK", $icon);
326  $template->parseCurrentBlock();
327  }
328  }
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());
333  } else {
334  $template->setVariable("ANSWER_IMAGE_URL", $this->object->getImagePathWeb() . $answer->getImage());
335  }
336  $alt = $answer->getImage();
337  if (strlen($answer->getAnswertext())) {
338  $alt = $answer->getAnswertext();
339  }
340  $alt = preg_replace("/<[^>]*?>/", "", $alt);
341  $template->setVariable("ANSWER_IMAGE_ALT", ilLegacyFormElementsUtil::prepareFormOutput($alt));
342  $template->setVariable("ANSWER_IMAGE_TITLE", ilLegacyFormElementsUtil::prepareFormOutput($alt));
343  $template->parseCurrentBlock();
344  }
345 
346 
347  if (($show_feedback || !$this->isTestPresentationContext()) && $show_inline_feedback) {
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(
352  $this->object->getId(),
353  0,
354  $answer_id
355  );
356  if (strlen($fb)) {
357  $template->setCurrentBlock("feedback");
358  $template->setVariable("FEEDBACK", ilLegacyFormElementsUtil::prepareTextareaOutput($fb, true));
359  $template->parseCurrentBlock();
360  }
361  }
362  }
363  }
364 
365  if ($this->object->getSpecificFeedbackSetting() == 1) {
366  $fb = $this->object->feedbackOBJ->getSpecificAnswerFeedbackTestPresentation(
367  $this->object->getId(),
368  0,
369  $answer_id
370  );
371  if (strlen($fb)) {
372  $template->setCurrentBlock("feedback");
373  $template->setVariable("FEEDBACK", ilLegacyFormElementsUtil::prepareTextareaOutput($fb, true));
374  $template->parseCurrentBlock();
375  }
376  }
377  }
378  if ($show_feedback) {
379  if ($this->object->getSpecificFeedbackSetting() == 3) {
380  $answer = $this->object->getAnswer($answer_id);
381 
382  if ($answer->getPoints() > 0) {
383  $fb = $this->object->feedbackOBJ->getSpecificAnswerFeedbackTestPresentation(
384  $this->object->getId(),
385  0,
386  $answer_id
387  );
388  if (strlen($fb)) {
389  $template->setCurrentBlock("feedback");
390  $template->setVariable("FEEDBACK", ilLegacyFormElementsUtil::prepareTextareaOutput($fb, true));
391  $template->parseCurrentBlock();
392  }
393  }
394  }
395  }
396 
397 
398 
399  $template->setCurrentBlock("answer_row");
400  $template->setVariable("ANSWER_TEXT", ilLegacyFormElementsUtil::prepareTextareaOutput($answer->getAnswertext(), true));
401  $checked = false;
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));
408  }
409  foreach ($user_solution as $mc_solution) {
410  if ((string) $mc_solution === (string) $answer_id) {
411  if ($this->renderPurposeSupportsFormHtml() || $this->isRenderPurposePrintPdf()) {
412  $template->setVariable("SOLUTION_IMAGE", ilUtil::getHtmlPath(ilUtil::getImagePath("object/checkbox_checked.png")));
413  $template->setVariable("SOLUTION_ALT", $this->lng->txt("checked"));
414  } else {
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');
419  }
420  $checked = true;
421  }
422  }
423  if (!$checked) {
424  if ($this->renderPurposeSupportsFormHtml() || $this->isRenderPurposePrintPdf()) {
425  $template->setVariable("SOLUTION_IMAGE", ilUtil::getHtmlPath(ilUtil::getImagePath("object/checkbox_unchecked.png")));
426  $template->setVariable("SOLUTION_ALT", $this->lng->txt("unchecked"));
427  } else {
428  $template->setVariable('QID', $this->object->getId());
429  $template->setVariable('SUFFIX', $show_correct_solution ? 'bestsolution' : 'usersolution');
430  $template->setVariable('SOLUTION_VALUE', $answer_id);
431  }
432  }
433  $template->parseCurrentBlock();
434  }
435  $questiontext = $this->object->getQuestionForHTMLOutput();
436  if ($show_feedback && $this->hasInlineFeedback()) {
437  $questiontext .= $this->buildFocusAnchorHtml();
438  }
439  if ($show_question_text == true) {
440  $template->setVariable("QUESTIONTEXT", ilLegacyFormElementsUtil::prepareTextareaOutput($questiontext, true));
441  }
442  $questionoutput = $template->get();
443  $feedback = ($show_feedback && !$this->isTestPresentationContext()) ? $this->getGenericFeedbackOutput((int) $active_id, $pass) : "";
444 
445  if (strlen($feedback)) {
446  $cssClass = (
447  $this->hasCorrectSolution($active_id, $pass) ?
449  );
450 
451  $solutiontemplate->setVariable("ILC_FB_CSS_CLASS", $cssClass);
452  $solutiontemplate->setVariable("FEEDBACK", ilLegacyFormElementsUtil::prepareTextareaOutput($feedback, true));
453  }
454  $solutiontemplate->setVariable("SOLUTION_OUTPUT", $questionoutput);
455 
456  $solutionoutput = $solutiontemplate->get();
457 
458  if (!$show_question_only) {
459  // get page object output
460  $solutionoutput = $this->getILIASPage($solutionoutput);
461  }
462  return $solutionoutput;
463  }
hasCorrectSolution($activeId, $passIndex)
generateCorrectnessIconsForCorrectness(int $correctness)
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)
static prepareFormOutput($a_str, bool $a_strip=false)
static getHtmlPath(string $relative_path)
get url of path
getILIASPage(string $html="")
Returns the ILIAS Page around a question.
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...
getGenericFeedbackOutput(int $active_id, ?int $pass)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveCorrectionsFormProperties()

assMultipleChoiceGUI::saveCorrectionsFormProperties ( ilPropertyFormGUI  $form)
Parameters
ilPropertyFormGUI$form

Definition at line 1072 of file class.assMultipleChoiceGUI.php.

References ilPropertyFormGUI\getItemByPostVar(), and ILIAS\Repository\object().

1072  : void
1073  {
1074  $input = $form->getItemByPostVar('choice');
1075  $answerElements = $input->getValues();
1076 
1077  foreach ($this->object->getAnswers() as $index => $answer) {
1078  /* @var ASS_AnswerMultipleResponseImage $answer */
1079  $answer->setPointsChecked((float) str_replace(',', '.', $answerElements[$index]->getPointsChecked()));
1080  $answer->setPointsUnchecked((float) str_replace(',', '.', $answerElements[$index]->getPointsUnchecked()));
1081  }
1082  }
getItemByPostVar(string $a_post_var)
+ Here is the call graph for this function:

◆ setUseEmptySolutionInputChecked()

assMultipleChoiceGUI::setUseEmptySolutionInputChecked (   $useEmptySolutionInputChecked)

Definition at line 668 of file class.assMultipleChoiceGUI.php.

References $useEmptySolutionInputChecked.

Referenced by getTestOutput().

668  : void
669  {
670  $this->useEmptySolutionInputChecked = $useEmptySolutionInputChecked;
671  }
+ Here is the caller graph for this function:

◆ uploadchoice()

assMultipleChoiceGUI::uploadchoice ( )

Upload an image.

Definition at line 182 of file class.assMultipleChoiceGUI.php.

References editQuestion(), and writePostData().

182  : void
183  {
184  $this->writePostData(true);
185  $this->editQuestion();
186  }
editQuestion($checkonly=false)
Creates an output of the edit form for the question.
writePostData(bool $always=false)
{}
+ Here is the call graph for this function:

◆ writeAnswerSpecificPostData()

assMultipleChoiceGUI::writeAnswerSpecificPostData ( ilPropertyFormGUI  $form)

Extracts the answer specific values from $_POST and applies them to the data object.

Implements ilGuiAnswerScoringAdjustable.

Definition at line 750 of file class.assMultipleChoiceGUI.php.

References $filename, $parts, assQuestionGUI\cleanupAnswerText(), and ILIAS\Repository\object().

Referenced by writePostData().

750  : void
751  {
752  // Delete all existing answers and create new answers from the form data
753  $this->object->flushAnswers();
754  $choice = $this->cleanupAnswerText($_POST['choice'], $this->object->isSingleline() === false);
755  if (!$this->object->isSingleline()) {
756  foreach ($choice['answer'] as $index => $answer) {
757  $answertext = $answer;
758  $this->object->addAnswer(
759  $answertext,
760  (float) str_replace(',', '.', $choice['points'][$index]),
761  (float) str_replace(',', '.', $choice['points_unchecked'][$index]),
762  $index,
763  null,
764  (int) $choice['answer_id'][$index]
765  );
766  }
767  return;
768  }
769 
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] ?? '';
775 
776  if ($file_temp_name !== '') {
777  // check suffix
778  $parts = explode(".", $file_org_name);
779  $suffix = strtolower(array_pop($parts));
780  if (in_array($suffix, ["jpg", "jpeg", "png", "gif"])) {
781  // upload image
782  $filename = $this->object->buildHashedImageFilename($file_org_name);
783  if ($this->object->setImageFile($filename, $file_temp_name) == 0) {
784  $picturefile = $filename;
785  }
786  }
787  }
788 
789  $this->object->addAnswer(
790  $answertext,
791  (float) str_replace(',', '.', $choice['points'][$index]),
792  (float) str_replace(',', '.', $choice['points_unchecked'][$index]),
793  $index,
794  $picturefile,
795  $choice['answer_id'][$index]
796  );
797  }
798 
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()
806  )
807  );
808  }
809  }
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
Definition: ltitoken.php:64
$filename
Definition: buildRTE.php:78
cleanupAnswerText(array $answer_text, bool $is_rte)
sk - 12.05.2023: This is one more of those that we need, but don&#39;t want.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ writePostData()

assMultipleChoiceGUI::writePostData ( bool  $always = false)
protected

{}

Definition at line 67 of file class.assMultipleChoiceGUI.php.

References assQuestionGUI\buildEditForm(), editQuestion(), getEditAnswersSingleLine(), assQuestionGUI\saveTaxonomyAssignments(), writeAnswerSpecificPostData(), assQuestionGUI\writeQuestionGenericPostData(), and writeQuestionSpecificPostData().

Referenced by addchoice(), removechoice(), removeimagechoice(), and uploadchoice().

67  : int
68  {
69  $hasErrors = (!$always) ? $this->editQuestion(true) : false;
70  if (!$hasErrors) {
71  $is_singleline = $this->getEditAnswersSingleLine();
72  $form = $this->buildEditForm($is_singleline);
73  $form->setValuesByPost();
75  $this->writeQuestionSpecificPostData($form);
76  $this->writeAnswerSpecificPostData($form);
77  $this->saveTaxonomyAssignments();
78  return 0;
79  }
80  return 1;
81  }
editQuestion($checkonly=false)
Creates an output of the edit form for the question.
writeAnswerSpecificPostData(ilPropertyFormGUI $form)
Extracts the answer specific values from $_POST and applies them to the data object.
writeQuestionSpecificPostData(ilPropertyFormGUI $form)
Extracts the question specific values from $_POST and applies them to the data object.
getEditAnswersSingleLine($checkonly=false)
Get the single/multiline editing of answers.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ writeQuestionSpecificPostData()

assMultipleChoiceGUI::writeQuestionSpecificPostData ( ilPropertyFormGUI  $form)

Extracts the question specific values from $_POST and applies them to the data object.

Implements ilGuiQuestionScoringAdjustable.

Definition at line 724 of file class.assMultipleChoiceGUI.php.

References ilPropertyFormGUI\getItemByPostVar(), ILIAS\Repository\int(), ILIAS\Repository\lng(), and ILIAS\Repository\object().

Referenced by writePostData().

724  : void
725  {
726  $this->object->setShuffle($_POST["shuffle"] ?? '0');
727 
728  $selectionLimit = (int) $form->getItemByPostVar('selection_limit')->getValue();
729  $this->object->setSelectionLimit($selectionLimit > 0 ? $selectionLimit : null);
730 
731  if (isset($_POST['feedback_setting'])) {
732  $this->object->setSpecificFeedbackSetting($_POST['feedback_setting']);
733  }
734 
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);
740  } else {
741  $this->object->setIsSingleline(($types === 0) ? true : false);
742  }
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;
747  }
748  }
getItemByPostVar(string $a_post_var)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $rebuild_thumbnails

bool assMultipleChoiceGUI::$rebuild_thumbnails = false
private

Definition at line 37 of file class.assMultipleChoiceGUI.php.

◆ $useEmptySolutionInputChecked

assMultipleChoiceGUI::$useEmptySolutionInputChecked = false
protected

The documentation for this class was generated from the following file: