ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
assQuestionGUI Class Reference
+ Inheritance diagram for assQuestionGUI:
+ Collaboration diagram for assQuestionGUI:

Public Member Functions

 editQuestion (bool $checkonly=false, ?bool $is_save_cmd=null)
 
 getSpecificFeedbackOutput (array $userSolution)
 Returns the answer specific feedback for the question. More...
 
 getSolutionOutput (int $active_id, ?int $pass=null, bool $graphical_output=false, bool $result_output=false, bool $show_question_only=true, bool $show_feedback=false, bool $show_correct_solution=false, bool $show_manual_scoring=false, bool $show_question_text=true, bool $show_inline_feedback=true)
 
 getPreview (bool $show_question_only=false, bool $show_inline_feedback=false)
 
 getTestOutput (int $active_id, int $pass, bool $is_question_postponed=false, array|bool $user_post_solutions=false, bool $show_specific_inline_feedback=false)
 
 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,)
 
 getObject ()
 
 setObject (assQuestion $question)
 
 setCopyToExistingPoolOnSave (?int $pool_ref_id)
 
 getCopyToExistingPoolOnSave ()
 
 setCopyToNewPoolOnSave (?string $pool_title)
 
 getCopyToNewPoolOnSave ()
 
 setMoveAfterQuestionId (?int $question_id)
 
 getMoveAfterQuestionId ()
 
 hasInlineFeedback ()
 
 addHeaderAction ()
 
 redrawHeaderAction ()
 
 getHeaderAction ()
 
 getCommentsPanelHTML ()
 
 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 (string $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)
 
 syncQuestion ()
 
 saveReturn ()
 
 saveQuestion ()
 
 setAdditionalContentEditingModeFromPost ()
 
 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)
 
 getQuestionType ()
 
 getAsValueAttribute (string $a_value)
 
 addQuestionFormCommandButtons (ilPropertyFormGUI $form)
 
 addBasicQuestionFormProperties (ilPropertyFormGUI $form)
 
 getGenericFeedbackOutput (int $active_id, ?int $pass)
 
 getGenericFeedbackOutputForCorrectSolution ()
 
 getGenericFeedbackOutputForIncorrectSolution ()
 
 outQuestionType ()
 
 saveSuggestedSolution ()
 
 cancelSuggestedSolution ()
 
 suggestedsolution (bool $save=false)
 
 outSolutionExplorer ()
 
 saveSuggestedSolutionType ()
 
 cancelExplorer ()
 
 outPageSelector ()
 
 outChapterSelector ()
 
 outGlossarySelector ()
 
 linkChilds ()
 
 addPG ()
 
 addST ()
 
 addGIT ()
 
 isSaveCommand ()
 
 setQuestionTabs ()
 
 addTab_SuggestedSolution (ilTabsGUI $tabs, string $classname)
 
 getEditQuestionTabCommands ()
 
 isAutosaveable ()
 
 outQuestionForTest (string $formaction, int $active_id, ?int $pass, bool $is_question_postponed=false, array|bool $user_post_solutions=false, bool $show_specific_inline_feedback=false)
 
 magicAfterTestOutput ()
 
 getFormEncodingType ()
 
 setPreviewSession (ilAssQuestionPreviewSession $preview_session)
 
 getPreviewSession ()
 
 buildFocusAnchorHtml ()
 
 isAnswerFrequencyStatisticSupported ()
 
 getSubQuestionsIndex ()
 
 getAnswersFrequency ($relevantAnswers, $questionIndex)
 
 getAnswerFrequencyTableGUI ($parentGui, $parentCmd, $relevantAnswers, $questionIndex)
 
 prepareReprintableCorrectionsForm (ilPropertyFormGUI $form)
 
 populateCorrectionsFormProperties (ilPropertyFormGUI $form)
 
 saveCorrectionsFormProperties (ilPropertyFormGUI $form)
 
 isInLearningModuleContext ()
 
 setInLearningModuleContext (bool $flag)
 
 cmdNeedsExistingQuestion (string $cmd)
 
 setContextAllowsSyncToPool (bool $sync_allowed)
 
 needsSyncQuery ()
 
 getQuestionSyncModal (string $cmd, string $cmd_class='')
 
 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)
 
 buildFileDownloadLink ()
 

Static Public Member Functions

static _getQuestionGUI (string $question_type='', int $question_id=-1)
 Creates a question gui representation and returns the alias to the question gui. More...
 
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

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'
 
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 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'
 
const PRESENTATION_CONTEXT_TEST = 'pContextTest'
 
const PRESENTATION_CONTEXT_RESULTS = 'pContextResults'
 
const CMD_SYNC_QUESTION_AND_RETURN = 'syncQuestionReturn'
 

Protected Member Functions

 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 ()
 
 setTestSpecificProperties ()
 
 addNumberOfTriesToFormIfNecessary (ilPropertyFormGUI $form)
 
 saveTaxonomyAssignments ()
 
 populateTaxonomyFormSection (ilPropertyFormGUI $form)
 
 genericFeedbackOutputBuilder (int $active_id, ?int $pass)
 
 getTypeOptions ()
 
 createSuggestedSolutionLinkingTo (string $type, string $target)
 
 setDefaultTabs (ilTabsGUI $tabs_gui)
 
 setQuestionSpecificTabs (ilTabsGUI $tabs_gui)
 
 getBasicEditQuestionTabCommands ()
 
 getAdditionalEditQuestionCommands ()
 
 addTab_QuestionFeedback (ilTabsGUI $tabs)
 
 addTab_Question (ilTabsGUI $tabs_gui)
 
 hasCorrectSolution ($activeId, $passIndex)
 
 writeQuestionGenericPostData ()
 
 completeTestOutputFormAction (string $form_action, int $active_id, int $pass)
 
 addBackTab (ilTabsGUI $tabs_gui)
 
 buildBasicEditFormObject ()
 
 escapeTemplatePlaceholders (string $text)
 
 buildEditForm ()
 
 generateCorrectnessIconsForCorrectness (int $correctness)
 
 renderLatex ($content)
 Wrap content with latex in a LatexContent UI component and render it to be processed by MathJax in the browser. More...
 
 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 ()
 
 resetSavedPreviewSession ()
 

Protected Attributes

const HAS_SPECIAL_QUESTION_COMMANDS = false
 
const SUGGESTED_SOLUTION_COMMANDS_CANCEL = 'cancelSuggestedSolution'
 
const SUGGESTED_SOLUTION_COMMANDS_SAVE = 'saveSuggestedSolution'
 
const SUGGESTED_SOLUTION_COMMANDS_DEFAULT = 'suggestedsolution'
 
const QUESTION_SAVE_CMDS
 
const ADDITIONAL_CMDS_NEEDING_EXISTING_QST
 There are functions that need an existing question. More...
 
ilLogger $logger
 
GeneralQuestionPropertiesRepository $questionrepository
 
GUIService $notes_gui
 
ilCtrl $ctrl
 
assQuestion $object
 
ilGlobalPageTemplate $tpl
 
ilLanguage $lng
 
Refinery $refinery
 
 $error
 
string $errormessage
 
int $sequence_no
 sequence number in test More...
 
int $question_count
 question count in test More...
 
ilPropertyFormGUI $editForm = null
 
readonly ilTestLegacyFormsHelper $forms_helper
 
readonly RequestDataCollector $request_data_collector
 
bool $parent_type_is_lm = false
 
SuggestedSolutionsDatabaseRepository $suggestedsolution_repo = null
 

Private Attributes

const CMD_SAVE = 'save'
 
const CMD_SAVE_AND_RETURN = 'saveReturn'
 
const CMD_SYNC_QUESTION = 'syncQuestion'
 
 $ui
 
ilObjectDataCache $ilObjDataCache
 
ilHelpGUI $ilHelp
 
ilAccessHandler $access
 
ilTabsGUI $tabs_gui
 
ilRbacSystem $rbacsystem
 
ilTree $tree
 
ilDBInterface $db
 
ilComponentRepository $component_repository
 
ilObjUser $current_user
 
ilAssQuestionPreviewSession $preview_session = null
 
 $taxonomyIds = []
 
 $targetGuiClass = null
 
string $questionActionCmd = 'handleQuestionAction'
 
ilQuestionHeaderBlockBuilder $questionHeaderBlockBuilder
 
ilTestQuestionNavigationGUI $navigationGUI = null
 
string $presentationContext = null
 
string $renderPurpose = self::RENDER_PURPOSE_PLAYBACK
 
string $editContext = self::EDIT_CONTEXT_AUTHORING
 
bool $previousSolutionPrefilled = false
 
int $copy_to_existing_pool_on_save = null
 
string $copy_to_new_pool_on_save = null
 
int $move_after_question_with_id = null
 
bool $context_allows_sync_to_pool = false
 
string $question_sync_modal = ''
 

Detailed Description

Member Function Documentation

◆ _getQuestionGUI()

static assQuestionGUI::_getQuestionGUI ( string  $question_type = '',
int  $question_id = -1 
)
static

Creates a question gui representation and returns the alias to the question gui.

Definition at line 572 of file class.assQuestionGUI.php.

573 {
574 global $DIC;
575 $ilCtrl = $DIC['ilCtrl'];
576 $ilDB = $DIC['ilDB'];
577 $lng = $DIC['lng'];
578
579 if (($question_type === '') && ($question_id > 0)) {
580 $question_type = QuestionPoolDIC::dic()['question.general_properties.repository']
581 ->getForQuestionId($question_id)?->getClassName();
582 }
583
584 if ($question_type === null || $question_type === '') {
585 return null;
586 }
587
588 $question_type_gui = $question_type . 'GUI';
589 $question = new $question_type_gui();
590
591 $feedbackObjectClassname = assQuestion::getFeedbackClassNameByQuestionType($question_type);
592 $question->object->feedbackOBJ = new $feedbackObjectClassname($question->object, $ilCtrl, $ilDB, $lng);
593
594 if ($question_id > 0) {
595 $question->object->loadFromDb($question_id);
596 }
597
598 return $question;
599 }
static getFeedbackClassNameByQuestionType(string $questionType)
global $DIC
Definition: shib_login.php:26

References $DIC, $ilDB, $lng, and assQuestion\getFeedbackClassNameByQuestionType().

Referenced by ilObjQuestionPoolGUI\addLocatorItems(), ilPCQuestionGUI\edit(), ilPageObjectGUI\executeCommand(), ilObjTestGUI\executeCommand(), ilQuestionEditGUI\executeCommand(), ilQuestionExporter\exportQuestion(), ilAssQuestionPageCommandForwarder\forward(), ilObjTestGUI\forwardCommandToQuestion(), ilPCQuestion\getJavascriptFiles(), ilPCQuestion\modifyPageContentPostXsl(), ilAssQuestionSkillAssignmentsGUI\saveSkillQuestionAssignmentPropertiesFormCmd(), and ilObjQuestionPoolGUI\setTitleAndDescription().

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

◆ addBackTab()

assQuestionGUI::addBackTab ( ilTabsGUI  $tabs_gui)
protected

Definition at line 1714 of file class.assQuestionGUI.php.

1714 : void
1715 {
1716 if ($this->object->getId() <= 0) {
1717 $tabs_gui->setBackTarget(
1718 $this->lng->txt('cancel'),
1719 $this->ctrl->getParentReturnByClass(
1721 ilObject::_lookupType($this->object->getObjId())
1722 ) . 'GUI'
1723 )
1724 );
1725 return;
1726 }
1727 $this->ctrl->setParameterByClass(
1728 ilAssQuestionPreviewGUI::class,
1729 'q_id',
1730 $this->object->getId()
1731 );
1732 $this->ctrl->saveParameterByClass(ilAssQuestionPreviewGUI::class, 'prev_qid');
1734 $this->lng->txt('backtocallingpage'),
1735 $this->ctrl->getLinkTargetByClass(
1736 ilAssQuestionPreviewGUI::class,
1738 )
1739 );
1740 $this->ctrl->clearParameterByClass(ilAssQuestionPreviewGUI::class, 'prev_qid');
1741 }
static getClassByType(string $obj_type)
static _lookupType(int $id, bool $reference=false)
setBackTarget(string $a_title, string $a_target, string $a_frame="")

References ilObject\_lookupType(), ilAssQuestionPreviewGUI\CMD_SHOW, ILIAS\Repository\ctrl(), ilObjectFactory\getClassByType(), ILIAS\Repository\lng(), ILIAS\Repository\object(), and ilTabsGUI\setBackTarget().

+ Here is the call graph for this function:

◆ addBasicQuestionFormProperties()

assQuestionGUI::addBasicQuestionFormProperties ( ilPropertyFormGUI  $form)

Reimplemented in assMultipleChoiceGUI.

Definition at line 855 of file class.assQuestionGUI.php.

855 : void
856 {
857 $title = new ilTextInputGUI($this->lng->txt('title'), 'title');
858 $title->setMaxLength(100);
859 $title->setValue($this->object->getTitle());
860 $title->setRequired(true);
861 $form->addItem($title);
862
863 if (!$this->object->getSelfAssessmentEditingMode()) {
864 // author
865 $author = new ilTextInputGUI($this->lng->txt('author'), 'author');
866 $author->setValue($this->object->getAuthor());
867 $author->setMaxLength(512);
868 $author->setRequired(true);
869 $form->addItem($author);
870
871 // description
872 $description = new ilTextInputGUI($this->lng->txt('description'), 'comment');
873 $description->setValue($this->object->getComment());
874 $description->setRequired(false);
875 $description->setMaxLength(1000);
876 $form->addItem($description);
877 } else {
878 // author as hidden field
879 $hi = new ilHiddenInputGUI('author');
880 $author = ilLegacyFormElementsUtil::prepareFormOutput($this->object->getAuthor());
881 if (trim($author) == "") {
882 $author = "-";
883 }
884 $hi->setValue($author);
885 $form->addItem($hi);
886 }
887
888 // lifecycle
889 $lifecycle = new ilSelectInputGUI($this->lng->txt('qst_lifecycle'), 'lifecycle');
890 $lifecycle->setOptions($this->object->getLifecycle()->getSelectOptions($this->lng));
891 $lifecycle->setValue($this->object->getLifecycle()->getIdentifier());
892 $form->addItem($lifecycle);
893
894 // questiontext
895 $question = new ilTextAreaInputGUI($this->lng->txt('question'), 'question');
896 $question->setValue($this->object->getQuestion());
897 $question->setRequired(true);
898 $question->setRows(10);
899 $question->setCols(80);
900
901 if (!$this->object->getSelfAssessmentEditingMode()) {
902 if ($this->object->getAdditionalContentEditingMode() !== assQuestion::ADDITIONAL_CONTENT_EDITING_MODE_IPE) {
903 $question->setUseRte(true);
904 $question->setRteTags(ilRTESettings::_getUsedHTMLTags('assessment'));
905 $question->setRTESupport($this->object->getId(), 'qpl', 'assessment');
906 }
907 } else {
909 $question->setUseTagsForRteOnly(false);
910 }
911 $question->setInfo($this->lng->txt('latex_edit_info'));
912 $form->addItem($question);
913
914 $question_type = new ilHiddenInputGUI('question_type');
915 $question_type->setValue((string) $this->getQuestionType());
916 $form->addItem($question_type);
917
918 if ($this->copy_to_existing_pool_on_save !== null) {
919 $pool_ref = new ilHiddenInputGUI('pool_ref');
920 $pool_ref->setValue((string) $this->copy_to_existing_pool_on_save);
921 $form->addItem($pool_ref);
922 }
923
924 if ($this->copy_to_new_pool_on_save !== null) {
925 $pool_title = new ilHiddenInputGUI('pool_title');
926 $pool_title->setValue($this->copy_to_new_pool_on_save);
927 $form->addItem($pool_title);
928 }
929
930 if ($this->move_after_question_with_id !== null) {
931 $move_after_question_id = new ilHiddenInputGUI('move_after_question_with_id');
932 $move_after_question_id->setValue((string) $this->move_after_question_with_id);
933 $form->addItem($move_after_question_id);
934 }
935
936 $additional_content_editing_mode = new ilHiddenInputGUI('additional_content_editing_mode');
937 $additional_content_editing_mode->setValue($this->object->getAdditionalContentEditingMode());
938 $form->addItem($additional_content_editing_mode);
939
941 }
$lifecycle
addNumberOfTriesToFormIfNecessary(ilPropertyFormGUI $form)
const ADDITIONAL_CONTENT_EDITING_MODE_IPE
static getSelfAssessmentTags()
Get tags allowed in question tags in self assessment mode.
This class represents a hidden form property in a property form.
static prepareFormOutput($a_str, bool $a_strip=false)
static _getUsedHTMLTags(string $module='')
This class represents a selection list property in a property form.
This class represents a text area property in a property form.
This class represents a text property in a property form.

