ILIAS  release_8 Revision v8.24
assLongMenuGUI Class Reference
+ Inheritance diagram for assLongMenuGUI:
+ Collaboration diagram for assLongMenuGUI:

Public Member Functions

 __construct ($id=-1)
 
 getCommand ($cmd)
 
 writeQuestionSpecificPostData (ilPropertyFormGUI $form)
 Extracts the question specific values from $_POST and applies them to the data object. More...
 
 populateQuestionSpecificFormPart (ilPropertyFormGUI $form)
 
 populateAnswerSpecificFormPart (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)
 Get the question solution output. More...
 
 getPreview ($show_question_only=false, $showInlineFeedback=false)
 
 getTestOutput ( $active_id, $pass, $is_postponed=false, $use_post_solutions=false, $show_feedback=false)
 
 getSpecificFeedbackOutput (array $userSolution)
 Returns the answer specific feedback for the question. 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...
 
 getLongMenuTextWithInputFieldsInsteadOfGaps ($user_solution=array(), $solution=false, $graphical=false)
 
 getSubQuestionsIndex ()
 
 getAnswersFrequency ($relevantAnswers, $questionIndex)
 
 getAnswerFrequencyTableGUI ($parentGui, $parentCmd, $relevantAnswers, $questionIndex)
 
 populateCorrectionsFormProperties (ilPropertyFormGUI $form)
 
 saveCorrectionsFormProperties (ilPropertyFormGUI $form)
 
- Public Member Functions inherited from assQuestionGUI
 hasInlineFeedback ()
 
 addHeaderAction ()
 
 redrawHeaderAction ()
 
 getHeaderAction ()
 
 getNotesHTML ()
 
 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)
 
 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)
 
 populateQuestionSpecificFormPart (ilPropertyFormGUI $form)
 Adds the question specific forms parts to a question property form gui. More...
 
 writeQuestionSpecificPostData (ilPropertyFormGUI $form)
 Extracts the question specific values from $_POST and applies them to the data object. 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...
 

Protected Member Functions

 getUserSolution ($active_id, $pass)
 
 writePostData (bool $always=false)
 {Evaluates a posted edit form and writes the form data in the question object.
Returns
integer A positive value, if one of the required fields wasn't set, else 0
} More...
 
 editQuestion (ilPropertyFormGUI $form=null)
 
 buildEditForm ()
 
 getTemplateForPreviewAndTest (array $user_solution)
 
- 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)
 
 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)
 
 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 ()
 

Private Member Functions

 verifyAnswerOptions ()
 
 stripSlashesRecursive (array $data)
 
 trimArrayRecursive (array $data)
 
 getTextGapTemplate ($key, $value, $solution, $ok=false, $graphical=false)
 
 getSelectGapTemplate ($key, $answers, $user_value, $solution, $ok=false, $graphical=false)
 

Private Attributes

 $ilTabs
 

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 ($txt_output, $prepare_for_latex_output=false, $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'
 
- Protected Attributes inherited from assQuestionGUI
const SUGGESTED_SOLUTION_COMMANDS
 
const HAS_SPECIAL_QUESTION_COMMANDS = false
 
ILIAS Notes GUIService $notes_gui
 
ilCtrl $ctrl
 
ilPropertyFormGUI $editForm
 
ILIAS TestQuestionPool InternalRequestService $request
 

Detailed Description

Definition at line 28 of file class.assLongMenuGUI.php.

Constructor & Destructor Documentation

◆ __construct()

assLongMenuGUI::__construct (   $id = -1)

Definition at line 32 of file class.assLongMenuGUI.php.

33 {
35 include_once './Modules/TestQuestionPool/classes/class.assLongMenu.php';
36 $this->object = new assLongMenu();
37 if ($id >= 0) {
38 $this->object->loadFromDb($id);
39 }
40 global $DIC;
41 $ilTabs = $DIC['ilTabs'];
42 $lng = $DIC['lng'];
43 $this->ilTabs = $ilTabs;
44 $this->lng = $lng;
45 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References $DIC, $id, $ilTabs, assQuestionGUI\$lng, ILIAS\GlobalScreen\Provider\__construct(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

Member Function Documentation

◆ buildEditForm()

assLongMenuGUI::buildEditForm ( )
protected
Returns
ilPropertyFormGUI

Reimplemented from assQuestionGUI.

Definition at line 171 of file class.assLongMenuGUI.php.

172 {
173 $form = $this->buildBasicEditFormObject();
174
175 $this->addQuestionFormCommandButtons($form);
176
177 $this->addBasicQuestionFormProperties($form);
178
180 //$this->populateAnswerSpecificFormPart($form);
181
182 $this->populateTaxonomyFormSection($form);
183
184 return $form;
185 }
populateQuestionSpecificFormPart(ilPropertyFormGUI $form)
populateTaxonomyFormSection(ilPropertyFormGUI $form)
addBasicQuestionFormProperties(ilPropertyFormGUI $form)
addQuestionFormCommandButtons(ilPropertyFormGUI $form)
This class represents a property form user interface.

References assQuestionGUI\addBasicQuestionFormProperties(), assQuestionGUI\addQuestionFormCommandButtons(), assQuestionGUI\buildBasicEditFormObject(), populateQuestionSpecificFormPart(), and assQuestionGUI\populateTaxonomyFormSection().

Referenced by editQuestion(), and writePostData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editQuestion()

assLongMenuGUI::editQuestion ( ilPropertyFormGUI  $form = null)
protected

Definition at line 158 of file class.assLongMenuGUI.php.

158 : void
159 {
160 if ($form === null) {
161 $form = $this->buildEditForm();
162 }
163
164 $this->getQuestionTemplate();
165
166 $this->tpl->setVariable("QUESTION_DATA", $this->ctrl->getHTML($form));
167 }

References buildEditForm(), ILIAS\Repository\ctrl(), and assQuestionGUI\getQuestionTemplate().

Referenced by writePostData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAfterParticipationSuppressionQuestionPostVars()

assLongMenuGUI::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 476 of file class.assLongMenuGUI.php.

476 : array
477 {
478 return array();
479 }

◆ getAggregatedAnswersView()

assLongMenuGUI::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 487 of file class.assLongMenuGUI.php.

487 : string
488 {
489 $overview = array();
490 $aggregation = array();
491 foreach ($relevant_answers as $answer) {
492 $overview[$answer['active_fi']][$answer['pass']][$answer['value1']] = $answer['value2'];
493 }
494
495 foreach ($overview as $active) {
496 foreach ($active as $answer) {
497 foreach ($answer as $option => $value) {
498 $aggregation[$option][$value] = $aggregation[$option][$value] + 1;
499 }
500 }
501 }
502 $tpl = new ilTemplate('tpl.il_as_aggregated_longmenu_question_answers_table.html', true, true, "Modules/TestQuestionPool");
503 $json = json_decode($this->object->getJsonStructure());
504 foreach ($json as $key => $value) {
505 $tpl->setVariable('TITLE', 'Longmenu ' . ($key + 1));
506 if (array_key_exists($key, $aggregation)) {
507 $aggregate = $aggregation[$key];
508 foreach ($aggregate as $answer => $counts) {
509 $tpl->setVariable('OPTION', $answer);
510 $tpl->setVariable('COUNT', $counts);
512 }
513 }
514 }
515
516 return $tpl->get();
517 }
ilGlobalPageTemplate $tpl
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
setVariable(string $variable, $value='')
Sets the given variable to the given value.
parseCurrentBlock(string $blockname=self::DEFAULT_BLOCK)
Parses the given block.
special template class to simplify handling of ITX/PEAR
string $key
Consumer key/client ID value.
Definition: System.php:193

References ILIAS\LTI\ToolProvider\$key, $tpl, and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ getAnswerFrequencyTableGUI()

assLongMenuGUI::getAnswerFrequencyTableGUI (   $parentGui,
  $parentCmd,
  $relevantAnswers,
  $questionIndex 
)

Reimplemented from assQuestionGUI.

Definition at line 643 of file class.assLongMenuGUI.php.

644 {
645 global $DIC; /* @var ILIAS\DI\Container $DIC */
646
647 $table = parent::getAnswerFrequencyTableGUI(
648 $parentGui,
649 $parentCmd,
650 $relevantAnswers,
651 $questionIndex
652 );
653
654 $table->setTitle(
655 sprintf(
656 $DIC->language()->txt('tst_corrections_answers_tbl_subindex'),
657 $DIC->language()->txt('longmenu') . ' ' . ($questionIndex + 1)
658 )
659 );
660
661 return $table;
662 }

References $DIC.

◆ getAnswersFrequency()

assLongMenuGUI::getAnswersFrequency (   $relevantAnswers,
  $questionIndex 
)

Reimplemented from assQuestionGUI.

Definition at line 620 of file class.assLongMenuGUI.php.

620 : array
621 {
622 $answers = [];
623
624 foreach ($relevantAnswers as $row) {
625 if ($row['value1'] != $questionIndex) {
626 continue;
627 }
628
629 if (!isset($answers[$row['value2']])) {
630 //$label = $this->getAnswerTextLabel($row['value1'], $row['value2']);
631
632 $answers[$row['value2']] = array(
633 'answer' => $row['value2'], 'frequency' => 0
634 );
635 }
636
637 $answers[$row['value2']]['frequency']++;
638 }
639
640 return $answers;
641 }

◆ getCommand()

assLongMenuGUI::getCommand (   $cmd)

Definition at line 66 of file class.assLongMenuGUI.php.

67 {
68 return $cmd;
69 }

◆ getLongMenuTextWithInputFieldsInsteadOfGaps()

assLongMenuGUI::getLongMenuTextWithInputFieldsInsteadOfGaps (   $user_solution = array(),
  $solution = false,
  $graphical = false 
)

Definition at line 519 of file class.assLongMenuGUI.php.

519 : string
520 {
521 $return_value = '';
522 $text_array = preg_split("/\\[" . assLongMenu::GAP_PLACEHOLDER . " (\\d+)\\]/", $this->object->getLongMenuTextValue());
523 $correct_answers = $this->object->getCorrectAnswers();
524 $answers = $this->object->getAnswers();
525 foreach ($text_array as $key => $value) {
526 $answer_is_correct = false;
527 $user_value = '';
528 $return_value .= $this->object->prepareTextareaOutput($value, true);
529 if ($key < sizeof($text_array) - 1) {
530 if (!array_key_exists($key, $correct_answers)) {
531 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('longmenu_answeroptions_differ'));
532 continue;
533 }
534 if ($correct_answers[$key][2] == assLongMenu::ANSWER_TYPE_TEXT_VAL) {
535 if (array_key_exists($key, $user_solution)) {
536 $user_value = $user_solution[$key];
537 if (in_array($user_value, $correct_answers[$key][0])) {
538 $answer_is_correct = true;
539 }
540 }
541
542 $return_value .= $this->getTextGapTemplate($key, $user_value, $solution, $answer_is_correct, $graphical);
543 } elseif ($correct_answers[$key][2] == assLongMenu::ANSWER_TYPE_SELECT_VAL) {
544 if (array_key_exists($key, $user_solution)) {
545 $user_value = $user_solution[$key];
546 if (in_array($user_value, $correct_answers[$key][0])) {
547 $answer_is_correct = true;
548 }
549 }
550 $return_value .= $this->getSelectGapTemplate($key, $answers[$key], $user_value, $solution, $answer_is_correct, $graphical);
551 }
552 }
553 }
554 return $return_value;
555 }
getSelectGapTemplate($key, $answers, $user_value, $solution, $ok=false, $graphical=false)
getTextGapTemplate($key, $value, $solution, $ok=false, $graphical=false)
const ANSWER_TYPE_TEXT_VAL
const ANSWER_TYPE_SELECT_VAL

References ILIAS\LTI\ToolProvider\$key, assLongMenu\ANSWER_TYPE_SELECT_VAL, assLongMenu\ANSWER_TYPE_TEXT_VAL, assLongMenu\GAP_PLACEHOLDER, ILIAS\Repository\lng(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ getPreview()

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

Reimplemented from assQuestionGUI.

Definition at line 389 of file class.assLongMenuGUI.php.

389 : string
390 {
391 $user_solution = is_object($this->getPreviewSession()) ? (array) $this->getPreviewSession()->getParticipantsSolution() : array();
392 $user_solution = array_values($user_solution);
393
394 $template = $this->getTemplateForPreviewAndTest($user_solution);
395
396 $question_output = $template->get();
397 if (!$show_question_only) {
398 $question_output = $this->getILIASPage($question_output);
399 }
400 return $question_output;
401 }
getTemplateForPreviewAndTest(array $user_solution)
getILIASPage(string $html="")
Returns the ILIAS Page around a question.

◆ getSelectGapTemplate()

assLongMenuGUI::getSelectGapTemplate (   $key,
  $answers,
  $user_value,
  $solution,
  $ok = false,
  $graphical = false 
)
private

Definition at line 580 of file class.assLongMenuGUI.php.

580 : string
581 {
582 $tpl = new ilTemplate("tpl.il_as_qpl_longmenu_question_select_gap.html", true, true, "Modules/TestQuestionPool");
583 $tpl->setVariable('KEY', $key);
584 if ($solution) {
585 $tpl->setVariable('DISABLED', 'disabled');
586 $tpl->setVariable('JS_IGNORE', '_ignore');
587 $tpl->setCurrentBlock('best_solution');
588 if ($user_value == -1) {
589 $tpl->setVariable("SOLUTION", $this->lng->txt("please_select"));
590 } else {
591 $tpl->setVariable('SOLUTION', $user_value);
592 }
593 if ($graphical) {
594 $correctness_icon = $this->generateCorrectnessIconsForCorrectness(self::CORRECTNESS_NOT_OK);
595 if ($ok) {
596 $correctness_icon = $this->generateCorrectnessIconsForCorrectness(self::CORRECTNESS_OK);
597 }
598 $tpl->setVariable("ICON_OK", $correctness_icon);
599 }
601 } else {
602 $tpl->setVariable("PLEASE_SELECT", $this->lng->txt("please_select"));
603 foreach ($answers as $value) {
604 $tpl->setCurrentBlock('select_option');
605 $tpl->setVariable('VALUE', $value);
606 if ($value == $user_value) {
607 $tpl->setVariable('SELECTED', 'selected');
608 }
610 }
611 }
612 return $tpl->get();
613 }
generateCorrectnessIconsForCorrectness(int $correctness)
setCurrentBlock(string $blockname=self::DEFAULT_BLOCK)
Sets the template to the given block.

References ILIAS\LTI\ToolProvider\$key, $tpl, and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getSolutionOutput()

assLongMenuGUI::getSolutionOutput (   $active_id,
  $pass = null,
  $graphicalOutput = false,
  $result_output = false,
  $show_question_only = true,
  $show_feedback = false,
  $show_correct_solution = false,
  $show_manual_scoring = false,
  $show_question_text = true 
)

Get the question solution output.

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
Returns
string solution output of the question as HTML code

Reimplemented from assQuestionGUI.

Definition at line 334 of file class.assLongMenuGUI.php.

344 : string {
345 $template = new ilTemplate("tpl.il_as_qpl_longmenu_question_output_solution.html", true, true, "Modules/TestQuestionPool");
346
347 if ($show_question_text) {
348 $template->setVariable("QUESTIONTEXT", $this->object->getQuestionForHTMLOutput());
349 }
350 if (($active_id > 0) && (!$show_correct_solution)) {
351 $correct_solution = $this->getUserSolution($active_id, $pass);
352 } else {
353 $correct_solution = $this->object->getCorrectAnswersForQuestionSolution($this->object->getId());
354 }
355 $template->setVariable('LONGMENU_TEXT_SOLUTION', $this->getLongMenuTextWithInputFieldsInsteadOfGaps($correct_solution, true, $graphicalOutput));
356 $solution_template = new ilTemplate("tpl.il_as_tst_solution_output.html", true, true, "Modules/TestQuestionPool");
357 $question_output = $template->get();
358 $feedback = '';
359 if ($show_feedback) {
360 if (!$this->isTestPresentationContext()) {
361 $fb = $this->getGenericFeedbackOutput((int) $active_id, $pass);
362 $feedback .= strlen($fb) ? $fb : '';
363 }
364
365 $fb = $this->getSpecificFeedbackOutput(array());
366 $feedback .= strlen($fb) ? $fb : '';
367 }
368 if (strlen($feedback)) {
369 $cssClass = (
370 $this->hasCorrectSolution($active_id, $pass) ?
372 );
373
374 $solution_template->setVariable("ILC_FB_CSS_CLASS", $cssClass);
375 $solution_template->setVariable("FEEDBACK", $this->object->prepareTextareaOutput($feedback, true));
376 }
377
378 $solution_template->setVariable("SOLUTION_OUTPUT", $question_output);
379
380 $solution_output = $solution_template->get();
381
382 if (!$show_question_only) {
383 $solution_output = $this->getILIASPage($solution_output);
384 }
385
386 return $solution_output;
387 }
getLongMenuTextWithInputFieldsInsteadOfGaps($user_solution=array(), $solution=false, $graphical=false)
getUserSolution($active_id, $pass)
getSpecificFeedbackOutput(array $userSolution)
Returns the answer specific feedback for the question.
getGenericFeedbackOutput(int $active_id, ?int $pass)
hasCorrectSolution($activeId, $passIndex)

References ILIAS\Repository\object(), and HTML_Template_IT\setVariable().

+ Here is the call graph for this function:

◆ getSpecificFeedbackOutput()

assLongMenuGUI::getSpecificFeedbackOutput ( array  $userSolution)

Returns the answer specific feedback for the question.

Parameters
array$userSolution($userSolution[<value1>] = <value2>)

Reimplemented from assQuestionGUI.

Definition at line 441 of file class.assLongMenuGUI.php.

441 : string
442 {
443 if (!$this->object->feedbackOBJ->specificAnswerFeedbackExists()) {
444 return '';
445 }
446
447 $feedback = '<table class="test_specific_feedback"><tbody>';
448 $gaps = $this->object->getCorrectAnswers();
449 foreach ($gaps as $index => $answer) {
450 $caption = assLongMenu::GAP_PLACEHOLDER . ' ';
451 $caption .= $index + 1 . ': ';
452
453 $feedback .= '<tr><td>';
454
455 $feedback .= $caption . '</td><td>';
456 $feedback .= $this->object->feedbackOBJ->getSpecificAnswerFeedbackTestPresentation(
457 $this->object->getId(),
458 0,
459 $index
460 ) . '</td> </tr>';
461 }
462 $feedback .= '</tbody></table>';
463 return $this->object->prepareTextareaOutput($feedback, true);
464 }
$index
Definition: metadata.php:145

References $index, assLongMenu\GAP_PLACEHOLDER, and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ getSubQuestionsIndex()

assLongMenuGUI::getSubQuestionsIndex ( )

Reimplemented from assQuestionGUI.

Definition at line 615 of file class.assLongMenuGUI.php.

615 : array
616 {
617 return array_keys($this->object->getAnswers());
618 }

References ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ getTemplateForPreviewAndTest()

assLongMenuGUI::getTemplateForPreviewAndTest ( array  $user_solution)
protected

Definition at line 427 of file class.assLongMenuGUI.php.

427 : ilTemplate
428 {
429 $template = new ilTemplate("tpl.il_as_qpl_longmenu_question_output.html", true, true, "Modules/TestQuestionPool");
430 $this->tpl->addJavaScript('./Modules/TestQuestionPool/templates/default/longMenuQuestionPlayer.js');
431 $this->tpl->addOnLoadCode('il.test.player.longmenu.init('
432 . $this->object->getMinAutoComplete() . ', '
433 . json_encode($this->object->getAvailableAnswerOptions())
434 . ')');
435
436 $template->setVariable("QUESTIONTEXT", $this->object->getQuestionForHTMLOutput());
437 $template->setVariable('LONGMENU_TEXT', $this->getLongMenuTextWithInputFieldsInsteadOfGaps($user_solution));
438 return $template;
439 }

References ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ getTestOutput()

assLongMenuGUI::getTestOutput (   $active_id,
  $pass,
  $is_postponed = false,
  $use_post_solutions = false,
  $show_feedback = false 
)

Reimplemented from assQuestionGUI.

Definition at line 403 of file class.assLongMenuGUI.php.

411 : string {
412 $user_solution = array();
413 if ($active_id) {
414 $solutions = $this->object->getUserSolutionPreferingIntermediate($active_id, $pass);
415 foreach ($solutions as $idx => $solution_value) {
416 $user_solution[$solution_value["value1"]] = $solution_value["value2"];
417 }
418 }
419
420 $template = $this->getTemplateForPreviewAndTest($user_solution);
421
422 $question_output = $template->get();
423 $page_output = $this->outQuestionPage("", $is_postponed, $active_id, $question_output);
424 return $page_output;
425 }
outQuestionPage($a_temp_var, $a_postponed=false, $active_id="", $html="", $inlineFeedbackEnabled=false)

◆ getTextGapTemplate()

assLongMenuGUI::getTextGapTemplate (   $key,
  $value,
  $solution,
  $ok = false,
  $graphical = false 
)
private

Definition at line 557 of file class.assLongMenuGUI.php.

557 : string
558 {
559 $tpl = new ilTemplate("tpl.il_as_qpl_longmenu_question_text_gap.html", true, true, "Modules/TestQuestionPool");
560 if ($solution) {
561 $tpl->setVariable('DISABLED', 'disabled');
562 $tpl->setVariable('JS_IGNORE', '_ignore');
563 if ($graphical) {
564 $correctness_icon = $this->generateCorrectnessIconsForCorrectness(self::CORRECTNESS_NOT_OK);
565 if ($ok) {
566 $correctness_icon = $this->generateCorrectnessIconsForCorrectness(self::CORRECTNESS_OK);
567 }
568 $tpl->setVariable("ICON_OK", $correctness_icon);
569 }
570 }
571 if ($solution) {
572 $tpl->setVariable('SIZE', 'size="' . mb_strlen($value) . '"');
573 }
574 $tpl->setVariable('VALUE', $value);
575 $tpl->setVariable('KEY', $key);
576
577 return $tpl->get();
578 }

References ILIAS\LTI\ToolProvider\$key, and $tpl.

◆ getUserSolution()

assLongMenuGUI::getUserSolution (   $active_id,
  $pass 
)
protected
Parameters
$active_id
$pass
Returns
array

Definition at line 52 of file class.assLongMenuGUI.php.

52 : array
53 {
54 $user_solution = array();
55 if ($active_id) {
56 $solutions = $this->object->getSolutionValues($active_id, $pass, true);
57 // hey.
58 foreach ($solutions as $idx => $solution_value) {
59 $user_solution[$solution_value["value1"]] = $solution_value["value2"];
60 }
61 return $user_solution;
62 }
63 return $user_solution;
64 }

◆ populateAnswerSpecificFormPart()

assLongMenuGUI::populateAnswerSpecificFormPart ( ilPropertyFormGUI  $form)
Parameters
ilPropertyFormGUI$form
Returns
ilPropertyFormGUI

Definition at line 317 of file class.assLongMenuGUI.php.

318 {
319 return $form;
320 }

◆ populateCorrectionsFormProperties()

assLongMenuGUI::populateCorrectionsFormProperties ( ilPropertyFormGUI  $form)

Reimplemented from assQuestionGUI.

Definition at line 664 of file class.assLongMenuGUI.php.

664 : void
665 {
666 $correctAnswers = $this->object->getCorrectAnswers();
667
668 foreach ($this->object->getAnswers() as $lmIndex => $lm) {
669 $lmValues = array(
670 'answers_all' => array(0 => $lm),
671 'answers_all_count' => count($lm),
672 'answers_correct' => $correctAnswers[$lmIndex][0]
673 );
674
675 $lmPoints = $correctAnswers[$lmIndex][1];
676
677 $section = new ilFormSectionHeaderGUI();
678 $section->setTitle($this->lng->txt('longmenu') . ' ' . ($lmIndex + 1));
679 $form->addItem($section);
680
682 $this->lng->txt('answers'),
683 'longmenu_' . $lmIndex
684 );
685
686 $lmInput->setRequired(true);
687
688 $lmInput->setValues($lmValues);
689
690 $form->addItem($lmInput);
691
692 $pointsInp = new ilNumberInputGUI($this->lng->txt("points"), 'points_' . $lmIndex);
693 $pointsInp->setRequired(true);
694 $pointsInp->allowDecimals(true);
695 $pointsInp->setSize(4);
696 $pointsInp->setMinValue(0);
697 $pointsInp->setMinvalueShouldBeGreater(false);
698 $pointsInp->setValue($lmPoints);
699 $form->addItem($pointsInp);
700 }
701 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a number property in a property form.

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

+ Here is the call graph for this function:

◆ populateQuestionSpecificFormPart()

assLongMenuGUI::populateQuestionSpecificFormPart ( ilPropertyFormGUI  $form)
Parameters
ilPropertyFormGUI$form
Returns
ilPropertyFormGUI

Implements ilGuiQuestionScoringAdjustable.

Definition at line 190 of file class.assLongMenuGUI.php.

191 {
192 $long_menu_text = new ilTextAreaInputGUI($this->lng->txt("longmenu_text"), 'longmenu_text');
193 $long_menu_text->setRequired(true);
194 //$long_menu_text->setInfo($this->lng->txt("longmenu_hint"));
195 $long_menu_text->setRows(10);
196 $long_menu_text->setCols(80);
197 if (!$this->object->getSelfAssessmentEditingMode()) {
198 if ($this->object->getAdditionalContentEditingMode() == assQuestion::ADDITIONAL_CONTENT_EDITING_MODE_RTE) {
199 include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
200 $long_menu_text->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("assessment"));
201 $long_menu_text->addPlugin("latex");
202 $long_menu_text->addButton("latex");
203 $long_menu_text->addButton("pastelatex");
204 $long_menu_text->setRTESupport($this->object->getId(), "qpl", "assessment");
205 $long_menu_text->setUseRte(true);
206 }
207 } else {
208 require_once 'Modules/TestQuestionPool/classes/questions/class.ilAssSelfAssessmentQuestionFormatter.php';
210 $long_menu_text->setUseTagsForRteOnly(false);
211 }
212
213 $long_menu_text->setValue($this->object->getLongMenuTextValue());
214 $form->addItem($long_menu_text);
215
216 $tpl = new ilTemplate("tpl.il_as_qpl_longmenu_question_gap_button_code.html", true, true, "Modules/TestQuestionPool");
217 $tpl->setVariable('INSERT_GAP', $this->lng->txt('insert_gap'));
219 $button = new ilCustomInputGUI('&nbsp;', '');
220 $button->setHtml($tpl->get());
221 $form->addItem($button);
222
223 $modal = ilModalGUI::getInstance();
224 $modal->setHeading('');
225 $modal->setId("ilGapModal");
226 //$modal->setBackdrop(ilModalGUI::BACKDROP_OFF);
227 $modal->setBody('');
228
229 $min_auto_complete = new ilNumberInputGUI($this->lng->txt("min_auto_complete"), 'min_auto_complete');
230
231 $auto_complete = $this->object->getMinAutoComplete();
232 if ($auto_complete == 0) {
234 }
235 $min_auto_complete->setValue($auto_complete);
236 $min_auto_complete->setMinValue(1);
237 $min_auto_complete->setMaxValue(99);
238 $min_auto_complete->setSize(5);
239 $form->addItem($min_auto_complete);
240 // identical scoring
241 $identical_scoring = new ilCheckboxInputGUI($this->lng->txt("identical_scoring"), "identical_scoring");
242 $identical_scoring->setValue(1);
243 $identical_scoring->setChecked($this->object->getIdenticalScoring());
244 $identical_scoring->setInfo($this->lng->txt('identical_scoring_desc'));
245 $identical_scoring->setRequired(false);
246 $form->addItem($identical_scoring);
247 $hidden_text = new ilHiddenInputGUI('hidden_text_files');
248 $form->addItem($hidden_text);
249
250 $hidden_correct = new ilHiddenInputGUI('hidden_correct_answers');
251 $form->addItem($hidden_correct);
252
253 $long_menu_language = [
254 'edit' => '[' . $this->lng->txt('edit') . ']',
255 'type' => $this->lng->txt('type'),
256 'answers' => $this->lng->txt('answers'),
257 'answer_options' => $this->lng->txt('answer_options'),
258 'correct_answers' => $this->lng->txt('correct_answers'),
259 'add_answers' => '[' . $this->lng->txt('add_answers') . ']',
260 'manual_editing' => $this->lng->txt('manual_editing')
261 ];
262
263 $question_parts = [
264 'list' => json_decode($this->object->getJsonStructure()),
265 'gap_placeholder' => assLongMenu::GAP_PLACEHOLDER,
266 'last_updated_element' => 0,
267 'replacement_word' => '',
268 'filereader_usable' => false,
269 'max_input_fields' => assLongMenu::MAX_INPUT_FIELDS
270 ];
271 $answers = $this->object->getAnswersObject();
272
273 if ($this->request->isset('hidden_text_files')) {
274 $question_parts['list'] = json_decode($this->request->raw('hidden_correct_answers'));
275 $answers = $this->request->raw('hidden_text_files');
276 }
277
278 $this->tpl->addJavaScript('./Modules/TestQuestionPool/templates/default/longMenuQuestionGapBuilder.js');
279 $this->tpl->addJavaScript('./Modules/TestQuestionPool/templates/default/longMenuQuestion.js');
280 $tpl = new ilTemplate("tpl.il_as_qpl_longmenu_question_gap.html", true, true, "Modules/TestQuestionPool");
281 $tpl->setVariable('MAX_INPUT_FIELDS', assLongMenu::MAX_INPUT_FIELDS);
282 $tpl->setVariable('GAP_PLACEHOLDER', assLongMenu::GAP_PLACEHOLDER);
283 $tpl->setVariable('SELECT_BOX', $this->lng->txt('insert_gap'));
284 $tpl->setVariable("SELECT", $this->lng->txt('answers_select'));
285 $tpl->setVariable("TEXT", $this->lng->txt('answers_text_box'));
286 $tpl->setVariable("POINTS", $this->lng->txt('points'));
287 $tpl->setVariable("INFO_TEXT_UPLOAD", $this->lng->txt('info_text_upload'));
288 $tpl->setVariable("TXT_BROWSE", $this->lng->txt('select_file'));
289 $tpl->setVariable('POINTS_ERROR', $this->lng->txt('enter_enough_positive_points'));
290 $tpl->setVariable('AUTOCOMPLETE_ERROR', $this->lng->txt('autocomplete_error'));
291 $tpl->setVariable('MISSING_VALUE', $this->lng->txt('msg_input_is_required'));
292 $tpl->setVariable('SAVE', $this->lng->txt('save'));
293 $tpl->setVariable('CANCEL', $this->lng->txt('cancel'));
294 $tag_input = new ilTagInputGUI();
295 $tag_input->setPostVar('taggable');
296 $tag_input->setJsSelfInit(false);
297 $tag_input->setTypeAheadMinLength(1);
298 $tpl->setVariable("TAGGING_PROTOTYPE", $tag_input->render(''));
299
300 $tpl->setVariable("MY_MODAL", $modal->getHTML());
301
303 $this->tpl->addOnLoadCode('longMenuQuestion.Init(' .
304 json_encode($long_menu_language) . ', ' .
305 json_encode($question_parts) . ', ' .
306 $answers . ');');
307 $button = new ilCustomInputGUI('&nbsp;', '');
308 $button->setHtml($tpl->get());
309 $form->addItem($button);
310 return $form;
311 }
const MIN_LENGTH_AUTOCOMPLETE
const ADDITIONAL_CONTENT_EDITING_MODE_RTE
static getSelfAssessmentTags()
Get tags allowed in question tags in self assessment mode.
This class represents a checkbox property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getInstance()
static _getUsedHTMLTags(string $a_module="")
Returns an array of all allowed HTML tags for text editing.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a text area property in a property form.

References assQuestionGUI\$tpl, ilObjAdvancedEditing\_getUsedHTMLTags(), ilPropertyFormGUI\addItem(), assQuestion\ADDITIONAL_CONTENT_EDITING_MODE_RTE, assLongMenu\GAP_PLACEHOLDER, ilGlobalPageTemplate\get(), ilModalGUI\getInstance(), ilAssSelfAssessmentQuestionFormatter\getSelfAssessmentTags(), ILIAS\Repository\lng(), assLongMenu\MAX_INPUT_FIELDS, assLongMenu\MIN_LENGTH_AUTOCOMPLETE, ILIAS\Repository\object(), ilGlobalPageTemplate\parseCurrentBlock(), and ilGlobalPageTemplate\setVariable().

Referenced by buildEditForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveCorrectionsFormProperties()

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

Reimplemented from assQuestionGUI.

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

706 : void
707 {
708 $correctAnswers = $this->object->getCorrectAnswers();
709
710 foreach ($this->object->getAnswers() as $lmIndex => $lm) {
711 $pointsInput = (float) str_replace(',', '.', $form->getInput('points_' . $lmIndex));
712 $correctAnswersInput = (array) $form->getInput('longmenu_' . $lmIndex . '_tags');
713
714 foreach ($correctAnswersInput as $idx => $answer) {
715 if (in_array($answer, $lm)) {
716 continue;
717 }
718
719 unset($correctAnswersInput[$idx]);
720 }
721
722 $correctAnswersInput = array_values($correctAnswersInput);
723
724 $correctAnswers[$lmIndex][0] = $correctAnswersInput;
725 $correctAnswers[$lmIndex][1] = $pointsInput;
726 }
727
728 $this->object->setCorrectAnswers($correctAnswers);
729 }
getInput(string $a_post_var, bool $ensureValidation=true)
Returns the input of an item, if item provides getInput method and as fallback the value of the HTTP-...

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

+ Here is the call graph for this function:

◆ stripSlashesRecursive()

assLongMenuGUI::stripSlashesRecursive ( array  $data)
private

Definition at line 132 of file class.assLongMenuGUI.php.

132 : array
133 {
134 return array_map(
135 function ($v) {
136 if (is_array($v)) {
137 return $this->stripSlashesRecursive($v);
138 }
139 return ilUtil::stripSlashes($v);
140 },
141 $data
142 );
143 }
stripSlashesRecursive(array $data)
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")

References $data, ilUtil\stripSlashes(), and stripSlashesRecursive().

Referenced by stripSlashesRecursive(), verifyAnswerOptions(), and writeQuestionSpecificPostData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ trimArrayRecursive()

assLongMenuGUI::trimArrayRecursive ( array  $data)
private

Definition at line 145 of file class.assLongMenuGUI.php.

145 : array
146 {
147 return array_map(
148 function ($v) {
149 if (is_array($v)) {
150 return $this->trimArrayRecursive($v);
151 }
152 return trim($v);
153 },
154 $data
155 );
156 }
trimArrayRecursive(array $data)

References $data, and trimArrayRecursive().

Referenced by trimArrayRecursive(), and writeQuestionSpecificPostData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ verifyAnswerOptions()

assLongMenuGUI::verifyAnswerOptions ( )
private

Definition at line 114 of file class.assLongMenuGUI.php.

114 : bool
115 {
116 $longmenu_text = $this->request->raw('longmenu_text') ?? '';
117 $hidden_text_files = $this->request->raw('hidden_text_files') ?? '';
118 $answer_options_from_text = preg_split(
119 "/\\[" . assLongMenu::GAP_PLACEHOLDER . " (\\d+)\\]/",
120 $longmenu_text
121 );
122
123 $answer_options_from_files = $this->stripSlashesRecursive(json_decode($hidden_text_files));
124 if (count($answer_options_from_text) - 1 !== count($answer_options_from_files)) {
125 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('longmenu_answeroptions_differ'));
126 return false;
127 }
128
129 return true;
130 }

References assLongMenu\GAP_PLACEHOLDER, ILIAS\Repository\lng(), and stripSlashesRecursive().

Referenced by writePostData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ writePostData()

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

{Evaluates a posted edit form and writes the form data in the question object.

Returns
integer A positive value, if one of the required fields wasn't set, else 0
}

Reimplemented from assQuestionGUI.

Definition at line 74 of file class.assLongMenuGUI.php.

74 : int
75 {
76 $form = $this->buildEditForm();
77 $form->setValuesByPost();
78 $check = $form->checkInput() && $this->verifyAnswerOptions();
79
80 if (!$check) {
81 $this->editQuestion($form);
82 return 1;
83 }
86 $custom_check = $this->object->checkQuestionCustomPart($form);
87 if (!$custom_check) {
88 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("form_input_not_valid"));
89 $this->editQuestion($form);
90 return 1;
91 }
93 return 0;
94 }
$check
Definition: buildRTE.php:81
editQuestion(ilPropertyFormGUI $form=null)
writeQuestionSpecificPostData(ilPropertyFormGUI $form)
Extracts the question specific values from $_POST and applies them to the data object.