References $lifecycle, ilRTESettings\_getUsedHTMLTags(), ilPropertyFormGUI\addItem(), assQuestion\ADDITIONAL_CONTENT_EDITING_MODE_IPE, ilAssSelfAssessmentQuestionFormatter\getSelfAssessmentTags(), ILIAS\Repository\lng(), ILIAS\Repository\object(), and ilLegacyFormElementsUtil\prepareFormOutput().

Referenced by assImagemapQuestionGUI\buildEditForm().

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

◆ addErrorMessage()

assQuestionGUI::addErrorMessage ( string  $errormessage)

Definition at line 828 of file class.assQuestionGUI.php.

828 : void
829 {
830 $this->errormessage .= ((strlen($this->errormessage)) ? "<br />" : "") . $errormessage;
831 }

Referenced by assFormulaQuestionGUI\writePostData().

+ Here is the caller graph for this function:

◆ addGIT()

assQuestionGUI::addGIT ( )

Definition at line 1510 of file class.assQuestionGUI.php.

1510 : void
1511 {
1512 $target = "il__git_" . $this->request_data_collector->raw("git");
1513 $this->createSuggestedSolutionLinkingTo('git', $target);
1514 $this->tpl->setOnScreenMessage('success', $this->lng->txt("suggested_solution_added_successfully"), true);
1515 $this->ctrl->redirect($this, 'suggestedsolution');
1516 }
createSuggestedSolutionLinkingTo(string $type, string $target)

References ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ addHeaderAction()

assQuestionGUI::addHeaderAction ( )

Definition at line 298 of file class.assQuestionGUI.php.

298 : void
299 {
300 }

◆ addNumberOfTriesToFormIfNecessary()

assQuestionGUI::addNumberOfTriesToFormIfNecessary ( ilPropertyFormGUI  $form)
protected

Definition at line 943 of file class.assQuestionGUI.php.

944 {
945 if (!$this->object->getSelfAssessmentEditingMode()) {
946 return;
947 }
948
949 $nr_tries = $this->object->getNrOfTries() ?? $this->object->getDefaultNrOfTries();
950
951 if ($nr_tries < 1) {
952 $nr_tries = "";
953 }
954
955 $ni = new ilNumberInputGUI($this->lng->txt("qst_nr_of_tries"), "nr_of_tries");
956 $ni->setValue((string) $nr_tries);
957 $ni->setMinValue(0);
958 $ni->setSize(5);
959 $ni->setMaxLength(5);
960 $form->addItem($ni);
961 }
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:

◆ addPG()

assQuestionGUI::addPG ( )

Definition at line 1494 of file class.assQuestionGUI.php.

1494 : void
1495 {
1496 $target = "il__pg_" . $this->request_data_collector->raw("pg");
1497 $this->createSuggestedSolutionLinkingTo('pg', $target);
1498 $this->tpl->setOnScreenMessage('success', $this->lng->txt("suggested_solution_added_successfully"), true);
1499 $this->ctrl->redirect($this, 'suggestedsolution');
1500 }

References ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ addQuestionFormCommandButtons()

assQuestionGUI::addQuestionFormCommandButtons ( ilPropertyFormGUI  $form)

Definition at line 847 of file class.assQuestionGUI.php.

847 : void
848 {
849 if (!$this->object->getSelfAssessmentEditingMode()) {
850 $form->addCommandButton("saveReturn", $this->lng->txt("save_return"));
851 }
852 $form->addCommandButton("save", $this->lng->txt("save"));
853 }
addCommandButton(string $a_cmd, string $a_text, string $a_id="")

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

Referenced by assImagemapQuestionGUI\buildEditForm().

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

◆ addSaveOnEnterOnLoadCode()

assQuestionGUI::addSaveOnEnterOnLoadCode ( )
protected

Definition at line 1955 of file class.assQuestionGUI.php.

1955 : void
1956 {
1957 $this->tpl->addOnloadCode("
1958 let form = document.querySelector('#ilContentContainer form');
1959 let button = form.querySelector('input[name=\"cmd[save]\"]');
1960 if (form && button) {
1961 form.addEventListener('keydown', function (e) {
1962 if (e.key === 'Enter'
1963 && e.target.type !== 'textarea'
1964 && e.target.type !== 'submit'
1965 && e.target.type !== 'file'
1966 ) {
1967 e.preventDefault();
1968 form.requestSubmit(button);
1969 }
1970 })
1971 }
1972 ");
1973 }

◆ addST()

assQuestionGUI::addST ( )

Definition at line 1502 of file class.assQuestionGUI.php.

1502 : void
1503 {
1504 $target = "il__st_" . $this->request_data_collector->raw("st");
1505 $this->createSuggestedSolutionLinkingTo('st', $target);
1506 $this->tpl->setOnScreenMessage('success', $this->lng->txt("suggested_solution_added_successfully"), true);
1507 $this->ctrl->redirect($this, 'suggestedsolution');
1508 }

References ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ addTab_Question()

assQuestionGUI::addTab_Question ( ilTabsGUI  $tabs_gui)
protected

Definition at line 1614 of file class.assQuestionGUI.php.

1614 : void
1615 {
1617 'edit_question',
1618 $this->ctrl->getLinkTargetByClass(
1619 static::class,
1620 'editQuestion'
1621 ),
1622 'editQuestion',
1623 '',
1624 '',
1625 false
1626 );
1627 }
addTarget(string $a_text, string $a_link, $a_cmd="", $a_cmdClass="", string $a_frame="", bool $a_activate=false, bool $a_dir_text=false)

References ilTabsGUI\addTarget(), and ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ addTab_QuestionFeedback()

assQuestionGUI::addTab_QuestionFeedback ( ilTabsGUI  $tabs)
protected

Definition at line 1604 of file class.assQuestionGUI.php.

1604 : void
1605 {
1606 $tabCommands = self::getCommandsFromClassConstants(ilAssQuestionFeedbackEditingGUI::class);
1607
1608 $this->ctrl->setParameterByClass(ilAssQuestionFeedbackEditingGUI::class, 'q_id', $this->object->getId());
1609 $tabLink = $this->ctrl->getLinkTargetByClass(ilAssQuestionFeedbackEditingGUI::class, ilAssQuestionFeedbackEditingGUI::CMD_SHOW);
1610
1611 $tabs->addTarget('feedback', $tabLink, $tabCommands, $this->ctrl->getCmdClass(), '');
1612 }
static getCommandsFromClassConstants(string $guiClassName, string $cmdConstantNameBegin='CMD_')