References $check, buildEditForm(), editQuestion(), ILIAS\Repository\lng(), assQuestionGUI\saveTaxonomyAssignments(), verifyAnswerOptions(), assQuestionGUI\writeQuestionGenericPostData(), and writeQuestionSpecificPostData().

+ Here is the call graph for this function:

◆ writeQuestionSpecificPostData()

assLongMenuGUI::writeQuestionSpecificPostData ( ilPropertyFormGUI  $form)

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

Implements ilGuiQuestionScoringAdjustable.

Definition at line 96 of file class.assLongMenuGUI.php.

96 : void
97 {
98 $longmenu_text = $this->request->raw('longmenu_text') ?? '';
99 $hidden_text_files = $this->request->raw('hidden_text_files') ?? '';
100 $hidden_correct_answers = $this->request->raw('hidden_correct_answers') ?? [];
101 $long_menu_type = $this->request->raw('long_menu_type') ?? '';
102 $this->object->setLongMenuTextValue(ilUtil::stripSlashes($longmenu_text));
103 $this->object->setAnswers($this->trimArrayRecursive($this->stripSlashesRecursive(json_decode($hidden_text_files))));
104 $this->object->setCorrectAnswers($this->trimArrayRecursive($this->stripSlashesRecursive(json_decode($hidden_correct_answers))));
105 $this->object->setAnswerType(ilArrayUtil::stripSlashesRecursive($long_menu_type));
106 $this->object->setQuestion($this->request->raw('question'));
107 $this->object->setLongMenuTextValue($this->request->raw('longmenu_text'));
108 $this->object->setMinAutoComplete($this->request->int('min_auto_complete'));
109 $this->object->setIdenticalScoring($this->request->int('identical_scoring'));
110
112 }
static stripSlashesRecursive($a_data, bool $a_strip_html=true, string $a_allow="")

References assQuestionGUI\saveTaxonomyAssignments(), ilUtil\stripSlashes(), ilArrayUtil\stripSlashesRecursive(), stripSlashesRecursive(), and trimArrayRecursive().

Referenced by writePostData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $ilTabs

assLongMenuGUI::$ilTabs
private

Definition at line 30 of file class.assLongMenuGUI.php.

Referenced by __construct().


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