References ilTabsGUI\addTarget(), ilAssQuestionFeedbackEditingGUI\CMD_SHOW, ILIAS\Repository\ctrl(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ addTab_SuggestedSolution()

assQuestionGUI::addTab_SuggestedSolution ( ilTabsGUI  $tabs,
string  $classname 
)

Definition at line 1570 of file class.assQuestionGUI.php.

1570 : void
1571 {
1572 $this->ctrl->setParameterByClass($classname, 'q_id', $this->object->getId());
1573 $tabs->addTarget(
1574 'suggested_solution',
1575 $this->ctrl->getLinkTargetByClass($classname, 'suggestedsolution'),
1576 [
1577 'suggestedsolution',
1578 'saveSuggestedSolution',
1579 'outSolutionExplorer',
1580 'cancel',
1581 'addSuggestedSolution',
1582 'cancelExplorer' ,
1583 'linkChilds',
1584 'removeSuggestedSolution'
1585 ]
1586 );
1587 }

References ilTabsGUI\addTarget(), ILIAS\Repository\ctrl(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ assessment()

assQuestionGUI::assessment ( )

Definition at line 558 of file class.assQuestionGUI.php.

558 : void
559 {
560 $stats_table = new ilQuestionCumulatedStatisticsTableGUI($this, 'assessment', '', $this->object, $this->questionrepository);
561 $usage_table = new ilQuestionUsagesTableGUI($this, 'assessment', '', $this->object);
562
563 $this->tpl->setContent(implode('<br />', [
564 $stats_table->getHTML(),
565 $usage_table->getHTML()
566 ]));
567 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ buildBasicEditFormObject()

assQuestionGUI::buildBasicEditFormObject ( )
protected

Definition at line 1756 of file class.assQuestionGUI.php.

1757 {
1758 $form = new ilPropertyFormGUI();
1759 $form->setFormAction($this->ctrl->getFormAction($this));
1760 $form->setId($this->getType());
1761 $form->setTitle($this->outQuestionType());
1762 $form->setTableWidth('100%');
1763 $form->setMultipart(true);
1764 return $form;
1765 }
getType()
needed for page editor compliance
This class represents a property form user interface.

References ILIAS\Repository\ctrl().

Referenced by assImagemapQuestionGUI\buildEditForm().

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

◆ buildEditForm()

assQuestionGUI::buildEditForm ( )
protected

Reimplemented in assImagemapQuestionGUI, assKprimChoiceGUI, assLongMenuGUI, and assOrderingQuestionGUI.

Definition at line 1772 of file class.assQuestionGUI.php.

1773 {
1774 $this->editQuestion(true); // TODO bheyser: editQuestion should be added to the abstract base class with a unified signature
1775 return $this->editForm;
1776 }
editQuestion(bool $checkonly=false, ?bool $is_save_cmd=null)
ilPropertyFormGUI $editForm

Referenced by assMultipleChoiceGUI\writePostData().

+ Here is the caller graph for this function:

◆ buildFileDownloadLink()

assQuestionGUI::buildFileDownloadLink ( )

Definition at line 2044 of file class.assQuestionGUI.php.

2044 : string
2045 {
2046 if (strtolower($this->request_data_collector->string('cmdClass')) === 'ilassquestionpreviewgui') {
2047 return $this->ctrl->getLinkTargetByClass(ilObjQuestionPoolGUI::class, 'downloadFile');
2048 }
2049 return $this->ctrl->getLinkTargetByClass(ilObjTestGUI::class, 'downloadFile');
2050 }

References ILIAS\Repository\ctrl().

Referenced by ilAssQuestionSkillAssignmentsGUI\buildQuestionPage().

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

◆ buildFocusAnchorHtml()

assQuestionGUI::buildFocusAnchorHtml ( )

Definition at line 1778 of file class.assQuestionGUI.php.

1778 : string
1779 {
1780 return '<div id="focus"></div>';
1781 }

◆ cancelExplorer()

assQuestionGUI::cancelExplorer ( )

Definition at line 1343 of file class.assQuestionGUI.php.

1343 : void
1344 {
1345 $this->ctrl->redirect($this, 'suggestedsolution');
1346 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ cancelSuggestedSolution()

assQuestionGUI::cancelSuggestedSolution ( )

Definition at line 1086 of file class.assQuestionGUI.php.

1086 : void
1087 {
1088 $this->suggestedsolution();
1089 }
suggestedsolution(bool $save=false)

◆ cleanupAnswerText()

assQuestionGUI::cleanupAnswerText ( array  $answer_text,
bool  $is_rte 
)
protected

sk - 12.05.2023: This is one more of those that we need, but don't want.

Deprecated:

Definition at line 1925 of file class.assQuestionGUI.php.

1925 : array
1926 {
1927 if (!is_array($answer_text)) {
1928 return [];
1929 }
1930
1931 if ($is_rte) {
1933 $answer_text,
1934 false,
1936 );
1937 }
1938
1940 $answer_text,
1941 true,
1942 self::ALLOWED_PLAIN_TEXT_TAGS
1943 );
1944 }
static stripSlashesRecursive($a_data, bool $a_strip_html=true, string $a_allow="")
static _getUsedHTMLTagsAsString(string $module='')

References ilRTESettings\_getUsedHTMLTagsAsString(), and ilArrayUtil\stripSlashesRecursive().

+ Here is the call graph for this function:

◆ cmdNeedsExistingQuestion()

assQuestionGUI::cmdNeedsExistingQuestion ( string  $cmd)

Definition at line 1975 of file class.assQuestionGUI.php.

1975 : bool
1976 {
1977 return in_array($cmd, static::ADDITIONAL_CMDS_NEEDING_EXISTING_QST);
1978 }

◆ completeTestOutputFormAction()

assQuestionGUI::completeTestOutputFormAction ( string  $form_action,
int  $active_id,
int  $pass 
)
protected

Reimplemented in assImagemapQuestionGUI.

Definition at line 1696 of file class.assQuestionGUI.php.

1700 : string {
1701 return $form_action;
1702 }

◆ createSuggestedSolutionLinkingTo()

assQuestionGUI::createSuggestedSolutionLinkingTo ( string  $type,
string  $target 
)
protected

Definition at line 1458 of file class.assQuestionGUI.php.

1459 {
1460 $repo = $this->getSuggestedSolutionsRepo();
1461 $question_id = $this->object->getId();
1462 $subquestion_index = $this->request_data_collector->int('subquestion_index');
1463 $subquestion_index = ($subquestion_index > 0) ? $subquestion_index : 0;
1464
1465 $solution = $repo->create($question_id, $type)
1466 ->withSubquestionIndex($subquestion_index)
1467 ->withInternalLink($target);
1468
1469 $repo->update([$solution]);
1470 }

◆ editQuestion()

◆ escapeTemplatePlaceholders()

assQuestionGUI::escapeTemplatePlaceholders ( string  $text)
protected

Definition at line 1767 of file class.assQuestionGUI.php.

1767 : string
1768 {
1769 return str_replace(['{','}'], ['&#123;','&#125;'], $text);
1770 }

◆ executeCommand()

assQuestionGUI::executeCommand ( )

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

335 {
336 $this->ilHelp->setScreenIdComponent('qpl');
337
338 $next_class = $this->ctrl->getNextClass($this);
339
340 switch ($next_class) {
341 case 'ilformpropertydispatchgui':
342 $form = $this->buildEditForm();
343 $form_prop_dispatch = new ilFormPropertyDispatchGUI();
344 $form_prop_dispatch->setItem($form->getItemByPostVar(ilUtil::stripSlashes($this->request_data_collector->string('postvar'))));
345 $this->ctrl->forwardCommand($form_prop_dispatch);
346 break;
347 default:
348 $cmd = $this->ctrl->getCmd('editQuestion');
349 switch ($cmd) {
353 case 'saveSuggestedSolutionType':
354 case 'saveContentsSuggestedSolution':
355 case 'deleteSuggestedSolution':
356 case 'linkChilds':
357 case 'cancelExplorer':
358 case 'outSolutionExplorer':
359 case 'addST':
360 case 'addPG':
361 case 'addGIT':
362 case 'save':
363 case 'saveReturn':
366 case 'editQuestion':
367 $this->$cmd();
368 break;
369 default:
370 if (method_exists($this, $cmd)) {
371 $this->$cmd();
372 }
373 }
374 }
375 }
const SUGGESTED_SOLUTION_COMMANDS_SAVE
const SUGGESTED_SOLUTION_COMMANDS_DEFAULT
const SUGGESTED_SOLUTION_COMMANDS_CANCEL
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")

References ILIAS\Repository\ctrl(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ generateCorrectnessIconsForCorrectness()

assQuestionGUI::generateCorrectnessIconsForCorrectness ( int  $correctness)
protected

Definition at line 1820 of file class.assQuestionGUI.php.

1820 : string
1821 {
1822 switch ($correctness) {
1824 $icon_name = 'standard/icon_not_ok.svg';
1825 $label = $this->lng->txt("answer_is_wrong");
1826 break;
1828 $icon_name = 'standard/icon_mostly_ok.svg';
1829 $label = $this->lng->txt("answer_is_not_correct_but_positive");
1830 break;
1832 $icon_name = 'standard/icon_ok.svg';
1833 $label = $this->lng->txt("answer_is_right");
1834 break;
1835 default:
1836 return '';
1837 }
1838 $path = ilUtil::getImagePath($icon_name);
1839 $icon = $this->ui->factory()->symbol()->icon()->custom(
1840 $path,
1841 $label
1842 );
1843 return $this->ui->renderer()->render($icon);
1844 }
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
$path
Definition: ltiservices.php:30

References $path, ilUtil\getImagePath(), ILIAS\Repository\lng(), and ILIAS\Repository\ui().

+ Here is the call graph for this function:

◆ genericFeedbackOutputBuilder()

assQuestionGUI::genericFeedbackOutputBuilder ( int  $active_id,
?int  $pass 
)
protected

Definition at line 1021 of file class.assQuestionGUI.php.

1024 : string {
1025 if ($pass === null) {
1026 return '';
1027 }
1028 $reached_points = $this->object->calculateReachedPoints($active_id, $pass);
1029 $max_points = $this->object->getMaximumPoints();
1030
1031 $is_correct = false;
1032 if ($reached_points == $max_points) {
1033 $is_correct = true;
1034 }
1035
1036 return $this->object->feedbackOBJ->getGenericFeedbackTestPresentation(
1037 $this->object->getId(),
1038 $is_correct
1039 );
1040 }

◆ getAdditionalEditQuestionCommands()

assQuestionGUI::getAdditionalEditQuestionCommands ( )
protected

Reimplemented in assKprimChoiceGUI.

Definition at line 1599 of file class.assQuestionGUI.php.

1599 : array
1600 {
1601 return [];
1602 }

◆ getAnswerFrequencyTableGUI()

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

Reimplemented in assClozeTestGUI, assKprimChoiceGUI, assLongMenuGUI, and assMatchingQuestionGUI.

Definition at line 1798 of file class.assQuestionGUI.php.

1799 {
1800 $table = new ilAnswerFrequencyStatisticTableGUI($parentGui, $parentCmd, $this->object);
1801 $table->setQuestionIndex($questionIndex);
1802 $table->setData($this->getAnswersFrequency($relevantAnswers, $questionIndex));
1803 $table->initColumns();
1804 return $table;
1805 }
getAnswersFrequency($relevantAnswers, $questionIndex)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ getAnswersFrequency()

assQuestionGUI::getAnswersFrequency (   $relevantAnswers,
  $questionIndex 
)

◆ getAsValueAttribute()

assQuestionGUI::getAsValueAttribute ( string  $a_value)

Definition at line 838 of file class.assQuestionGUI.php.

838 : string
839 {
840 $result = "";
841 if (strlen($a_value)) {
842 $result = " value=\"$a_value\" ";
843 }
844 return $result;
845 }

◆ getAutoSavedSolutionOutput()

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

Definition at line 2011 of file class.assQuestionGUI.php.

2023 : ?string {
2024 $autosave_solutions = $this->object->getSolutionValues($active_id, $pass, false);
2025 if ($autosave_solutions === []) {
2026 return null;
2027 }
2028 return $this->renderSolutionOutput(
2029 $autosave_solutions,
2030 $active_id,
2031 $pass,
2032 $graphical_output,
2033 $result_output,
2034 $show_question_only,
2035 $show_feedback,
2036 $show_correct_solution,
2037 $show_manual_scoring,
2038 $show_question_text,
2039 $show_autosave_title,
2040 $show_inline_feedback
2041 );
2042 }
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,)

◆ getBasicEditQuestionTabCommands()

assQuestionGUI::getBasicEditQuestionTabCommands ( )
protected

Definition at line 1594 of file class.assQuestionGUI.php.

1594 : array
1595 {
1596 return ['editQuestion', 'save', 'originalSyncForm'];
1597 }

◆ getCommandsFromClassConstants()

static assQuestionGUI::getCommandsFromClassConstants ( string  $guiClassName,
string  $cmdConstantNameBegin = 'CMD_' 
)
static

Definition at line 1523 of file class.assQuestionGUI.php.

1526 : array {
1527 $reflectionClass = new ReflectionClass($guiClassName);
1528
1529 $commands = null;
1530
1531 if ($reflectionClass instanceof ReflectionClass) {
1532 $commands = [];
1533
1534 foreach ($reflectionClass->getConstants() as $constName => $constValue) {
1535 if (substr($constName, 0, strlen($cmdConstantNameBegin)) == $cmdConstantNameBegin) {
1536 $commands[] = $constValue;
1537 }
1538 }
1539 }
1540
1541 return $commands;
1542 }

Referenced by ilPCQuestionGUI\setTabs().

+ Here is the caller graph for this function:

◆ getCommentsPanelHTML()

assQuestionGUI::getCommentsPanelHTML ( )

Definition at line 328 of file class.assQuestionGUI.php.

328 : string
329 {
330 $comment_gui = new ilCommentGUI($this->object->getObjId(), $this->object->getId(), 'quest');
331 return $comment_gui->getListHTML();
332 }

References ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ getContextPath()

assQuestionGUI::getContextPath (   $cont_obj,
int  $a_endnode_id,
int  $a_startnode_id = 1 
)

get context path in content object tree

Definition at line 780 of file class.assQuestionGUI.php.

780 : string
781 {
782 $path = "";
783
784 $tmpPath = $cont_obj->getLMTree()->getPathFull($a_endnode_id, $a_startnode_id);
785
786 // count -1, to exclude the learning module itself
787 for ($i = 1; $i < (count($tmpPath) - 1); $i++) {
788 if ($path != "") {
789 $path .= " > ";
790 }
791
792 $path .= $tmpPath[$i]["title"];
793 }
794
795 return $path;
796 }

References $path.

◆ getCopyToExistingPoolOnSave()

assQuestionGUI::getCopyToExistingPoolOnSave ( )

Definition at line 268 of file class.assQuestionGUI.php.

268 : ?int
269 {
271 }

Referenced by ilObjTestGUI\executeAfterQuestionCreationTasks().

+ Here is the caller graph for this function:

◆ getCopyToNewPoolOnSave()

assQuestionGUI::getCopyToNewPoolOnSave ( )

Definition at line 278 of file class.assQuestionGUI.php.

278 : ?string
279 {
281 }

Referenced by ilObjTestGUI\executeAfterQuestionCreationTasks().

+ Here is the caller graph for this function:

◆ getEditContext()

assQuestionGUI::getEditContext ( )

Definition at line 463 of file class.assQuestionGUI.php.

463 : string
464 {
465 return $this->editContext;
466 }

◆ getEditQuestionTabCommands()

assQuestionGUI::getEditQuestionTabCommands ( )
final

Definition at line 1589 of file class.assQuestionGUI.php.

1589 : array
1590 {
1591 return array_merge($this->getBasicEditQuestionTabCommands(), $this->getAdditionalEditQuestionCommands());
1592 }

◆ getErrorMessage()

assQuestionGUI::getErrorMessage ( )

Definition at line 818 of file class.assQuestionGUI.php.

818 : string
819 {
820 return $this->errormessage;
821 }

Referenced by assFormulaQuestionGUI\suggestRange().

+ Here is the caller graph for this function:

◆ getFormEncodingType()

assQuestionGUI::getFormEncodingType ( )

Reimplemented in assFileUploadGUI.

Definition at line 1709 of file class.assQuestionGUI.php.

1709 : string
1710 {
1712 }

◆ getGenericFeedbackOutput()

assQuestionGUI::getGenericFeedbackOutput ( int  $active_id,
?int  $pass 
)
Parameters
int | null$passActive pass

Definition at line 1006 of file class.assQuestionGUI.php.

1006 : string
1007 {
1008 $manual_feedback = ilObjTest::getManualFeedback($active_id, $this->object->getId(), $pass);
1009 if ($manual_feedback !== '') {
1010 return $manual_feedback;
1011 }
1012
1013 $output = $this->genericFeedbackOutputBuilder($active_id, $pass);
1014
1015 if ($this->object->isAdditionalContentEditingModePageObject()) {
1016 return $output;
1017 }
1019 }
renderLatex($content)
Wrap content with latex in a LatexContent UI component and render it to be processed by MathJax in th...
genericFeedbackOutputBuilder(int $active_id, ?int $pass)
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,...
static getManualFeedback(int $active_id, int $question_id, ?int $pass)
Retrieves the feedback comment for a question in a test if it is finalized.

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

Referenced by ilTestPlayerAbstractGUI\populateGenericFeedbackBlock().

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

◆ getGenericFeedbackOutputForCorrectSolution()

assQuestionGUI::getGenericFeedbackOutputForCorrectSolution ( )

Definition at line 1042 of file class.assQuestionGUI.php.

1042 : string
1043 {
1045 $this->object->feedbackOBJ->getGenericFeedbackTestPresentation($this->object->getId(), true),
1046 true
1047 ));
1048 }

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

+ Here is the call graph for this function:

◆ getGenericFeedbackOutputForIncorrectSolution()

assQuestionGUI::getGenericFeedbackOutputForIncorrectSolution ( )

Definition at line 1050 of file class.assQuestionGUI.php.

1050 : string
1051 {
1052 return $this->renderLatex(
1054 $this->object->feedbackOBJ->getGenericFeedbackTestPresentation($this->object->getId(), false),
1055 true
1056 )
1057 );
1058 }

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

+ Here is the call graph for this function:

◆ getHeaderAction()

assQuestionGUI::getHeaderAction ( )

Definition at line 308 of file class.assQuestionGUI.php.

308 : string
309 {
310 $parentObjType = $this->ilObjDataCache->lookupType($this->object->getObjId());
311
312 $dispatcher = new ilCommonActionDispatcherGUI(
314 $this->access,
315 $parentObjType,
316 $this->request_data_collector->getRefId(),
317 $this->object->getObjId()
318 );
319
320 $dispatcher->setSubObject("quest", $this->object->getId());
321
322 $ha = $dispatcher->initHeaderAction();
323 $ha->enableComments(true, false);
324
325 return $ha->getHeaderAction($this->ui->mainTemplate());
326 }
Class ilCommonActionDispatcherGUI.

References ILIAS\Repository\access(), ILIAS\Repository\object(), ilCommonActionDispatcherGUI\TYPE_REPOSITORY, and ILIAS\Repository\ui().

+ Here is the call graph for this function:

◆ getILIASPage()

assQuestionGUI::getILIASPage ( string  $html = "")

Returns the ILIAS Page around a question.

Definition at line 631 of file class.assQuestionGUI.php.

631 : string
632 {
633 $page_gui = new ilAssQuestionPageGUI($this->object->getId());
634 $page_gui->setFileDownloadLink($this->buildFileDownloadLink());
635 $page_gui->setQuestionHTML(
636 [$this->object->getId() => $html]
637 );
638 $presentation = $page_gui->presentation();
639 $presentation = preg_replace("/src=\"\\.\\//ims", "src=\"" . ILIAS_HTTP_PATH . "/", $presentation);
640 return $presentation;
641 }
Question page GUI class.

References ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ getMoveAfterQuestionId()

assQuestionGUI::getMoveAfterQuestionId ( )

Definition at line 288 of file class.assQuestionGUI.php.

288 : ?int
289 {
291 }

Referenced by ilObjTestGUI\executeAfterQuestionCreationTasks().

+ Here is the caller graph for this function:

◆ getNavigationGUI()

assQuestionGUI::getNavigationGUI ( )

Definition at line 488 of file class.assQuestionGUI.php.

◆ getObject()

assQuestionGUI::getObject ( )
Deprecated:
sk 25 FEB 2024: I introduce this to not have to have the object public, I don't think the process to access the question object through the QuestiionGUI is correct and should go asap!

Definition at line 249 of file class.assQuestionGUI.php.

250 {
251 return $this->object;
252 }

Referenced by ilTestCorrectionsGUI\buildQuestionCorrectionForm(), ilAssQuestionSkillAssignmentsGUI\buildQuestionPage(), ilObjTestGUI\copyQuestionToPool(), ilTestPlayerAbstractGUI\determineSolutionPassIndex(), ilObjTestGUI\executeAfterQuestionCreationTasks(), ilObjTestGUI\executeAfterQuestionSaveTasks(), ilTestCorrectionsGUI\getQuestionGUI(), ilTestPlayerAbstractGUI\getQuestionGuiInstance(), ilAssQuestionPreviewGUI\initQuestion(), ilTestPlayerAbstractGUI\populateInstantResponseBlocks(), ilTestPlayerAbstractGUI\populateInstantResponseModal(), ilTestCorrectionsGUI\populatePageTitleAndDescription(), ilTestPlayerAbstractGUI\populateQuestionEditControl(), ilTestPlayerAbstractGUI\populateSpecificFeedbackBlock(), ilTestCorrectionsGUI\saveQuestion(), ilTestCorrectionsGUI\setCorrectionTabsContext(), ilTestPlayerAbstractGUI\showListOfAnswers(), ilObjTestGUI\showNextViewAfterQuestionSave(), ilTestPlayerAbstractGUI\showQuestionCmd(), ilTestCorrectionsGUI\showSolution(), and ilTestCorrectionsGUI\supportsAdjustment().

+ Here is the caller graph for this function:

◆ getPresentationContext()

assQuestionGUI::getPresentationContext ( )

Definition at line 388 of file class.assQuestionGUI.php.

388 : ?string
389 {
391 }

◆ getPresentationJavascripts()

assQuestionGUI::getPresentationJavascripts ( )

Reimplemented in assMultipleChoiceGUI.

Definition at line 608 of file class.assQuestionGUI.php.

608 : array
609 {
610 return [];
611 }

◆ getPreview()

◆ getPreviewSession()

assQuestionGUI::getPreviewSession ( )
Returns
ilAssQuestionPreviewSession|null

Definition at line 1751 of file class.assQuestionGUI.php.

◆ getPreviousSolutionConfirmationCheckboxHtml()

assQuestionGUI::getPreviousSolutionConfirmationCheckboxHtml ( )
protected

Reimplemented in assFileUploadGUI, and assImagemapQuestionGUI.

Definition at line 687 of file class.assQuestionGUI.php.

687 : string
688 {
689 $tpl = new ilTemplate('tpl.tst_question_additional_behaviour_checkbox.html', true, true, 'components/ILIAS/TestQuestionPool');
690 $tpl->setVariable('TXT_FORCE_FORM_DIFF_LABEL', $this->lng->txt('use_previous_solution'));
691 return $tpl->get();
692 }
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.
special template class to simplify handling of ITX/PEAR

References ilGlobalPageTemplate\get(), ILIAS\Repository\lng(), and ilGlobalPageTemplate\setVariable().

+ Here is the call graph for this function:

◆ getPreviousSolutionProvidedMessage()

assQuestionGUI::getPreviousSolutionProvidedMessage ( )
protected

Reimplemented in assFileUploadGUI.

Definition at line 682 of file class.assQuestionGUI.php.

682 : string
683 {
684 return $this->lng->txt('use_previous_solution_advice');
685 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getQuestionActionCmd()

assQuestionGUI::getQuestionActionCmd ( )

Definition at line 544 of file class.assQuestionGUI.php.

544 : string
545 {
547 }

◆ getQuestionCount()

assQuestionGUI::getQuestionCount ( )

Definition at line 813 of file class.assQuestionGUI.php.

813 : int
814 {
816 }
int $question_count
question count in test

◆ getQuestionHeaderBlockBuilder()

assQuestionGUI::getQuestionHeaderBlockBuilder ( )

Definition at line 529 of file class.assQuestionGUI.php.

530 {
532 }
ilQuestionHeaderBlockBuilder $questionHeaderBlockBuilder
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

Referenced by ilTestPlayerAbstractGUI\populateInstantResponseModal(), and ilTestPlayerAbstractGUI\showQuestionEditable().

+ Here is the caller graph for this function:

◆ getQuestionSyncModal()

assQuestionGUI::getQuestionSyncModal ( string  $cmd,
string  $cmd_class = '' 
)

Definition at line 1991 of file class.assQuestionGUI.php.

1991 : string
1992 {
1993 if ($cmd_class === '') {
1994 $cmd_class = static::class;
1995 }
1996 $modal = $this->ui->factory()->modal()->interruptive(
1997 $this->lng->txt('confirm'),
1998 $this->lng->txt('confirm_sync_questions'),
1999 $this->ctrl->getFormActionByClass($cmd_class, $cmd)
2000 )->withAffectedItems([
2001 $this->ui->factory()->modal()->interruptiveItem()->standard(
2002 (string) $this->object->getOriginalId(),
2003 $this->object->getTitleForHTMLOutput()
2004 )
2005 ])->withActionButtonLabel($this->lng->txt('sync_question_to_pool'));
2006 return $this->ui->renderer()->render(
2007 $modal->withOnLoad($modal->getShowSignal())
2008 );
2009 }

References ILIAS\Repository\lng(), and ILIAS\Repository\ui().

+ Here is the call graph for this function:

◆ getQuestionTemplate()

assQuestionGUI::getQuestionTemplate ( )

Definition at line 613 of file class.assQuestionGUI.php.

613 : void
614 {
615 // @todo Björn: Maybe this has to be changed for PHP 7/ILIAS 5.2.x because ass[XYZ]QuestionGUI::editQuestion is called multiple times
616 if (!$this->tpl->blockExists('adm_content')) {
617 $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.il_as_question.html', 'components/ILIAS/TestQuestionPool');
618 }
619 }

◆ getQuestionType()

assQuestionGUI::getQuestionType ( )

Definition at line 833 of file class.assQuestionGUI.php.

833 : string
834 {
835 return $this->object->getQuestionType();
836 }

◆ getRenderPurpose()

assQuestionGUI::getRenderPurpose ( )

Definition at line 415 of file class.assQuestionGUI.php.

415 : string
416 {
418 }

◆ getSequenceNumber()

assQuestionGUI::getSequenceNumber ( )

Definition at line 803 of file class.assQuestionGUI.php.

803 : int
804 {
805 return $this->sequence_no;
806 }
int $sequence_no
sequence number in test

◆ getSolutionOutput()

assQuestionGUI::getSolutionOutput ( int  $active_id,
?int  $pass = null,
bool  $graphical_output = false,
bool  $result_output = false,
bool  $show_question_only = true,
bool  $show_feedback = false,
bool  $show_correct_solution = false,
bool  $show_manual_scoring = false,
bool  $show_question_text = true,
bool  $show_inline_feedback = true 
)
abstract

◆ getSpecificFeedbackOutput()

assQuestionGUI::getSpecificFeedbackOutput ( array  $userSolution)
abstract

Returns the answer specific feedback for the question.

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

Reimplemented in assClozeTestGUI, assErrorTextGUI, assSingleChoiceGUI, assTextSubsetGUI, assFileUploadGUI, assFormulaQuestionGUI, assImagemapQuestionGUI, assKprimChoiceGUI, assLongMenuGUI, assMatchingQuestionGUI, assMultipleChoiceGUI, assNumericGUI, assOrderingHorizontalGUI, assOrderingQuestionGUI, and assTextQuestionGUI.

Referenced by ilTestPlayerAbstractGUI\populateSpecificFeedbackBlock().

+ Here is the caller graph for this function:

◆ getSubQuestionsIndex()

assQuestionGUI::getSubQuestionsIndex ( )

Reimplemented in assClozeTestGUI, and assLongMenuGUI.

Definition at line 1788 of file class.assQuestionGUI.php.

1788 : array
1789 {
1790 return [0];
1791 }

◆ getSuggestedSolutionsRepo()

assQuestionGUI::getSuggestedSolutionsRepo ( )
protected

Definition at line 1912 of file class.assQuestionGUI.php.

1913 {
1914 if (is_null($this->suggestedsolution_repo)) {
1915 $dic = QuestionPoolDIC::dic();
1916 $this->suggestedsolution_repo = $dic['question.repo.suggestedsolutions'];
1917 }
1919 }
SuggestedSolutionsDatabaseRepository $suggestedsolution_repo
$dic
Definition: ltiresult.php:33

References $dic.

◆ getTargetGuiClass()

assQuestionGUI::getTargetGuiClass ( )

Definition at line 518 of file class.assQuestionGUI.php.

518 : ?string
519 {
521 }

◆ getTaxonomyIds()

assQuestionGUI::getTaxonomyIds ( )

Definition at line 503 of file class.assQuestionGUI.php.

503 : array
504 {
505 return $this->taxonomyIds;
506 }

◆ getTestOutput()

assQuestionGUI::getTestOutput ( int  $active_id,
int  $pass,
bool  $is_question_postponed = false,
array|bool  $user_post_solutions = false,
bool  $show_specific_inline_feedback = false 
)
abstract

◆ getType()

assQuestionGUI::getType ( )

needed for page editor compliance

Definition at line 383 of file class.assQuestionGUI.php.

383 : string
384 {
385 return $this->getQuestionType();
386 }

◆ getTypeOptions()

assQuestionGUI::getTypeOptions ( )
protected

Definition at line 1073 of file class.assQuestionGUI.php.

1073 : array
1074 {
1075 foreach (SuggestedSolution::TYPES as $k => $v) {
1076 $options[$k] = $this->lng->txt($v);
1077 }
1078 return $options;
1079 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getUseUnchangedAnswerCheckboxHtml()

assQuestionGUI::getUseUnchangedAnswerCheckboxHtml ( )
protected

Reimplemented in assMultipleChoiceGUI.

Definition at line 675 of file class.assQuestionGUI.php.

675 : string
676 {
677 $tpl = new ilTemplate('tpl.tst_question_additional_behaviour_checkbox.html', true, true, 'components/ILIAS/TestQuestionPool');
678 $tpl->setVariable('TXT_FORCE_FORM_DIFF_LABEL', $this->object->getTestPresentationConfig()->getUseUnchangedAnswerLabel());
679 return $tpl->get();
680 }

References ilGlobalPageTemplate\get(), ILIAS\Repository\object(), and ilGlobalPageTemplate\setVariable().

+ Here is the call graph for this function:

◆ hasCorrectSolution()

assQuestionGUI::hasCorrectSolution (   $activeId,
  $passIndex 
)
protected

Definition at line 1629 of file class.assQuestionGUI.php.

1629 : bool
1630 {
1631 $reachedPoints = $this->object->getAdjustedReachedPoints((int) $activeId, (int) $passIndex, true);
1632 $maximumPoints = $this->object->getMaximumPoints();
1633
1634 return $reachedPoints == $maximumPoints;
1635 }

◆ hasInlineFeedback()

assQuestionGUI::hasInlineFeedback ( )

Reimplemented in assKprimChoiceGUI, assMultipleChoiceGUI, and assSingleChoiceGUI.

Definition at line 293 of file class.assQuestionGUI.php.

293 : bool
294 {
295 return false;
296 }

Referenced by ilTestPlayerAbstractGUI\populateInstantResponseBlocks().

+ Here is the caller graph for this function:

◆ hasSpecialQuestionCommands()

assQuestionGUI::hasSpecialQuestionCommands ( )
protected

Definition at line 377 of file class.assQuestionGUI.php.

377 : bool
378 {
379 return static::HAS_SPECIAL_QUESTION_COMMANDS;
380 }

◆ isAdjustmentEditContext()

assQuestionGUI::isAdjustmentEditContext ( )

Definition at line 478 of file class.assQuestionGUI.php.

478 : bool
479 {
481 }

◆ isAnswerFrequencyStatisticSupported()

assQuestionGUI::isAnswerFrequencyStatisticSupported ( )

Definition at line 1783 of file class.assQuestionGUI.php.

1783 : bool
1784 {
1785 return true;
1786 }

Referenced by ilTestCorrectionsGUI\setCorrectionTabsContext().

+ Here is the caller graph for this function:

◆ isAuthoringEditContext()

assQuestionGUI::isAuthoringEditContext ( )

Definition at line 473 of file class.assQuestionGUI.php.

473 : bool
474 {
476 }

◆ isAutosaveable()

assQuestionGUI::isAutosaveable ( )

Definition at line 1637 of file class.assQuestionGUI.php.

1637 : bool
1638 {
1639 return $this->object instanceof QuestionAutosaveable;
1640 }

◆ isInLearningModuleContext()

assQuestionGUI::isInLearningModuleContext ( )

Definition at line 1946 of file class.assQuestionGUI.php.

1946 : bool
1947 {
1949 }

Referenced by assOrderingQuestionGUI\populateQuestionSpecificFormPart().

+ Here is the caller graph for this function:

◆ isPreviousSolutionPrefilled()

assQuestionGUI::isPreviousSolutionPrefilled ( )

Definition at line 404 of file class.assQuestionGUI.php.

404 : bool
405 {
407 }

◆ isRenderPurposeDemoplay()

assQuestionGUI::isRenderPurposeDemoplay ( )

Definition at line 445 of file class.assQuestionGUI.php.

445 : bool
446 {
448 }

◆ isRenderPurposeInputValue()

assQuestionGUI::isRenderPurposeInputValue ( )

Definition at line 435 of file class.assQuestionGUI.php.

435 : bool
436 {
438 }

◆ isRenderPurposePlayback()

assQuestionGUI::isRenderPurposePlayback ( )

Definition at line 440 of file class.assQuestionGUI.php.

440 : bool
441 {
443 }

◆ isRenderPurposePreview()

assQuestionGUI::isRenderPurposePreview ( )

Definition at line 430 of file class.assQuestionGUI.php.

430 : bool
431 {
433 }

◆ isRenderPurposePrintPdf()

assQuestionGUI::isRenderPurposePrintPdf ( )

Definition at line 425 of file class.assQuestionGUI.php.

425 : bool
426 {
428 }

Referenced by assOrderingQuestionGUI\populateAnswerSpecificFormPart().

+ Here is the caller graph for this function:

◆ isSaveCommand()

assQuestionGUI::isSaveCommand ( )

Definition at line 1518 of file class.assQuestionGUI.php.

1518 : bool
1519 {
1520 return in_array($this->ctrl->getCmd(), self::QUESTION_SAVE_CMDS);
1521 }

References ILIAS\Repository\ctrl().

Referenced by assFormulaQuestionGUI\writePostData().

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

◆ isTestPresentationContext()

assQuestionGUI::isTestPresentationContext ( )

Definition at line 398 of file class.assQuestionGUI.php.

398 : bool
399 {
401 }

◆ linkChilds()

assQuestionGUI::linkChilds ( )

Definition at line 1472 of file class.assQuestionGUI.php.

1472 : void
1473 {
1474 $this->ctrl->saveParameter($this, ["subquestion_index", "link_new_type", "search_link_type"]);
1475 switch ($this->request_data_collector->string("search_link_type")) {
1476 case "pg":
1477 $this->outPageSelector();
1478 break;
1479 case "st":
1480 $this->outChapterSelector();
1481 break;
1482 case "glo":
1483 $this->outGlossarySelector();
1484 break;
1485 case "lm":
1486 $target = "il__lm_" . $this->request_data_collector->raw("source_id");
1487 $this->createSuggestedSolutionLinkingTo('lm', $target);
1488 $this->tpl->setOnScreenMessage('success', $this->lng->txt("suggested_solution_added_successfully"), true);
1489 $this->ctrl->redirect($this, 'suggestedsolution');
1490 break;
1491 }
1492 }

References ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ magicAfterTestOutput()

assQuestionGUI::magicAfterTestOutput ( )

Reimplemented in assTextQuestionGUI.

Definition at line 1704 of file class.assQuestionGUI.php.

1704 : void
1705 {
1706 return;
1707 }

◆ needsSyncQuery()

assQuestionGUI::needsSyncQuery ( )

Definition at line 1985 of file class.assQuestionGUI.php.

1985 : bool
1986 {
1987 return $this->context_allows_sync_to_pool
1988 && $this->object->hasWritableOriginalInQuestionPool();
1989 }

◆ outChapterSelector()

assQuestionGUI::outChapterSelector ( )

Definition at line 1402 of file class.assQuestionGUI.php.

1402 : void
1403 {
1404 $this->ctrl->setParameter($this, 'q_id', $this->object->getId());
1405
1406 $cont_obj_gui = new ilObjContentObjectGUI('', $this->request_data_collector->int('source_id'), true);
1407 $cont_obj = $cont_obj_gui->getObject();
1408 $ctree = $cont_obj->getLMTree();
1409 $nodes = $ctree->getSubtree($ctree->getNodeData($ctree->getRootId()));
1410
1411 $rows = [];
1412
1413 foreach ($nodes as $node) {
1414 if ($node['type'] == $this->request_data_collector->raw('search_link_type')) {
1415 $this->ctrl->setParameter($this, $node['type'], $node['obj_id']);
1416 $rows[] = [
1417 'title' => $node['title'],
1418 'description' => '',
1419 'text_add' => $this->lng->txt('add'),
1420 'href_add' => $this->ctrl->getLinkTarget($this, 'add' . strtoupper($node['type']))
1421 ];
1422 }
1423 }
1424
1425 $table = new ilQuestionInternalLinkSelectionTableGUI($this, 'cancelExplorer', __METHOD__);
1426 $table->setTitle($this->lng->txt('obj_' . ilUtil::stripSlashes($this->request_data_collector->string('search_link_type'))));
1427 $table->setData($rows);
1428
1429 $this->tpl->setContent($table->getHTML());
1430 }
Class ilObjContentObjectGUI.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\Repository\object(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ outGlossarySelector()

assQuestionGUI::outGlossarySelector ( )

Definition at line 1432 of file class.assQuestionGUI.php.

1432 : void
1433 {
1434 $this->ctrl->setParameter($this, 'q_id', $this->object->getId());
1435
1436 $glossary = new ilObjGlossary($this->request_data_collector->int('source_id'), true);
1437 $terms = $glossary->getTermList();
1438
1439 $rows = [];
1440
1441 foreach ($terms as $term) {
1442 $this->ctrl->setParameter($this, 'git', $term['id']);
1443 $rows[] = [
1444 'title' => $term['term'],
1445 'description' => '',
1446 'text_add' => $this->lng->txt('add'),
1447 'href_add' => $this->ctrl->getLinkTarget($this, 'addGIT')
1448 ];
1449 }
1450
1451 $table = new ilQuestionInternalLinkSelectionTableGUI($this, 'cancelExplorer', __METHOD__);
1452 $table->setTitle($this->lng->txt('glossary_term'));
1453 $table->setData($rows);
1454
1455 $this->tpl->setContent($table->getHTML());
1456 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ outPageSelector()

assQuestionGUI::outPageSelector ( )

Definition at line 1348 of file class.assQuestionGUI.php.

1348 : void
1349 {
1350 $this->ctrl->setParameter($this, 'q_id', $this->object->getId());
1351
1352 $cont_obj_gui = new ilObjContentObjectGUI('', $this->request_data_collector->int('source_id'), true);
1353 $cont_obj = $cont_obj_gui->getObject();
1354 $pages = ilLMPageObject::getPageList($cont_obj->getId());
1355 $shownpages = [];
1356 $tree = $cont_obj->getLMTree();
1357 $chapters = $tree->getSubtree($tree->getNodeData($tree->getRootId()));
1358
1359 $rows = [];
1360
1361 foreach ($chapters as $chapter) {
1362 $chapterpages = $tree->getChildsByType($chapter['obj_id'], 'pg');
1363 foreach ($chapterpages as $page) {
1364 if ($page['type'] == $this->request_data_collector->raw('search_link_type')) {
1365 array_push($shownpages, $page['obj_id']);
1366
1367 if ($tree->isInTree($page['obj_id'])) {
1368 $path_str = $this->getContextPath($cont_obj, $page['obj_id']);
1369 } else {
1370 $path_str = '---';
1371 }
1372
1373 $this->ctrl->setParameter($this, $page['type'], $page['obj_id']);
1374 $rows[] = [
1375 'title' => $page['title'],
1376 'description' => ilLegacyFormElementsUtil::prepareFormOutput($path_str),
1377 'text_add' => $this->lng->txt('add'),
1378 'href_add' => $this->ctrl->getLinkTarget($this, 'add' . strtoupper($page['type']))
1379 ];
1380 }
1381 }
1382 }
1383 foreach ($pages as $page) {
1384 if (!in_array($page['obj_id'], $shownpages)) {
1385 $this->ctrl->setParameter($this, $page['type'], $page['obj_id']);
1386 $rows[] = [
1387 'title' => $page['title'],
1388 'description' => '---',
1389 'text_add' => $this->lng->txt('add'),
1390 'href_add' => $this->ctrl->getLinkTarget($this, 'add' . strtoupper($page['type']))
1391 ];
1392 }
1393 }
1394
1395 $table = new ilQuestionInternalLinkSelectionTableGUI($this, 'cancelExplorer', __METHOD__);
1396 $table->setTitle($this->lng->txt('obj_' . ilUtil::stripSlashes($this->request_data_collector->string('search_link_type'))));
1397 $table->setData($rows);
1398
1399 $this->tpl->setContent($table->getHTML());
1400 }
getContextPath($cont_obj, int $a_endnode_id, int $a_startnode_id=1)
get context path in content object tree
static getPageList(int $lm_id)
isInTree(?int $a_node_id)
get all information of a node.
getNodeData(int $a_node_id, ?int $a_tree_pk=null)
get all information of a node.
getChildsByType(int $a_node_id, string $a_type)
get child nodes of given node by object type

References ILIAS\Repository\ctrl(), ilTree\getChildsByType(), ilTree\getNodeData(), ilLMPageObject\getPageList(), ilTree\getRootId(), ilTree\isInTree(), ILIAS\Repository\lng(), ILIAS\Repository\object(), ilLegacyFormElementsUtil\prepareFormOutput(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ outQuestionForTest()

assQuestionGUI::outQuestionForTest ( string  $formaction,
int  $active_id,
?int  $pass,
bool  $is_question_postponed = false,
array|bool  $user_post_solutions = false,
bool  $show_specific_inline_feedback = false 
)
final

Definition at line 1670 of file class.assQuestionGUI.php.

1677 : void {
1678 $formaction = $this->completeTestOutputFormAction($formaction, $active_id, $pass);
1679
1680 $test_output = $this->getTestOutput(
1681 $active_id,
1682 $pass,
1683 $is_question_postponed,
1684 $user_post_solutions,
1685 $show_specific_inline_feedback
1686 );
1687
1688 $this->magicAfterTestOutput();
1689
1690 $this->tpl->setVariable("QUESTION_OUTPUT", $test_output);
1691 $this->tpl->setVariable("FORMACTION", $formaction);
1692 $this->tpl->setVariable("ENCTYPE", 'enctype="' . $this->getFormEncodingType() . '"');
1693 $this->tpl->setVariable("FORM_TIMESTAMP", (string) time());
1694 }
completeTestOutputFormAction(string $form_action, int $active_id, int $pass)
getTestOutput(int $active_id, int $pass, bool $is_question_postponed=false, array|bool $user_post_solutions=false, bool $show_specific_inline_feedback=false)

◆ outQuestionPage()

assQuestionGUI::outQuestionPage (   $a_temp_var,
  $a_postponed = false,
  $active_id = "",
  $html = "",
  $inlineFeedbackEnabled = false 
)

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

643 : string
644 {
645 if ($this->object->getTestPresentationConfig()->isSolutionInitiallyPrefilled()) {
646 // hey
647 $this->tpl->setOnScreenMessage('info', $this->getPreviousSolutionProvidedMessage());
649 } elseif ($this->object->getTestPresentationConfig()->isUnchangedAnswerPossible()) {
650 $html .= $this->getUseUnchangedAnswerCheckboxHtml();
651 }
652
653 $this->lng->loadLanguageModule("content");
654
655 $page_gui = new ilAssQuestionPageGUI($this->object->getId());
656 $page_gui->setFileDownloadLink($this->buildFileDownloadLink());
657 $page_gui->setOutputMode('presentation');
658 $page_gui->setTemplateTargetVar($a_temp_var);
659
660 if ($this->getNavigationGUI()) {
661 $html .= $this->getNavigationGUI()->getHTML();
662 $page_gui->setQuestionActionsHTML($this->getNavigationGUI()->getActionsHTML());
663 }
664
665 if (strlen($html)) {
666 $page_gui->setQuestionHTML([$this->object->getId() => $html]);
667 }
668
669 $page_gui->setPresentationTitle($this->questionHeaderBlockBuilder->getPresentationTitle());
670 $page_gui->setQuestionInfoHTML($this->questionHeaderBlockBuilder->getQuestionInfoHTML());
671
672 return $page_gui->presentation();
673 }

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

Referenced by ilTestPlayerAbstractGUI\populateInstantResponseModal().

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

◆ outQuestionType()

assQuestionGUI::outQuestionType ( )

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

1060 : string
1061 {
1062 $count = $this->questionrepository->usageCount($this->object->getId());
1063
1064 if ($this->questionrepository->questionExistsInPool($this->object->getId()) && $count) {
1065 if ($this->rbacsystem->checkAccess("write", $this->request_data_collector->getRefId())) {
1066 $this->tpl->setOnScreenMessage('info', sprintf($this->lng->txt("qpl_question_is_in_use"), $count));
1067 }
1068 }
1069
1070 return $this->lng->txt($this->object->getQuestionType());
1071 }

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

Referenced by ilTestCorrectionsGUI\populatePageTitleAndDescription().

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

◆ outSolutionExplorer()

assQuestionGUI::outSolutionExplorer ( )

Definition at line 1275 of file class.assQuestionGUI.php.

1275 : void
1276 {
1277 $type = $this->request_data_collector->string("link_new_type");
1278 $search = $this->request_data_collector->string("search_link_type");
1279 $this->ctrl->setParameter($this, "link_new_type", $type);
1280 $this->ctrl->setParameter($this, "search_link_type", $search);
1281 $this->ctrl->saveParameter($this, ["subquestion_index", "link_new_type", "search_link_type"]);
1282
1283 $this->tpl->setOnScreenMessage('info', $this->lng->txt("select_object_to_link"));
1284
1285 $parent_ref_id = $this->tree->getParentId($this->request_data_collector->getRefId());
1286 $exp = new ilSolutionExplorer($this->ctrl->getLinkTarget($this, 'suggestedsolution'), get_class($this));
1287 $exp->setExpand($this->request_data_collector->raw('expand_sol') ? $this->request_data_collector->raw('expand_sol') : $parent_ref_id);
1288 $exp->setExpandTarget($this->ctrl->getLinkTarget($this, 'outSolutionExplorer'));
1289 $exp->setTargetGet("ref_id");
1290 $exp->setRefId($this->request_data_collector->getRefId());
1291 $exp->addFilter($type);
1292 $exp->setSelectableType($type);
1293 if ($this->request_data_collector->isset('expandCurrentPath') && $this->request_data_collector->raw('expandCurrentPath')) {
1294 $exp->expandPathByRefId($parent_ref_id);
1295 }
1296
1297 // build html-output
1298 $exp->setOutput(0);
1299
1300 $template = new ilTemplate("tpl.il_as_qpl_explorer.html", true, true, "components/ILIAS/TestQuestionPool");
1301 $template->setVariable("EXPLORER_TREE", $exp->getOutput());
1302 $template->setVariable("BUTTON_CANCEL", $this->lng->txt("cancel"));
1303 $template->setVariable("FORMACTION", $this->ctrl->getFormAction($this, "suggestedsolution"));
1304 $this->tpl->setVariable("ADM_CONTENT", $template->get());
1305 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ populateCorrectionsFormProperties()

◆ populateJavascriptFilesRequiredForWorkForm()

assQuestionGUI::populateJavascriptFilesRequiredForWorkForm ( ilGlobalTemplateInterface  $tpl)

Definition at line 601 of file class.assQuestionGUI.php.

601 : void
602 {
603 foreach ($this->getPresentationJavascripts() as $jsFile) {
604 $tpl->addJavaScript($jsFile);
605 }
606 }
addJavaScript(string $a_js_file, bool $a_add_version_parameter=true, int $a_batch=2)
Add a javascript file that should be included in the header.

References ILIAS\UICore\GlobalTemplate\addJavaScript().

Referenced by ilTestPlayerAbstractGUI\getQuestionGuiInstance().

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

◆ populateTaxonomyFormSection()

assQuestionGUI::populateTaxonomyFormSection ( ilPropertyFormGUI  $form)
protected

Definition at line 976 of file class.assQuestionGUI.php.

976 : void
977 {
978 if ($this->getTaxonomyIds() !== []) {
979 $sectHeader = new ilFormSectionHeaderGUI();
980 $sectHeader->setTitle($this->lng->txt('qpl_qst_edit_form_taxonomy_section'));
981 $form->addItem($sectHeader);
982
983 foreach ($this->getTaxonomyIds() as $taxonomyId) {
984 $taxonomy = new ilObjTaxonomy($taxonomyId);
985 $label = sprintf($this->lng->txt('qpl_qst_edit_form_taxonomy'), $taxonomy->getTitle());
986 $postvar = "tax_node_assign_$taxonomyId";
987
988 $taxSelect = new ilTaxSelectInputGUI($taxonomy->getId(), $postvar, true);
989 $taxSelect->setTitle($label);
990
991
992 $taxNodeAssignments = new ilTaxNodeAssignment(ilObject::_lookupType($this->object->getObjId()), $this->object->getObjId(), 'quest', $taxonomyId);
993 $assignedNodes = $taxNodeAssignments->getAssignmentsOfItem($this->object->getId());
994
995 $taxSelect->setValue(array_map(function ($assignedNode) {
996 return $assignedNode['node_id'];
997 }, $assignedNodes));
998 $form->addItem($taxSelect);
999 }
1000 }
1001 }
This class represents a section header 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...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

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

Referenced by assImagemapQuestionGUI\buildEditForm().

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

◆ prepareReprintableCorrectionsForm()

assQuestionGUI::prepareReprintableCorrectionsForm ( ilPropertyFormGUI  $form)

Reimplemented in assOrderingQuestionGUI.

Definition at line 1807 of file class.assQuestionGUI.php.

1807 : void
1808 {
1809 }

Referenced by ilTestCorrectionsGUI\saveQuestion().

+ Here is the caller graph for this function:

◆ prepareTextareaOutput()

static assQuestionGUI::prepareTextareaOutput ( ?string  $txt_output,
bool  $prepare_for_latex_output = false,
bool  $omitNl2BrWhenTextArea = false 
)
static

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.

Parameters
string$txt_outputString which should be prepared for output @access public

Definition at line 1854 of file class.assQuestionGUI.php.

1858 : string {
1859 if ($txt_output === null || $txt_output === '') {
1860 return '';
1861 }
1862
1863 $result = $txt_output;
1864 $is_html = false;
1865
1866 if (strlen(strip_tags($result)) < strlen($result)) {
1867 $is_html = true;
1868 }
1869
1870 // removed: did not work with magic_quotes_gpc = On
1871 if (!$is_html) {
1872 if (!$omitNl2BrWhenTextArea) {
1873 // if the string does not contain HTML code, replace the newlines with HTML line breaks
1874 $result = preg_replace("/[\n]/", "<br />", $result);
1875 }
1876 } else {
1877 // patch for problems with the <pre> tags in tinyMCE
1878 if (preg_match_all("/(<pre>.*?<\/pre>)/ims", $result, $matches)) {
1879 foreach ($matches[0] as $found) {
1880 $replacement = "";
1881 if (strpos("\n", $found) === false) {
1882 $replacement = "\n";
1883 }
1884 $removed = preg_replace("/<br\s*?\/>/ims", $replacement, $found);
1885 $result = str_replace($found, $removed, $result);
1886 }
1887 }
1888 }
1889
1890 if ($prepare_for_latex_output) {
1891 $result = ilRTE::replaceLatexSpan($result);
1892
1893 // replace special characters to prevent problems with the ILIAS template system
1894 // eg. if someone uses {1} as an answer, nothing will be shown without the replacement
1895 $result = str_replace("{", "&#123;", $result);
1896 $result = str_replace("}", "&#125;", $result);
1897 $result = str_replace("\\", "&#92;", $result);
1898 }
1899
1900 return $result;
1901 }
static replaceLatexSpan(string $text)
Replace the latex delimiters used by the rich text editor Unfortunately these can't be processed by M...

◆ redrawHeaderAction()

assQuestionGUI::redrawHeaderAction ( )

Definition at line 302 of file class.assQuestionGUI.php.

302 : void
303 {
304 echo $this->getHeaderAction() . $this->ui->mainTemplate()->getOnLoadCodeForAsynch();
305 exit;
306 }
exit

References exit, and ILIAS\Repository\ui().

+ Here is the call graph for this function:

◆ renderEditForm()

assQuestionGUI::renderEditForm ( ilPropertyFormGUI  $form)
protected

Definition at line 621 of file class.assQuestionGUI.php.

621 : void
622 {
624 $this->getQuestionTemplate();
625 $this->tpl->setVariable('QUESTION_DATA', $form->getHTML() . $this->question_sync_modal);
626 }

References ilPropertyFormGUI\getHTML().

Referenced by assOrderingQuestionGUI\buildEditFormAfterTypeChange(), and assOrderingQuestionGUI\writePostData().

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

◆ renderLatex()

assQuestionGUI::renderLatex (   $content)
protected

Wrap content with latex in a LatexContent UI component and render it to be processed by MathJax in the browser.

Definition at line 1906 of file class.assQuestionGUI.php.

1907 {
1908 return $this->ui->renderer()->render($this->ui->factory()->legacy()->latexContent($content));
1909 }

References ILIAS\Repository\ui().

+ Here is the call graph for this function:

◆ renderPurposeSupportsFormHtml()

assQuestionGUI::renderPurposeSupportsFormHtml ( )

Definition at line 450 of file class.assQuestionGUI.php.

450 : bool
451 {
452 if ($this->isRenderPurposePrintPdf()) {
453 return false;
454 }
455
456 if ($this->isRenderPurposeInputValue()) {
457 return false;
458 }
459
460 return true;
461 }

◆ renderSolutionOutput()

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

◆ resetSavedPreviewSession()

assQuestionGUI::resetSavedPreviewSession ( )
protected

Definition at line 2052 of file class.assQuestionGUI.php.

2052 : void
2053 {
2054 $this->preview_session = new ilAssQuestionPreviewSession(
2055 $this->current_user->getId(),
2056 $this->object->getId()
2057 );
2058 $this->preview_session->setRandomizerSeed(null);
2059 $this->preview_session->setParticipantsSolution(null);
2060 $this->preview_session->setInstantResponseActive(false);
2061 }

Referenced by assFormulaQuestionGUI\writePostData(), and assOrderingQuestionGUI\writePostData().

+ Here is the caller graph for this function:

◆ saveCorrectionsFormProperties()

assQuestionGUI::saveCorrectionsFormProperties ( ilPropertyFormGUI  $form)

◆ saveQuestion()

assQuestionGUI::saveQuestion ( )

Definition at line 722 of file class.assQuestionGUI.php.

722 : bool
723 {
725 $result = $this->writePostData();
726 $this->tabs_gui->activateTab('edit_question');
727
728 if ($result !== 0) {
729 return false;
730 }
731
732 $this->object->getCurrentUser()->setPref('tst_lastquestiontype', $this->object->getQuestionType());
733 $this->object->getCurrentUser()->writePref('tst_lastquestiontype', $this->object->getQuestionType());
734
735 if ($this->request_data_collector->getQuestionId() === 0) {
736 if ($this->object->getId() < 1) {
737 $this->object->createNewQuestion();
738 }
739 $this->setQuestionTabs();
740 }
741
742 if ($this->needsSyncQuery()) {
743 $cmd = strpos($this->ctrl->getCmd(), 'Return') === false
746 $this->question_sync_modal = $this->getQuestionSyncModal($cmd);
747 }
748
749 $this->object->saveToDb();
750 return true;
751 }
getQuestionSyncModal(string $cmd, string $cmd_class='')
writePostData(bool $always=false)
Evaluates a posted edit form and writes the form data in the question object.

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

+ Here is the call graph for this function:

◆ saveReturn()

assQuestionGUI::saveReturn ( )

Definition at line 703 of file class.assQuestionGUI.php.

703 : void
704 {
705 $old_id = $this->request_data_collector->getQuestionId();
707 $result = $this->writePostData();
708 if ($result !== 0) {
709 $this->tabs_gui->setTabActive('edit_question');
710 return;
711 }
712
713 $this->object->getCurrentUser()->setPref('tst_lastquestiontype', $this->object->getQuestionType());
714 $this->object->getCurrentUser()->writePref('tst_lastquestiontype', $this->object->getQuestionType());
715 $this->object->saveToDb($old_id);
716
717 $this->questionrepository->questionExistsInPool($this->object->getOriginalId());
718 $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_obj_modified'), true);
719 $this->ctrl->redirectByClass(ilAssQuestionPreviewGUI::class, ilAssQuestionPreviewGUI::CMD_SHOW);
720 }

References ilAssQuestionPreviewGUI\CMD_SHOW, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ saveSuggestedSolution()

assQuestionGUI::saveSuggestedSolution ( )

Definition at line 1081 of file class.assQuestionGUI.php.

1081 : void
1082 {
1083 $this->suggestedsolution(true);
1084 }

◆ saveSuggestedSolutionType()

assQuestionGUI::saveSuggestedSolutionType ( )

Definition at line 1307 of file class.assQuestionGUI.php.

1307 : void
1308 {
1309 $solution_type = $this->request_data_collector->string('solutiontype');
1310
1311 switch ($solution_type) {
1312 case 'lm':
1313 $type = 'lm';
1314 $search = 'lm';
1315 break;
1316 case 'git':
1317 $type = 'glo';
1318 $search = 'glo';
1319 break;
1320 case 'st':
1321 $type = 'lm';
1322 $search = 'st';
1323 break;
1324 case 'pg':
1325 $type = 'lm';
1326 $search = 'pg';
1327 break;
1328 case 'file':
1329 case 'text':
1330 default:
1331 $this->suggestedsolution();
1332 return;
1333 }
1334
1335 if (isset($solution_type)) {
1336 $this->ctrl->setParameter($this, 'expandCurrentPath', 1);
1337 }
1338 $this->ctrl->setParameter($this, 'link_new_type', $type);
1339 $this->ctrl->setParameter($this, 'search_link_type', $search);
1340 $this->ctrl->redirect($this, 'outSolutionExplorer');
1341 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ saveTaxonomyAssignments()

assQuestionGUI::saveTaxonomyAssignments ( )
protected

Definition at line 963 of file class.assQuestionGUI.php.

963 : void
964 {
965 if (count($this->getTaxonomyIds())) {
966 foreach ($this->getTaxonomyIds() as $taxonomyId) {
967 $postvar = "tax_node_assign_$taxonomyId";
968
969 $tax_node_assign = new ilTaxAssignInputGUI($taxonomyId, true, '', $postvar);
970 // TODO: determine tst/qpl when tax assigns become maintainable within tests
971 $tax_node_assign->saveInput("qpl", $this->object->getObjId(), "quest", $this->object->getId());
972 }
973 }
974 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References ILIAS\Repository\object().

Referenced by assClozeTestGUI\writePostData(), assErrorTextGUI\writePostData(), assFileUploadGUI\writePostData(), assFormulaQuestionGUI\writePostData(), assImagemapQuestionGUI\writePostData(), assLongMenuGUI\writePostData(), assMatchingQuestionGUI\writePostData(), assMultipleChoiceGUI\writePostData(), assNumericGUI\writePostData(), assOrderingHorizontalGUI\writePostData(), assOrderingQuestionGUI\writePostData(), assSingleChoiceGUI\writePostData(), assTextQuestionGUI\writePostData(), assTextSubsetGUI\writePostData(), and assLongMenuGUI\writeQuestionSpecificPostData().

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

◆ setAdditionalContentEditingModeFromPost()

assQuestionGUI::setAdditionalContentEditingModeFromPost ( )

Definition at line 753 of file class.assQuestionGUI.php.

753 : void
754 {
755 $additional_content_editing_mode = $this->request_data_collector->string('additional_content_editing_mode');
756 if ($additional_content_editing_mode !== ''
757 && in_array($additional_content_editing_mode, $this->object->getValidAdditionalContentEditingModes())) {
758 $this->object->setAdditionalContentEditingMode($additional_content_editing_mode);
759 }
760 }

References ILIAS\Repository\object().

Referenced by assMatchingQuestionGUI\adddefinitions(), assMatchingQuestionGUI\addpairs(), assMatchingQuestionGUI\addterms(), assMatchingQuestionGUI\removedefinitions(), assMatchingQuestionGUI\removeimagedefinitions(), assMatchingQuestionGUI\removeimageterms(), assMatchingQuestionGUI\removepairs(), assMatchingQuestionGUI\removeterms(), assFormulaQuestionGUI\suggestRange(), assMatchingQuestionGUI\uploaddefinitions(), and assMatchingQuestionGUI\uploadterms().

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

◆ setAdjustmentEditContext()

assQuestionGUI::setAdjustmentEditContext ( )

Definition at line 483 of file class.assQuestionGUI.php.

483 : void
484 {
485 $this->setEditContext(self::EDIT_CONTEXT_ADJUSTMENT);
486 }
setEditContext(string $editContext)

◆ setContextAllowsSyncToPool()

assQuestionGUI::setContextAllowsSyncToPool ( bool  $sync_allowed)

Definition at line 1980 of file class.assQuestionGUI.php.

1980 : void
1981 {
1982 $this->context_allows_sync_to_pool = $sync_allowed;
1983 }

◆ setCopyToExistingPoolOnSave()

assQuestionGUI::setCopyToExistingPoolOnSave ( ?int  $pool_ref_id)

Definition at line 263 of file class.assQuestionGUI.php.

263 : void
264 {
265 $this->copy_to_existing_pool_on_save = $pool_ref_id;
266 }

Referenced by ilObjTestGUI\executeAfterQuestionCreationTasks().

+ Here is the caller graph for this function:

◆ setCopyToNewPoolOnSave()

assQuestionGUI::setCopyToNewPoolOnSave ( ?string  $pool_title)

Definition at line 273 of file class.assQuestionGUI.php.

273 : void
274 {
275 $this->copy_to_new_pool_on_save = $pool_title;
276 }

Referenced by ilObjTestGUI\executeAfterQuestionCreationTasks().

+ Here is the caller graph for this function:

◆ setDefaultTabs()

assQuestionGUI::setDefaultTabs ( ilTabsGUI  $tabs_gui)
protected

Definition at line 1556 of file class.assQuestionGUI.php.

1556 : void
1557 {
1558 $this->ctrl->setParameterByClass(ilAssQuestionPageGUI::class, 'q_id', $this->object->getId());
1559 $this->ctrl->setParameterByClass(static::class, 'q_id', $this->object->getId());
1560
1561 $this->addTab_Question($tabs_gui);
1562 $this->addTab_QuestionFeedback($tabs_gui);
1563 $this->addTab_SuggestedSolution($tabs_gui, static::class);
1564 }
addTab_Question(ilTabsGUI $tabs_gui)
addTab_SuggestedSolution(ilTabsGUI $tabs, string $classname)
addTab_QuestionFeedback(ilTabsGUI $tabs)

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

+ Here is the call graph for this function:

◆ setEditContext()

assQuestionGUI::setEditContext ( string  $editContext)

Definition at line 468 of file class.assQuestionGUI.php.

468 : void
469 {
470 $this->editContext = $editContext;
471 }

◆ setErrorMessage()

assQuestionGUI::setErrorMessage ( string  $errormessage)

Definition at line 823 of file class.assQuestionGUI.php.

823 : void
824 {
825 $this->errormessage = $errormessage;
826 }

Referenced by assErrorTextGUI\__construct(), assMatchingQuestionGUI\__construct(), assOrderingHorizontalGUI\__construct(), and assFileUploadGUI\__construct().

+ Here is the caller graph for this function:

◆ setInLearningModuleContext()

assQuestionGUI::setInLearningModuleContext ( bool  $flag)

Definition at line 1950 of file class.assQuestionGUI.php.

1950 : void
1951 {
1952 $this->parent_type_is_lm = $flag;
1953 }

◆ setMoveAfterQuestionId()

assQuestionGUI::setMoveAfterQuestionId ( ?int  $question_id)

Definition at line 283 of file class.assQuestionGUI.php.

283 : void
284 {
285 $this->move_after_question_with_id = $question_id;
286 }

Referenced by ilObjTestGUI\addPostCreationTasksToQuestionGUI(), and ilObjTestGUI\executeAfterQuestionCreationTasks().

+ Here is the caller graph for this function:

◆ setNavigationGUI()

assQuestionGUI::setNavigationGUI ( ?ilTestQuestionNavigationGUI  $navigationGUI)

Definition at line 493 of file class.assQuestionGUI.php.

493 : void
494 {
495 $this->navigationGUI = $navigationGUI;
496 }

Referenced by ilTestPlayerAbstractGUI\populateInstantResponseModal().

+ Here is the caller graph for this function:

◆ setObject()

assQuestionGUI::setObject ( assQuestion  $question)
Deprecated:
sk 25 FEB 2024: I introduce this to not have to have the object public, but this should NEVER EVER be used and should go asap!

Definition at line 258 of file class.assQuestionGUI.php.

258 : void
259 {
260 $this->object = $question;
261 }

Referenced by ilAssQuestionSkillAssignmentsGUI\buildQuestionPage(), ilTestCorrectionsGUI\getQuestionGUI(), ilTestPlayerAbstractGUI\getQuestionGuiInstance(), and ilTestCorrectionsGUI\saveQuestion().

+ Here is the caller graph for this function:

◆ setPresentationContext()

assQuestionGUI::setPresentationContext ( string  $presentationContext)

Definition at line 393 of file class.assQuestionGUI.php.

393 : void
394 {
395 $this->presentationContext = $presentationContext;
396 }

Referenced by ilTestPlayerAbstractGUI\getQuestionGuiInstance().

+ Here is the caller graph for this function:

◆ setPreviewSession()

assQuestionGUI::setPreviewSession ( ilAssQuestionPreviewSession  $preview_session)

Definition at line 1743 of file class.assQuestionGUI.php.

1743 : void
1744 {
1745 $this->preview_session = $preview_session;
1746 }

◆ setPreviousSolutionPrefilled()

assQuestionGUI::setPreviousSolutionPrefilled ( bool  $previousSolutionPrefilled)

Definition at line 409 of file class.assQuestionGUI.php.

409 : void
410 {
411 $this->previousSolutionPrefilled = $previousSolutionPrefilled;
412 }

◆ setQuestionActionCmd()

assQuestionGUI::setQuestionActionCmd ( string  $questionActionCmd)

Definition at line 535 of file class.assQuestionGUI.php.

535 : void
536 {
537 $this->questionActionCmd = $questionActionCmd;
538
539 if (is_object($this->object)) {
540 $this->object->questionActionCmd = $questionActionCmd;
541 }
542 }

◆ setQuestionCount()

assQuestionGUI::setQuestionCount ( int  $a_question_count)

Definition at line 808 of file class.assQuestionGUI.php.

808 : void
809 {
810 $this->question_count = $a_question_count;
811 }

Referenced by ilTestPlayerAbstractGUI\showQuestionCmd().

+ Here is the caller graph for this function:

◆ setQuestionHeaderBlockBuilder()

assQuestionGUI::setQuestionHeaderBlockBuilder ( \ilQuestionHeaderBlockBuilder  $questionHeaderBlockBuilder)

Definition at line 523 of file class.assQuestionGUI.php.

523 : void
524 {
525 $this->questionHeaderBlockBuilder = $questionHeaderBlockBuilder;
526 }

Referenced by ilTestPlayerAbstractGUI\showQuestionCmd().

+ Here is the caller graph for this function:

◆ setQuestionSpecificTabs()

assQuestionGUI::setQuestionSpecificTabs ( ilTabsGUI  $tabs_gui)
protected

Reimplemented in assFormulaQuestionGUI.

Definition at line 1566 of file class.assQuestionGUI.php.

1566 : void
1567 {
1568 }

◆ setQuestionTabs()

assQuestionGUI::setQuestionTabs ( )

Definition at line 1544 of file class.assQuestionGUI.php.

1544 : void
1545 {
1546 $this->tabs_gui->clearTargets();
1547
1548 if ($this->object->getId() > 0) {
1549 $this->setDefaultTabs($this->tabs_gui);
1550 $this->setQuestionSpecificTabs($this->tabs_gui);
1551 $this->tabs_gui->activateTab('edit_question');
1552 }
1553 $this->addBackTab($this->tabs_gui);
1554 }
addBackTab(ilTabsGUI $tabs_gui)
setQuestionSpecificTabs(ilTabsGUI $tabs_gui)
setDefaultTabs(ilTabsGUI $tabs_gui)

References ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ setRenderPurpose()

assQuestionGUI::setRenderPurpose ( string  $renderPurpose)

Definition at line 420 of file class.assQuestionGUI.php.

420 : void
421 {
422 $this->renderPurpose = $renderPurpose;
423 }

◆ setSequenceNumber()

assQuestionGUI::setSequenceNumber ( int  $nr)

Definition at line 798 of file class.assQuestionGUI.php.

798 : void
799 {
800 $this->sequence_no = $nr;
801 }

Referenced by ilTestPlayerAbstractGUI\showQuestionCmd().

+ Here is the caller graph for this function:

◆ setTargetGui()

assQuestionGUI::setTargetGui (   $linkTargetGui)

Definition at line 508 of file class.assQuestionGUI.php.

508 : void
509 {
510 $this->setTargetGuiClass(get_class($linkTargetGui));
511 }
setTargetGuiClass(string $targetGuiClass)

Referenced by ilTestPlayerAbstractGUI\getQuestionGuiInstance().

+ Here is the caller graph for this function:

◆ setTargetGuiClass()

assQuestionGUI::setTargetGuiClass ( string  $targetGuiClass)

Definition at line 513 of file class.assQuestionGUI.php.

513 : void
514 {
515 $this->targetGuiClass = $targetGuiClass;
516 }

◆ setTaxonomyIds()

assQuestionGUI::setTaxonomyIds ( array  $taxonomyIds)

Definition at line 498 of file class.assQuestionGUI.php.

498 : void
499 {
500 $this->taxonomyIds = $taxonomyIds;
501 }

◆ setTestSpecificProperties()

assQuestionGUI::setTestSpecificProperties ( )
protected

Definition at line 762 of file class.assQuestionGUI.php.

762 : void
763 {
764 if ($this->request_data_collector->isset('pool_ref')) {
765 $this->copy_to_existing_pool_on_save = $this->request_data_collector->int('pool_ref');
766 }
767
768 if ($this->request_data_collector->isset('pool_title')) {
769 $this->copy_to_new_pool_on_save = $this->request_data_collector->string('pool_title');
770 }
771
772 if ($this->request_data_collector->isset('move_after_question_with_id')) {
773 $this->move_after_question_with_id = $this->request_data_collector->int('move_after_question_with_id');
774 }
775 }

Referenced by assFormulaQuestionGUI\suggestRange().

+ Here is the caller graph for this function:

◆ suggestedsolution()

assQuestionGUI::suggestedsolution ( bool  $save = false)

Definition at line 1091 of file class.assQuestionGUI.php.

1091 : void
1092 {
1093 if ($save && $this->request_data_collector->int('deleteSuggestedSolution') === 1) {
1094 $this->object->deleteSuggestedSolutions();
1095 $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_obj_modified"), true);
1096 $this->ctrl->redirect($this, 'suggestedsolution');
1097 }
1098
1099 $output = '';
1100
1101 $solution = $this->object->getSuggestedSolution();
1102 $options = $this->getTypeOptions();
1103
1104 $solution_type = $this->ctrl->getCmd() === 'cancelSuggestedSolution'
1105 ? $solution->getType()
1106 : $this->request_data_collector->string('solutiontype');
1107 if ($solution_type === SuggestedSolution::TYPE_FILE
1108 && ($solution === null || $solution->getType() !== SuggestedSolution::TYPE_FILE)
1109 ) {
1110 $solution = $this->getSuggestedSolutionsRepo()->create(
1111 $this->object->getId(),
1112 SuggestedSolution::TYPE_FILE
1113 );
1114 }
1115
1116 $solution_filename = $this->request_data_collector->string('filename');
1117 if ($save && !empty($solution_filename)) {
1118 $solution = $solution->withTitle($solution_filename);
1119 }
1120
1121 if ($solution !== null) {
1122 $form = new ilPropertyFormGUI();
1123 $form->setFormAction($this->ctrl->getFormAction($this));
1124 $form->setTitle($this->lng->txt('solution_hint'));
1125 $form->setMultipart(true);
1126 $form->setTableWidth('100%');
1127 $form->setId('suggestedsolutiondisplay');
1128
1129 $title = new ilSolutionTitleInputGUI($this->lng->txt('showSuggestedSolution'), 'solutiontype');
1130 $template = new ilTemplate(
1131 'tpl.il_as_qpl_suggested_solution_input_presentation.html',
1132 true,
1133 true,
1134 'components/ILIAS/TestQuestionPool'
1135 );
1136
1137 if ($solution->isOfTypeLink()) {
1138 $href = $this->object->getInternalLinkHref($solution->getInternalLink());
1139 $template->setCurrentBlock('preview');
1140 $template->setVariable('TEXT_SOLUTION', $this->lng->txt('suggested_solution'));
1141 $template->setVariable(
1142 'VALUE_SOLUTION',
1143 " <a href='{$href}' target='content'>{$this->lng->txt('view')}</a> "
1144 );
1145 $template->parseCurrentBlock();
1146 } elseif (
1147 $solution->isOfTypeFile()
1148 && $solution->getFilename()
1149 ) {
1150 $href = $this->object->getSuggestedSolutionPathWeb() . $solution->getFilename();
1151 $link = " <a href='{$href}' target='content'>"
1152 . ilLegacyFormElementsUtil::prepareFormOutput($solution->getTitle())
1153 . '</a> ';
1154 $template->setCurrentBlock('preview');
1155 $template->setVariable('TEXT_SOLUTION', $this->lng->txt('suggested_solution'));
1156 $template->setVariable('VALUE_SOLUTION', $link);
1157 $template->parseCurrentBlock();
1158 }
1159
1160 $template->setVariable('TEXT_TYPE', $this->lng->txt('type'));
1161 $template->setVariable('VALUE_TYPE', $options[$solution->getType()]);
1162
1163 $title->setHtml($template->get());
1164 $deletesolution = new ilCheckboxInputGUI('', 'deleteSuggestedSolution');
1165 $deletesolution->setOptionTitle($this->lng->txt('deleteSuggestedSolution'));
1166 $title->addSubItem($deletesolution);
1167 $form->addItem($title);
1168
1169 if ($solution->isOfTypeFile()) {
1170 $file = new ilFileInputGUI($this->lng->txt('fileDownload'), 'file');
1171 $file->setRequired(true);
1172 $file->enableFileNameSelection('filename');
1173
1174 if ($save && $_FILES && $_FILES['file']['tmp_name'] && $file->checkInput()) {
1175 if (!file_exists($this->object->getSuggestedSolutionPath())) {
1176 ilFileUtils::makeDirParents($this->object->getSuggestedSolutionPath());
1177 }
1178
1180 $_FILES['file']['tmp_name'],
1181 $_FILES['file']['name'],
1182 $this->object->getSuggestedSolutionPath() . $_FILES['file']['name']
1183 );
1184 if ($res) {
1185 ilFileUtils::renameExecutables($this->object->getSuggestedSolutionPath());
1186
1187 // remove an old file download
1188 if ($solution->getFilename()) {
1189 @unlink($this->object->getSuggestedSolutionPath() . $solution->getFilename());
1190 }
1191
1192 $file->setValue($_FILES['file']['name']);
1193 $solution = $solution
1194 ->withFilename($_FILES['file']['name'])
1195 ->withMime($_FILES['file']['type'])
1196 ->withSize($_FILES['file']['size'])
1197 ->withTitle($this->request_data_collector->string('filename'));
1198
1199 $this->getSuggestedSolutionsRepo()->update([$solution]);
1200
1201 $this->tpl->setOnScreenMessage('success', $this->lng->txt('suggested_solution_added_successfully'), true);
1202 $this->ctrl->redirect($this, 'suggestedsolution');
1203 } else {
1204 // BH: $res as info string? wtf? it holds a bool or something else!!?
1205 $this->tpl->setOnScreenMessage('info', $res);
1206 }
1207 } else {
1208 if ($solution->getFilename()) {
1209 $file->setValue($solution->getFilename());
1210 $file->setFilename($solution->getTitle());
1211 }
1212 }
1213 $form->addItem($file);
1214 $hidden = new ilHiddenInputGUI('solutiontype');
1215 $hidden->setValue('file');
1216 $form->addItem($hidden);
1217 }
1218 if ($this->access->checkAccess('write', '', $this->request_data_collector->getRefId())) {
1219 $form->addCommandButton('cancelSuggestedSolution', $this->lng->txt('cancel'));
1220 $form->addCommandButton('saveSuggestedSolution', $this->lng->txt('save'));
1221 }
1222
1223 if ($save) {
1224 if ($form->checkInput()) {
1225 if ($solution->isOfTypeFile()) {
1226 $solution = $solution->withTitle($this->request_data_collector->string('filename'));
1227 }
1228
1229 if (!$solution->isOfTypeLink()) {
1230 $this->getSuggestedSolutionsRepo()->update([$solution]);
1231 }
1232
1233 $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_obj_modified'), true);
1234 $this->ctrl->redirect($this, 'suggestedsolution');
1235 }
1236 }
1237
1238 $output = $form->getHTML();
1239 }
1240
1241 $savechange = $this->ctrl->getCmd() === 'saveSuggestedSolutionType';
1242
1243 $changeoutput = '';
1244 if ($this->access->checkAccess('write', '', $this->request_data_collector->getRefId())) {
1245 $formchange = new ilPropertyFormGUI();
1246 $formchange->setFormAction($this->ctrl->getFormAction($this));
1247
1248 $title = $solution ? $this->lng->txt('changeSuggestedSolution') : $this->lng->txt('addSuggestedSolution');
1249 $formchange->setTitle($title);
1250 $formchange->setMultipart(false);
1251 $formchange->setTableWidth('100%');
1252 $formchange->setId('suggestedsolution');
1253
1254 $solutiontype = new ilRadioGroupInputGUI($this->lng->txt('suggestedSolutionType'), 'solutiontype');
1255 foreach ($options as $opt_value => $opt_caption) {
1256 $solutiontype->addOption(new ilRadioOption($opt_caption, $opt_value));
1257 }
1258 if ($solution) {
1259 $solutiontype->setValue($solution->getType());
1260 }
1261 $solutiontype->setRequired(true);
1262 $formchange->addItem($solutiontype);
1263
1264 $formchange->addCommandButton('saveSuggestedSolutionType', $this->lng->txt('select'));
1265
1266 if ($savechange) {
1267 $formchange->checkInput();
1268 }
1269 $changeoutput = $formchange->getHTML();
1270 }
1271 $this->tabs_gui->activateTab('suggested_solution');
1272 $this->tpl->setVariable('ADM_CONTENT', $changeoutput . $output);
1273 }
This class represents a checkbox property in a property form.
This class represents a file property in a property form.
static makeDirParents(string $a_dir)
Create a new directory and all parent directories.
static renameExecutables(string $a_dir)
static moveUploadedFile(string $a_file, string $a_name, string $a_target, bool $a_raise_errors=true, string $a_mode="move_uploaded")
move uploaded file
This class represents a property in a property form.
This class represents an option in a radio group.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$res
Definition: ltiservices.php:69

References $res, ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ilFileUtils\makeDirParents(), ilFileUtils\moveUploadedFile(), ILIAS\Repository\object(), ilLegacyFormElementsUtil\prepareFormOutput(), and ilFileUtils\renameExecutables().

+ Here is the call graph for this function:

◆ syncQuestion()

assQuestionGUI::syncQuestion ( )

Definition at line 694 of file class.assQuestionGUI.php.

694 : void
695 {
696 $original_id = $this->object->getOriginalId();
697 if ($original_id !== null) {
698 $this->object->syncWithOriginal();
699 $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_obj_modified"), true);
700 }
701 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ writePostData()

assQuestionGUI::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 in assClozeTestGUI, assErrorTextGUI, assFileUploadGUI, assFormulaQuestionGUI, assImagemapQuestionGUI, assKprimChoiceGUI, assLongMenuGUI, assMatchingQuestionGUI, assMultipleChoiceGUI, assNumericGUI, assOrderingHorizontalGUI, assOrderingQuestionGUI, assSingleChoiceGUI, assTextQuestionGUI, and assTextSubsetGUI.

Definition at line 553 of file class.assQuestionGUI.php.

553 : int
554 {
555 return 0;
556 }

◆ writeQuestionGenericPostData()

assQuestionGUI::writeQuestionGenericPostData ( )
protected

Definition at line 1642 of file class.assQuestionGUI.php.

1642 : void
1643 {
1644 $this->object->setTitle($this->request_data_collector->string('title'));
1645 $this->object->setAuthor($this->request_data_collector->string('author'));
1646 $this->object->setComment($this->request_data_collector->string('comment'));
1647
1648 $nr_of_tries = $this->request_data_collector->int('nr_of_tries');
1649 if ($this->object->getSelfAssessmentEditingMode()) {
1650 $this->object->setNrOfTries($nr_of_tries);
1651 }
1652
1653 try {
1655 $this->request_data_collector->string('lifecycle')
1656 );
1657 $this->object->setLifecycle($lifecycle);
1659 }
1660
1661 $this->object->setQuestion(
1663 $this->request_data_collector->string('question')
1664 )
1665 );
1666
1668 }
static stripOnlySlashes(string $a_str)

References Vendor\Package\$e, $lifecycle, ilAssQuestionLifecycle\getInstance(), ILIAS\Repository\object(), and ilUtil\stripOnlySlashes().

Referenced by assOrderingQuestionGUI\uploadElementImage(), assClozeTestGUI\writePostData(), assErrorTextGUI\writePostData(), assFileUploadGUI\writePostData(), assImagemapQuestionGUI\writePostData(), assLongMenuGUI\writePostData(), assMatchingQuestionGUI\writePostData(), assMultipleChoiceGUI\writePostData(), assNumericGUI\writePostData(), assOrderingHorizontalGUI\writePostData(), assOrderingQuestionGUI\writePostData(), assSingleChoiceGUI\writePostData(), assTextQuestionGUI\writePostData(), and assTextSubsetGUI\writePostData().

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

Field Documentation

◆ $access

ilAccessHandler assQuestionGUI::$access
private

Definition at line 104 of file class.assQuestionGUI.php.

◆ $component_repository

ilComponentRepository assQuestionGUI::$component_repository
private

Definition at line 110 of file class.assQuestionGUI.php.

◆ $context_allows_sync_to_pool

bool assQuestionGUI::$context_allows_sync_to_pool = false
private

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

◆ $copy_to_existing_pool_on_save

int assQuestionGUI::$copy_to_existing_pool_on_save = null
private

Definition at line 154 of file class.assQuestionGUI.php.

◆ $copy_to_new_pool_on_save

string assQuestionGUI::$copy_to_new_pool_on_save = null
private

Definition at line 155 of file class.assQuestionGUI.php.

◆ $ctrl

ilCtrl assQuestionGUI::$ctrl
protected

Definition at line 113 of file class.assQuestionGUI.php.

◆ $current_user

ilObjUser assQuestionGUI::$current_user
private

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

◆ $db

ilDBInterface assQuestionGUI::$db
private

Definition at line 108 of file class.assQuestionGUI.php.

◆ $editContext

string assQuestionGUI::$editContext = self::EDIT_CONTEXT_AUTHORING
private

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

◆ $editForm

ilPropertyFormGUI assQuestionGUI::$editForm = null
protected

Definition at line 149 of file class.assQuestionGUI.php.

◆ $error

assQuestionGUI::$error
protected

Definition at line 121 of file class.assQuestionGUI.php.

◆ $errormessage

string assQuestionGUI::$errormessage
protected

Definition at line 122 of file class.assQuestionGUI.php.

◆ $forms_helper

readonly ilTestLegacyFormsHelper assQuestionGUI::$forms_helper
protected

Definition at line 150 of file class.assQuestionGUI.php.

◆ $ilHelp

ilHelpGUI assQuestionGUI::$ilHelp
private

Definition at line 103 of file class.assQuestionGUI.php.

◆ $ilObjDataCache

ilObjectDataCache assQuestionGUI::$ilObjDataCache
private

Definition at line 102 of file class.assQuestionGUI.php.

◆ $lng

ilLanguage assQuestionGUI::$lng
protected

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

◆ $logger

ilLogger assQuestionGUI::$logger
protected

Definition at line 109 of file class.assQuestionGUI.php.

◆ $move_after_question_with_id

int assQuestionGUI::$move_after_question_with_id = null
private

Definition at line 157 of file class.assQuestionGUI.php.

◆ $navigationGUI

ilTestQuestionNavigationGUI assQuestionGUI::$navigationGUI = null
private

Definition at line 138 of file class.assQuestionGUI.php.

◆ $notes_gui

GUIService assQuestionGUI::$notes_gui
protected

Definition at line 112 of file class.assQuestionGUI.php.

◆ $object

assQuestion assQuestionGUI::$object
protected

Definition at line 116 of file class.assQuestionGUI.php.

◆ $parent_type_is_lm

bool assQuestionGUI::$parent_type_is_lm = false
protected

Definition at line 152 of file class.assQuestionGUI.php.

◆ $presentationContext

string assQuestionGUI::$presentationContext = null
private

Definition at line 141 of file class.assQuestionGUI.php.

◆ $preview_session

ilAssQuestionPreviewSession assQuestionGUI::$preview_session = null
private

Definition at line 115 of file class.assQuestionGUI.php.

◆ $previousSolutionPrefilled

bool assQuestionGUI::$previousSolutionPrefilled = false
private

Definition at line 147 of file class.assQuestionGUI.php.

◆ $question_count

int assQuestionGUI::$question_count
protected

question count in test

Definition at line 128 of file class.assQuestionGUI.php.

◆ $question_sync_modal

string assQuestionGUI::$question_sync_modal = ''
private

Definition at line 159 of file class.assQuestionGUI.php.

◆ $questionActionCmd

string assQuestionGUI::$questionActionCmd = 'handleQuestionAction'
private

Definition at line 134 of file class.assQuestionGUI.php.

◆ $questionHeaderBlockBuilder

ilQuestionHeaderBlockBuilder assQuestionGUI::$questionHeaderBlockBuilder
private

Definition at line 136 of file class.assQuestionGUI.php.

◆ $questionrepository

GeneralQuestionPropertiesRepository assQuestionGUI::$questionrepository
protected

Definition at line 111 of file class.assQuestionGUI.php.

◆ $rbacsystem

ilRbacSystem assQuestionGUI::$rbacsystem
private

Definition at line 106 of file class.assQuestionGUI.php.

◆ $refinery

Refinery assQuestionGUI::$refinery
protected

Definition at line 119 of file class.assQuestionGUI.php.

◆ $renderPurpose

string assQuestionGUI::$renderPurpose = self::RENDER_PURPOSE_PLAYBACK
private

Definition at line 143 of file class.assQuestionGUI.php.

◆ $request_data_collector

readonly RequestDataCollector assQuestionGUI::$request_data_collector
protected

Definition at line 151 of file class.assQuestionGUI.php.

◆ $sequence_no

int assQuestionGUI::$sequence_no
protected

sequence number in test

Definition at line 125 of file class.assQuestionGUI.php.

◆ $suggestedsolution_repo

SuggestedSolutionsDatabaseRepository assQuestionGUI::$suggestedsolution_repo = null
protected

Definition at line 1911 of file class.assQuestionGUI.php.

◆ $tabs_gui

ilTabsGUI assQuestionGUI::$tabs_gui
private

Definition at line 105 of file class.assQuestionGUI.php.

◆ $targetGuiClass

assQuestionGUI::$targetGuiClass = null
private

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

◆ $taxonomyIds

assQuestionGUI::$taxonomyIds = []
private

Definition at line 130 of file class.assQuestionGUI.php.

◆ $tpl

ilGlobalPageTemplate assQuestionGUI::$tpl
protected

Definition at line 117 of file class.assQuestionGUI.php.

◆ $tree

ilTree assQuestionGUI::$tree
private

Definition at line 107 of file class.assQuestionGUI.php.

◆ $ui

assQuestionGUI::$ui
private

Definition at line 101 of file class.assQuestionGUI.php.

◆ ADDITIONAL_CMDS_NEEDING_EXISTING_QST

const assQuestionGUI::ADDITIONAL_CMDS_NEEDING_EXISTING_QST
protected
Initial value:
= [
'uploadchoice',
'uploadImage',
'changeToPictures',
'uploadElementImage',
'uploadterms',
'uploaddefintions'
]

There are functions that need an existing question.

As we stop creating useless question stubs with ILIAS 10, we need to know when we absolutly need one. This is not the right solution, but it is a first step.

Todo:
We should remove the need for any separate upload commands in questions.

Definition at line 92 of file class.assQuestionGUI.php.

◆ ALLOWED_PLAIN_TEXT_TAGS

const assQuestionGUI::ALLOWED_PLAIN_TEXT_TAGS = "<em>, <strong>"

sk - 12.05.2023: This const is also used in ilKprimChoiceWizardInputGUI.

Don't ask, but I didn't find an easy fix without undoing two more question types.

Definition at line 42 of file class.assQuestionGUI.php.

Referenced by ilKprimChoiceWizardInputGUI\cleanupAnswerText().

◆ CMD_SAVE

const assQuestionGUI::CMD_SAVE = 'save'
private

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

◆ CMD_SAVE_AND_RETURN

const assQuestionGUI::CMD_SAVE_AND_RETURN = 'saveReturn'
private

Definition at line 75 of file class.assQuestionGUI.php.

◆ CMD_SYNC_QUESTION

const assQuestionGUI::CMD_SYNC_QUESTION = 'syncQuestion'
private

Definition at line 77 of file class.assQuestionGUI.php.

◆ CMD_SYNC_QUESTION_AND_RETURN

const assQuestionGUI::CMD_SYNC_QUESTION_AND_RETURN = 'syncQuestionReturn'

Definition at line 78 of file class.assQuestionGUI.php.

Referenced by ilAssQuestionPreviewGUI\showCmd().

◆ CORRECTNESS_MOSTLY_OK

const assQuestionGUI::CORRECTNESS_MOSTLY_OK = 1

Definition at line 53 of file class.assQuestionGUI.php.

◆ CORRECTNESS_NOT_OK

const assQuestionGUI::CORRECTNESS_NOT_OK = 0

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

◆ CORRECTNESS_OK

const assQuestionGUI::CORRECTNESS_OK = 2

Definition at line 54 of file class.assQuestionGUI.php.

◆ EDIT_CONTEXT_ADJUSTMENT

const assQuestionGUI::EDIT_CONTEXT_ADJUSTMENT = 'adjustment'

Definition at line 63 of file class.assQuestionGUI.php.

◆ EDIT_CONTEXT_AUTHORING

const assQuestionGUI::EDIT_CONTEXT_AUTHORING = 'authoring'

Definition at line 62 of file class.assQuestionGUI.php.

Referenced by ilObjTestGUI\forwardCommandToQuestion().

◆ FORM_ENCODING_MULTIPART

const assQuestionGUI::FORM_ENCODING_MULTIPART = 'multipart/form-data'

Definition at line 50 of file class.assQuestionGUI.php.

◆ FORM_ENCODING_URLENCODE

const assQuestionGUI::FORM_ENCODING_URLENCODE = 'application/x-www-form-urlencoded'

Definition at line 49 of file class.assQuestionGUI.php.

◆ FORM_MODE_ADJUST

const assQuestionGUI::FORM_MODE_ADJUST = 'adjust'

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

◆ FORM_MODE_EDIT

const assQuestionGUI::FORM_MODE_EDIT = 'edit'

Definition at line 46 of file class.assQuestionGUI.php.

◆ HAS_SPECIAL_QUESTION_COMMANDS

const assQuestionGUI::HAS_SPECIAL_QUESTION_COMMANDS = false
protected

Definition at line 68 of file class.assQuestionGUI.php.

◆ PRESENTATION_CONTEXT_RESULTS

const assQuestionGUI::PRESENTATION_CONTEXT_RESULTS = 'pContextResults'

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

◆ PRESENTATION_CONTEXT_TEST

const assQuestionGUI::PRESENTATION_CONTEXT_TEST = 'pContextTest'

◆ QUESTION_SAVE_CMDS

const assQuestionGUI::QUESTION_SAVE_CMDS
protected
Initial value:

Definition at line 80 of file class.assQuestionGUI.php.

◆ RENDER_PURPOSE_DEMOPLAY

const assQuestionGUI::RENDER_PURPOSE_DEMOPLAY = 'renderPurposeDemoplay'

Definition at line 57 of file class.assQuestionGUI.php.

Referenced by ilAssQuestionPreviewGUI\initQuestion().

◆ RENDER_PURPOSE_INPUT_VALUE

const assQuestionGUI::RENDER_PURPOSE_INPUT_VALUE = 'renderPurposeInputValue'

Definition at line 60 of file class.assQuestionGUI.php.

◆ RENDER_PURPOSE_PLAYBACK

const assQuestionGUI::RENDER_PURPOSE_PLAYBACK = 'renderPurposePlayback'

Definition at line 56 of file class.assQuestionGUI.php.

◆ RENDER_PURPOSE_PREVIEW

const assQuestionGUI::RENDER_PURPOSE_PREVIEW = 'renderPurposePreview'

◆ RENDER_PURPOSE_PRINT_PDF

const assQuestionGUI::RENDER_PURPOSE_PRINT_PDF = 'renderPurposePrintPdf'

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

◆ SESSION_PREVIEW_DATA_BASE_INDEX

const assQuestionGUI::SESSION_PREVIEW_DATA_BASE_INDEX = 'ilAssQuestionPreviewAnswers'

Definition at line 44 of file class.assQuestionGUI.php.

◆ SUGGESTED_SOLUTION_COMMANDS_CANCEL

const assQuestionGUI::SUGGESTED_SOLUTION_COMMANDS_CANCEL = 'cancelSuggestedSolution'
protected

Definition at line 70 of file class.assQuestionGUI.php.

◆ SUGGESTED_SOLUTION_COMMANDS_DEFAULT

const assQuestionGUI::SUGGESTED_SOLUTION_COMMANDS_DEFAULT = 'suggestedsolution'
protected

Definition at line 72 of file class.assQuestionGUI.php.

◆ SUGGESTED_SOLUTION_COMMANDS_SAVE

const assQuestionGUI::SUGGESTED_SOLUTION_COMMANDS_SAVE = 'saveSuggestedSolution'
protected

Definition at line 71 of file class.assQuestionGUI.php.


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