ILIAS  trunk Revision v12.0_alpha-1221-g4e438232683
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...
 
UIServices $ui
 
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'
 
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 573 of file class.assQuestionGUI.php.

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

1719 : void
1720 {
1721 if ($this->object->getId() <= 0) {
1722 $tabs_gui->setBackTarget(
1723 $this->lng->txt('cancel'),
1724 $this->ctrl->getParentReturnByClass(
1726 ilObject::_lookupType($this->object->getObjId())
1727 ) . 'GUI'
1728 )
1729 );
1730 return;
1731 }
1732 $this->ctrl->setParameterByClass(
1733 ilAssQuestionPreviewGUI::class,
1734 'q_id',
1735 $this->object->getId()
1736 );
1737 $this->ctrl->saveParameterByClass(ilAssQuestionPreviewGUI::class, 'prev_qid');
1739 $this->lng->txt('backtocallingpage'),
1740 $this->ctrl->getLinkTargetByClass(
1741 ilAssQuestionPreviewGUI::class,
1743 )
1744 );
1745 $this->ctrl->clearParameterByClass(ilAssQuestionPreviewGUI::class, 'prev_qid');
1746 }
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 856 of file class.assQuestionGUI.php.

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

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

Referenced by assFormulaQuestionGUI\writePostData().

+ Here is the caller graph for this function:

◆ addGIT()

assQuestionGUI::addGIT ( )

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

1511 : void
1512 {
1513 $target = "il__git_" . $this->request_data_collector->raw("git");
1514 $this->createSuggestedSolutionLinkingTo('git', $target);
1515 $this->tpl->setOnScreenMessage('success', $this->lng->txt("suggested_solution_added_successfully"), true);
1516 $this->ctrl->redirect($this, 'suggestedsolution');
1517 }
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 299 of file class.assQuestionGUI.php.

299 : void
300 {
301 }

◆ addNumberOfTriesToFormIfNecessary()

assQuestionGUI::addNumberOfTriesToFormIfNecessary ( ilPropertyFormGUI  $form)
protected

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

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

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

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

+ Here is the call graph for this function:

◆ addQuestionFormCommandButtons()

assQuestionGUI::addQuestionFormCommandButtons ( ilPropertyFormGUI  $form)

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

848 : void
849 {
850 if (!$this->object->getSelfAssessmentEditingMode()) {
851 $form->addCommandButton("saveReturn", $this->lng->txt("save_return"));
852 }
853 $form->addCommandButton("save", $this->lng->txt("save"));
854 }
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 1960 of file class.assQuestionGUI.php.

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

◆ addST()

assQuestionGUI::addST ( )

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

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

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 1619 of file class.assQuestionGUI.php.

1619 : void
1620 {
1622 'edit_question',
1623 $this->ctrl->getLinkTargetByClass(
1624 static::class,
1625 'editQuestion'
1626 ),
1627 'editQuestion',
1628 '',
1629 '',
1630 false
1631 );
1632 }
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 1605 of file class.assQuestionGUI.php.

1605 : void
1606 {
1607 $this->ctrl->setParameterByClass(ilAssQuestionFeedbackEditingGUI::class, 'q_id', $this->object->getId());
1608
1609 $tabs->addTab(
1610 'feedback',
1611 $this->lng->txt('tst_feedback'),
1612 $this->ctrl->getLinkTargetByClass(
1613 ilAssQuestionFeedbackEditingGUI::class,
1615 )
1616 );
1617 }
addTab(string $a_id, string $a_text, string $a_link, string $a_frame="")
Add a Tab.

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

+ Here is the call graph for this function:

◆ addTab_SuggestedSolution()

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

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

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

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

+ Here is the call graph for this function:

◆ assessment()

assQuestionGUI::assessment ( )

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

559 : void
560 {
561 $stats_table = new ilQuestionCumulatedStatisticsTableGUI($this, 'assessment', '', $this->object, $this->questionrepository);
562 $usage_table = new ilQuestionUsagesTableGUI($this, 'assessment', '', $this->object);
563
564 $this->tpl->setContent(implode('<br />', [
565 $stats_table->getHTML(),
566 $usage_table->getHTML()
567 ]));
568 }
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 1761 of file class.assQuestionGUI.php.

1762 {
1763 $form = new ilPropertyFormGUI();
1764 $form->setFormAction($this->ctrl->getFormAction($this));
1765 $form->setId($this->getType());
1766 $form->setTitle($this->outQuestionType());
1767 $form->setTableWidth('100%');
1768 $form->setMultipart(true);
1769 return $form;
1770 }
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 1777 of file class.assQuestionGUI.php.

1778 {
1779 $this->editQuestion(true); // TODO bheyser: editQuestion should be added to the abstract base class with a unified signature
1780 return $this->editForm;
1781 }
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 2049 of file class.assQuestionGUI.php.

2049 : string
2050 {
2051 if (strtolower($this->request_data_collector->string('cmdClass')) === 'ilassquestionpreviewgui') {
2052 return $this->ctrl->getLinkTargetByClass(ilObjQuestionPoolGUI::class, 'downloadFile');
2053 }
2054 return $this->ctrl->getLinkTargetByClass(ilObjTestGUI::class, 'downloadFile');
2055 }

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 1783 of file class.assQuestionGUI.php.

1783 : string
1784 {
1785 return '<div id="focus"></div>';
1786 }

◆ cancelExplorer()

assQuestionGUI::cancelExplorer ( )

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

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

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ cancelSuggestedSolution()

assQuestionGUI::cancelSuggestedSolution ( )

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

1087 : void
1088 {
1089 $this->suggestedsolution();
1090 }
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 1930 of file class.assQuestionGUI.php.

1930 : array
1931 {
1932 if (!is_array($answer_text)) {
1933 return [];
1934 }
1935
1936 if ($is_rte) {
1938 $answer_text,
1939 false,
1941 );
1942 }
1943
1945 $answer_text,
1946 true,
1947 self::ALLOWED_PLAIN_TEXT_TAGS
1948 );
1949 }
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 1980 of file class.assQuestionGUI.php.

1980 : bool
1981 {
1982 return in_array($cmd, static::ADDITIONAL_CMDS_NEEDING_EXISTING_QST);
1983 }

◆ completeTestOutputFormAction()

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

Reimplemented in assImagemapQuestionGUI.

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

1705 : string {
1706 return $form_action;
1707 }

◆ createSuggestedSolutionLinkingTo()

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

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

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

◆ editQuestion()

◆ escapeTemplatePlaceholders()

assQuestionGUI::escapeTemplatePlaceholders ( string  $text)
protected

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

1772 : string
1773 {
1774 return str_replace(['{','}'], ['&#123;','&#125;'], $text);
1775 }
$text
Definition: xapiexit.php:21

References $text.

◆ executeCommand()

assQuestionGUI::executeCommand ( )

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

336 {
337 $this->ilHelp->setScreenIdComponent('qpl');
338
339 $next_class = $this->ctrl->getNextClass($this);
340
341 switch ($next_class) {
342 case 'ilformpropertydispatchgui':
343 $form = $this->buildEditForm();
344 $form_prop_dispatch = new ilFormPropertyDispatchGUI();
345 $form_prop_dispatch->setItem($form->getItemByPostVar(ilUtil::stripSlashes($this->request_data_collector->string('postvar'))));
346 $this->ctrl->forwardCommand($form_prop_dispatch);
347 break;
348 default:
349 $cmd = $this->ctrl->getCmd('editQuestion');
350 switch ($cmd) {
354 case 'saveSuggestedSolutionType':
355 case 'saveContentsSuggestedSolution':
356 case 'deleteSuggestedSolution':
357 case 'linkChilds':
358 case 'cancelExplorer':
359 case 'outSolutionExplorer':
360 case 'addST':
361 case 'addPG':
362 case 'addGIT':
363 case 'save':
364 case 'saveReturn':
367 case 'editQuestion':
368 $this->$cmd();
369 break;
370 default:
371 if (method_exists($this, $cmd)) {
372 $this->$cmd();
373 }
374 }
375 }
376 }
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 1825 of file class.assQuestionGUI.php.

1825 : string
1826 {
1827 switch ($correctness) {
1829 $icon_name = 'standard/icon_not_ok.svg';
1830 $label = $this->lng->txt("answer_is_wrong");
1831 break;
1833 $icon_name = 'standard/icon_mostly_ok.svg';
1834 $label = $this->lng->txt("answer_is_not_correct_but_positive");
1835 break;
1837 $icon_name = 'standard/icon_ok.svg';
1838 $label = $this->lng->txt("answer_is_right");
1839 break;
1840 default:
1841 return '';
1842 }
1843 $path = ilUtil::getImagePath($icon_name);
1844 $icon = $this->ui->factory()->symbol()->icon()->custom(
1845 $path,
1846 $label
1847 );
1848 return $this->ui->renderer()->render($icon);
1849 }
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 1022 of file class.assQuestionGUI.php.

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

◆ getAdditionalEditQuestionCommands()

assQuestionGUI::getAdditionalEditQuestionCommands ( )
protected

Reimplemented in assKprimChoiceGUI.

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

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

◆ getAnswerFrequencyTableGUI()

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

Reimplemented in assClozeTestGUI, assKprimChoiceGUI, assLongMenuGUI, and assMatchingQuestionGUI.

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

1804 {
1805 $table = new ilAnswerFrequencyStatisticTableGUI($parentGui, $parentCmd, $this->object);
1806 $table->setQuestionIndex($questionIndex);
1807 $table->setData($this->getAnswersFrequency($relevantAnswers, $questionIndex));
1808 $table->initColumns();
1809 return $table;
1810 }
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 839 of file class.assQuestionGUI.php.

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

◆ 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 2016 of file class.assQuestionGUI.php.

2028 : ?string {
2029 $autosave_solutions = $this->object->getSolutionValues($active_id, $pass, false);
2030 if ($autosave_solutions === []) {
2031 return null;
2032 }
2033 return $this->renderSolutionOutput(
2034 $autosave_solutions,
2035 $active_id,
2036 $pass,
2037 $graphical_output,
2038 $result_output,
2039 $show_question_only,
2040 $show_feedback,
2041 $show_correct_solution,
2042 $show_manual_scoring,
2043 $show_question_text,
2044 $show_autosave_title,
2045 $show_inline_feedback
2046 );
2047 }
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 1595 of file class.assQuestionGUI.php.

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

◆ getCommandsFromClassConstants()

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

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

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

Referenced by ilPCQuestionGUI\setTabs().

+ Here is the caller graph for this function:

◆ getCommentsPanelHTML()

assQuestionGUI::getCommentsPanelHTML ( )

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

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

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 781 of file class.assQuestionGUI.php.

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

References $path.

◆ getCopyToExistingPoolOnSave()

assQuestionGUI::getCopyToExistingPoolOnSave ( )

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

269 : ?int
270 {
272 }

Referenced by ilObjTestGUI\executeAfterQuestionCreationTasks().

+ Here is the caller graph for this function:

◆ getCopyToNewPoolOnSave()

assQuestionGUI::getCopyToNewPoolOnSave ( )

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

279 : ?string
280 {
282 }

Referenced by ilObjTestGUI\executeAfterQuestionCreationTasks().

+ Here is the caller graph for this function:

◆ getEditContext()

assQuestionGUI::getEditContext ( )

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

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

◆ getEditQuestionTabCommands()

assQuestionGUI::getEditQuestionTabCommands ( )
final

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

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

◆ getErrorMessage()

assQuestionGUI::getErrorMessage ( )

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

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

Referenced by assFormulaQuestionGUI\suggestRange().

+ Here is the caller graph for this function:

◆ getFormEncodingType()

assQuestionGUI::getFormEncodingType ( )

Reimplemented in assFileUploadGUI.

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

1714 : string
1715 {
1717 }

◆ getGenericFeedbackOutput()

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

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

1007 : string
1008 {
1009 $manual_feedback = ilObjTest::getManualFeedback($active_id, $this->object->getId(), $pass);
1010 if ($manual_feedback !== '') {
1011 return $manual_feedback;
1012 }
1013
1014 $output = $this->genericFeedbackOutputBuilder($active_id, $pass);
1015
1016 if ($this->object->isAdditionalContentEditingModePageObject()) {
1017 return $output;
1018 }
1020 }
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 1043 of file class.assQuestionGUI.php.

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

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

+ Here is the call graph for this function:

◆ getGenericFeedbackOutputForIncorrectSolution()

assQuestionGUI::getGenericFeedbackOutputForIncorrectSolution ( )

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

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

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

+ Here is the call graph for this function:

◆ getHeaderAction()

assQuestionGUI::getHeaderAction ( )

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

309 : string
310 {
311 $parentObjType = $this->ilObjDataCache->lookupType($this->object->getObjId());
312
313 $dispatcher = new ilCommonActionDispatcherGUI(
315 $this->access,
316 $parentObjType,
317 $this->request_data_collector->getRefId(),
318 $this->object->getObjId()
319 );
320
321 $dispatcher->setSubObject("quest", $this->object->getId());
322
323 $ha = $dispatcher->initHeaderAction();
324 $ha->enableComments(true, false);
325
326 return $ha->getHeaderAction($this->ui->mainTemplate());
327 }
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 632 of file class.assQuestionGUI.php.

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

References ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ getMoveAfterQuestionId()

assQuestionGUI::getMoveAfterQuestionId ( )

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

289 : ?int
290 {
292 }

Referenced by ilObjTestGUI\executeAfterQuestionCreationTasks().

+ Here is the caller graph for this function:

◆ getNavigationGUI()

assQuestionGUI::getNavigationGUI ( )

Definition at line 489 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 250 of file class.assQuestionGUI.php.

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

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 389 of file class.assQuestionGUI.php.

389 : ?string
390 {
392 }

◆ getPresentationJavascripts()

assQuestionGUI::getPresentationJavascripts ( )

Reimplemented in assMultipleChoiceGUI.

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

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

◆ getPreview()

◆ getPreviewSession()

assQuestionGUI::getPreviewSession ( )
Returns
ilAssQuestionPreviewSession|null

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

◆ getPreviousSolutionConfirmationCheckboxHtml()

assQuestionGUI::getPreviousSolutionConfirmationCheckboxHtml ( )
protected

Reimplemented in assFileUploadGUI, and assImagemapQuestionGUI.

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

688 : string
689 {
690 $tpl = new ilTemplate('tpl.tst_question_additional_behaviour_checkbox.html', true, true, 'components/ILIAS/TestQuestionPool');
691 $tpl->setVariable('TXT_FORCE_FORM_DIFF_LABEL', $this->lng->txt('use_previous_solution'));
692 return $tpl->get();
693 }
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 683 of file class.assQuestionGUI.php.

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

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getQuestionActionCmd()

assQuestionGUI::getQuestionActionCmd ( )

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

545 : string
546 {
548 }

◆ getQuestionCount()

assQuestionGUI::getQuestionCount ( )

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

814 : int
815 {
817 }
int $question_count
question count in test

◆ getQuestionHeaderBlockBuilder()

assQuestionGUI::getQuestionHeaderBlockBuilder ( )

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

531 {
533 }
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 1996 of file class.assQuestionGUI.php.

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

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

+ Here is the call graph for this function:

◆ getQuestionTemplate()

assQuestionGUI::getQuestionTemplate ( )

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

614 : void
615 {
616 // @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
617 if (!$this->tpl->blockExists('adm_content')) {
618 $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.il_as_question.html', 'components/ILIAS/TestQuestionPool');
619 }
620 }

◆ getQuestionType()

assQuestionGUI::getQuestionType ( )

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

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

◆ getRenderPurpose()

assQuestionGUI::getRenderPurpose ( )

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

416 : string
417 {
419 }

◆ getSequenceNumber()

assQuestionGUI::getSequenceNumber ( )

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

804 : int
805 {
806 return $this->sequence_no;
807 }
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 1793 of file class.assQuestionGUI.php.

1793 : array
1794 {
1795 return [0];
1796 }

◆ getSuggestedSolutionsRepo()

assQuestionGUI::getSuggestedSolutionsRepo ( )
protected

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

1918 {
1919 if (is_null($this->suggestedsolution_repo)) {
1920 $dic = QuestionPoolDIC::dic();
1921 $this->suggestedsolution_repo = $dic['question.repo.suggestedsolutions'];
1922 }
1924 }
SuggestedSolutionsDatabaseRepository $suggestedsolution_repo
$dic
Definition: ltiresult.php:33

References $dic.

◆ getTargetGuiClass()

assQuestionGUI::getTargetGuiClass ( )

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

519 : ?string
520 {
522 }

◆ getTaxonomyIds()

assQuestionGUI::getTaxonomyIds ( )

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

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

◆ 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 384 of file class.assQuestionGUI.php.

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

◆ getTypeOptions()

assQuestionGUI::getTypeOptions ( )
protected

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

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

References ILIAS\UI\Implementation\Component\Input\Field\$options, and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getUseUnchangedAnswerCheckboxHtml()

assQuestionGUI::getUseUnchangedAnswerCheckboxHtml ( )
protected

Reimplemented in assMultipleChoiceGUI.

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

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

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 1634 of file class.assQuestionGUI.php.

1634 : bool
1635 {
1636 $reachedPoints = $this->object->getAdjustedReachedPoints((int) $activeId, (int) $passIndex, true);
1637 $maximumPoints = $this->object->getMaximumPoints();
1638
1639 return $reachedPoints == $maximumPoints;
1640 }

◆ hasInlineFeedback()

assQuestionGUI::hasInlineFeedback ( )

Reimplemented in assKprimChoiceGUI, assMultipleChoiceGUI, and assSingleChoiceGUI.

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

294 : bool
295 {
296 return false;
297 }

Referenced by ilTestPlayerAbstractGUI\populateInstantResponseBlocks().

+ Here is the caller graph for this function:

◆ hasSpecialQuestionCommands()

assQuestionGUI::hasSpecialQuestionCommands ( )
protected

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

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

◆ isAdjustmentEditContext()

assQuestionGUI::isAdjustmentEditContext ( )

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

479 : bool
480 {
482 }

◆ isAnswerFrequencyStatisticSupported()

assQuestionGUI::isAnswerFrequencyStatisticSupported ( )

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

1788 : bool
1789 {
1790 return true;
1791 }

Referenced by ilTestCorrectionsGUI\setCorrectionTabsContext().

+ Here is the caller graph for this function:

◆ isAuthoringEditContext()

assQuestionGUI::isAuthoringEditContext ( )

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

474 : bool
475 {
477 }

◆ isAutosaveable()

assQuestionGUI::isAutosaveable ( )

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

1642 : bool
1643 {
1644 return $this->object instanceof QuestionAutosaveable;
1645 }

◆ isInLearningModuleContext()

assQuestionGUI::isInLearningModuleContext ( )

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

1951 : bool
1952 {
1954 }

Referenced by assOrderingQuestionGUI\populateQuestionSpecificFormPart().

+ Here is the caller graph for this function:

◆ isPreviousSolutionPrefilled()

assQuestionGUI::isPreviousSolutionPrefilled ( )

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

405 : bool
406 {
408 }

◆ isRenderPurposeDemoplay()

assQuestionGUI::isRenderPurposeDemoplay ( )

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

446 : bool
447 {
449 }

◆ isRenderPurposeInputValue()

assQuestionGUI::isRenderPurposeInputValue ( )

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

436 : bool
437 {
439 }

◆ isRenderPurposePlayback()

assQuestionGUI::isRenderPurposePlayback ( )

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

441 : bool
442 {
444 }

◆ isRenderPurposePreview()

assQuestionGUI::isRenderPurposePreview ( )

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

431 : bool
432 {
434 }

◆ isRenderPurposePrintPdf()

assQuestionGUI::isRenderPurposePrintPdf ( )

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

426 : bool
427 {
429 }

◆ isSaveCommand()

assQuestionGUI::isSaveCommand ( )

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

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

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 399 of file class.assQuestionGUI.php.

399 : bool
400 {
402 }

◆ linkChilds()

assQuestionGUI::linkChilds ( )

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

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

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 1709 of file class.assQuestionGUI.php.

1709 : void
1710 {
1711 return;
1712 }

◆ needsSyncQuery()

assQuestionGUI::needsSyncQuery ( )

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

1990 : bool
1991 {
1992 return $this->context_allows_sync_to_pool
1993 && $this->object->hasWritableOriginalInQuestionPool();
1994 }

◆ outChapterSelector()

assQuestionGUI::outChapterSelector ( )

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

1403 : void
1404 {
1405 $this->ctrl->setParameter($this, 'q_id', $this->object->getId());
1406
1407 $cont_obj_gui = new ilObjContentObjectGUI('', $this->request_data_collector->int('source_id'), true);
1408 $cont_obj = $cont_obj_gui->getObject();
1409 $ctree = $cont_obj->getLMTree();
1410 $nodes = $ctree->getSubtree($ctree->getNodeData($ctree->getRootId()));
1411
1412 $rows = [];
1413
1414 foreach ($nodes as $node) {
1415 if ($node['type'] == $this->request_data_collector->raw('search_link_type')) {
1416 $this->ctrl->setParameter($this, $node['type'], $node['obj_id']);
1417 $rows[] = [
1418 'title' => $node['title'],
1419 'description' => '',
1420 'text_add' => $this->lng->txt('add'),
1421 'href_add' => $this->ctrl->getLinkTarget($this, 'add' . strtoupper($node['type']))
1422 ];
1423 }
1424 }
1425
1426 $table = new ilQuestionInternalLinkSelectionTableGUI($this, 'cancelExplorer', __METHOD__);
1427 $table->setTitle($this->lng->txt('obj_' . ilUtil::stripSlashes($this->request_data_collector->string('search_link_type'))));
1428 $table->setData($rows);
1429
1430 $this->tpl->setContent($table->getHTML());
1431 }
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 1433 of file class.assQuestionGUI.php.

1433 : void
1434 {
1435 $this->ctrl->setParameter($this, 'q_id', $this->object->getId());
1436
1437 $glossary = new ilObjGlossary($this->request_data_collector->int('source_id'), true);
1438 $terms = $glossary->getTermList();
1439
1440 $rows = [];
1441
1442 foreach ($terms as $term) {
1443 $this->ctrl->setParameter($this, 'git', $term['id']);
1444 $rows[] = [
1445 'title' => $term['term'],
1446 'description' => '',
1447 'text_add' => $this->lng->txt('add'),
1448 'href_add' => $this->ctrl->getLinkTarget($this, 'addGIT')
1449 ];
1450 }
1451
1452 $table = new ilQuestionInternalLinkSelectionTableGUI($this, 'cancelExplorer', __METHOD__);
1453 $table->setTitle($this->lng->txt('glossary_term'));
1454 $table->setData($rows);
1455
1456 $this->tpl->setContent($table->getHTML());
1457 }
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 1349 of file class.assQuestionGUI.php.

1349 : void
1350 {
1351 $this->ctrl->setParameter($this, 'q_id', $this->object->getId());
1352
1353 $cont_obj_gui = new ilObjContentObjectGUI('', $this->request_data_collector->int('source_id'), true);
1354 $cont_obj = $cont_obj_gui->getObject();
1355 $pages = ilLMPageObject::getPageList($cont_obj->getId());
1356 $shownpages = [];
1357 $tree = $cont_obj->getLMTree();
1358 $chapters = $tree->getSubtree($tree->getNodeData($tree->getRootId()));
1359
1360 $rows = [];
1361
1362 foreach ($chapters as $chapter) {
1363 $chapterpages = $tree->getChildsByType($chapter['obj_id'], 'pg');
1364 foreach ($chapterpages as $page) {
1365 if ($page['type'] == $this->request_data_collector->raw('search_link_type')) {
1366 array_push($shownpages, $page['obj_id']);
1367
1368 if ($tree->isInTree($page['obj_id'])) {
1369 $path_str = $this->getContextPath($cont_obj, $page['obj_id']);
1370 } else {
1371 $path_str = '---';
1372 }
1373
1374 $this->ctrl->setParameter($this, $page['type'], $page['obj_id']);
1375 $rows[] = [
1376 'title' => $page['title'],
1377 'description' => ilLegacyFormElementsUtil::prepareFormOutput($path_str),
1378 'text_add' => $this->lng->txt('add'),
1379 'href_add' => $this->ctrl->getLinkTarget($this, 'add' . strtoupper($page['type']))
1380 ];
1381 }
1382 }
1383 }
1384 foreach ($pages as $page) {
1385 if (!in_array($page['obj_id'], $shownpages)) {
1386 $this->ctrl->setParameter($this, $page['type'], $page['obj_id']);
1387 $rows[] = [
1388 'title' => $page['title'],
1389 'description' => '---',
1390 'text_add' => $this->lng->txt('add'),
1391 'href_add' => $this->ctrl->getLinkTarget($this, 'add' . strtoupper($page['type']))
1392 ];
1393 }
1394 }
1395
1396 $table = new ilQuestionInternalLinkSelectionTableGUI($this, 'cancelExplorer', __METHOD__);
1397 $table->setTitle($this->lng->txt('obj_' . ilUtil::stripSlashes($this->request_data_collector->string('search_link_type'))));
1398 $table->setData($rows);
1399
1400 $this->tpl->setContent($table->getHTML());
1401 }
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 1675 of file class.assQuestionGUI.php.

1682 : void {
1683 $formaction = $this->completeTestOutputFormAction($formaction, $active_id, $pass);
1684
1685 $test_output = $this->getTestOutput(
1686 $active_id,
1687 $pass,
1688 $is_question_postponed,
1689 $user_post_solutions,
1690 $show_specific_inline_feedback
1691 );
1692
1693 $this->magicAfterTestOutput();
1694
1695 $this->tpl->setVariable("QUESTION_OUTPUT", $test_output);
1696 $this->tpl->setVariable("FORMACTION", $formaction);
1697 $this->tpl->setVariable("ENCTYPE", 'enctype="' . $this->getFormEncodingType() . '"');
1698 $this->tpl->setVariable("FORM_TIMESTAMP", (string) time());
1699 }
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 644 of file class.assQuestionGUI.php.

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

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 1061 of file class.assQuestionGUI.php.

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

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 1276 of file class.assQuestionGUI.php.

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

602 : void
603 {
604 foreach ($this->getPresentationJavascripts() as $jsFile) {
605 $tpl->addJavaScript($jsFile);
606 }
607 }
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 977 of file class.assQuestionGUI.php.

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

1812 : void
1813 {
1814 }

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 1859 of file class.assQuestionGUI.php.

1863 : string {
1864 if ($txt_output === null || $txt_output === '') {
1865 return '';
1866 }
1867
1868 $result = $txt_output;
1869 $is_html = false;
1870
1871 if (strlen(strip_tags($result)) < strlen($result)) {
1872 $is_html = true;
1873 }
1874
1875 // removed: did not work with magic_quotes_gpc = On
1876 if (!$is_html) {
1877 if (!$omitNl2BrWhenTextArea) {
1878 // if the string does not contain HTML code, replace the newlines with HTML line breaks
1879 $result = preg_replace("/[\n]/", "<br />", $result);
1880 }
1881 } else {
1882 // patch for problems with the <pre> tags in tinyMCE
1883 if (preg_match_all("/(<pre>.*?<\/pre>)/ims", $result, $matches)) {
1884 foreach ($matches[0] as $found) {
1885 $replacement = "";
1886 if (strpos("\n", $found) === false) {
1887 $replacement = "\n";
1888 }
1889 $removed = preg_replace("/<br\s*?\/>/ims", $replacement, $found);
1890 $result = str_replace($found, $removed, $result);
1891 }
1892 }
1893 }
1894
1895 if ($prepare_for_latex_output) {
1896 $result = ilRTE::replaceLatexSpan($result);
1897
1898 // replace special characters to prevent problems with the ILIAS template system
1899 // eg. if someone uses {1} as an answer, nothing will be shown without the replacement
1900 $result = str_replace("{", "&#123;", $result);
1901 $result = str_replace("}", "&#125;", $result);
1902 $result = str_replace("\\", "&#92;", $result);
1903 }
1904
1905 return $result;
1906 }
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 303 of file class.assQuestionGUI.php.

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

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

+ Here is the call graph for this function:

◆ renderEditForm()

assQuestionGUI::renderEditForm ( ilPropertyFormGUI  $form)
protected

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

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

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 1911 of file class.assQuestionGUI.php.

1912 {
1913 return $this->ui->renderer()->render($this->ui->factory()->legacy()->latexContent($content));
1914 }

References ILIAS\Repository\ui().

+ Here is the call graph for this function:

◆ renderPurposeSupportsFormHtml()

assQuestionGUI::renderPurposeSupportsFormHtml ( )

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

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

◆ 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 2057 of file class.assQuestionGUI.php.

2057 : void
2058 {
2059 $this->preview_session = new ilAssQuestionPreviewSession(
2060 $this->current_user->getId(),
2061 $this->object->getId()
2062 );
2063 $this->preview_session->setRandomizerSeed(null);
2064 $this->preview_session->setParticipantsSolution(null);
2065 $this->preview_session->setInstantResponseActive(false);
2066 }

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 723 of file class.assQuestionGUI.php.

723 : bool
724 {
726 $result = $this->writePostData();
727 $this->tabs_gui->activateTab('edit_question');
728
729 if ($result !== 0) {
730 return false;
731 }
732
733 $this->object->getCurrentUser()->setPref('tst_lastquestiontype', $this->object->getQuestionType());
734 $this->object->getCurrentUser()->writePref('tst_lastquestiontype', $this->object->getQuestionType());
735
736 if ($this->request_data_collector->getQuestionId() === 0) {
737 if ($this->object->getId() < 1) {
738 $this->object->createNewQuestion();
739 }
740 $this->setQuestionTabs();
741 }
742
743 if ($this->needsSyncQuery()) {
744 $cmd = strpos($this->ctrl->getCmd(), 'Return') === false
747 $this->question_sync_modal = $this->getQuestionSyncModal($cmd);
748 }
749
750 $this->object->saveToDb();
751 return true;
752 }
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 704 of file class.assQuestionGUI.php.

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

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 1082 of file class.assQuestionGUI.php.

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

◆ saveSuggestedSolutionType()

assQuestionGUI::saveSuggestedSolutionType ( )

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

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

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ saveTaxonomyAssignments()

assQuestionGUI::saveTaxonomyAssignments ( )
protected

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

964 : void
965 {
966 if (count($this->getTaxonomyIds())) {
967 foreach ($this->getTaxonomyIds() as $taxonomyId) {
968 $postvar = "tax_node_assign_$taxonomyId";
969
970 $tax_node_assign = new ilTaxAssignInputGUI($taxonomyId, true, '', $postvar);
971 // TODO: determine tst/qpl when tax assigns become maintainable within tests
972 $tax_node_assign->saveInput("qpl", $this->object->getObjId(), "quest", $this->object->getId());
973 }
974 }
975 }
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 754 of file class.assQuestionGUI.php.

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

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 484 of file class.assQuestionGUI.php.

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

◆ setContextAllowsSyncToPool()

assQuestionGUI::setContextAllowsSyncToPool ( bool  $sync_allowed)

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

1985 : void
1986 {
1987 $this->context_allows_sync_to_pool = $sync_allowed;
1988 }

◆ setCopyToExistingPoolOnSave()

assQuestionGUI::setCopyToExistingPoolOnSave ( ?int  $pool_ref_id)

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

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

Referenced by ilObjTestGUI\executeAfterQuestionCreationTasks().

+ Here is the caller graph for this function:

◆ setCopyToNewPoolOnSave()

assQuestionGUI::setCopyToNewPoolOnSave ( ?string  $pool_title)

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

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

Referenced by ilObjTestGUI\executeAfterQuestionCreationTasks().

+ Here is the caller graph for this function:

◆ setDefaultTabs()

assQuestionGUI::setDefaultTabs ( ilTabsGUI  $tabs_gui)
protected

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

1557 : void
1558 {
1559 $this->ctrl->setParameterByClass(ilAssQuestionPageGUI::class, 'q_id', $this->object->getId());
1560 $this->ctrl->setParameterByClass(static::class, 'q_id', $this->object->getId());
1561
1562 $this->addTab_Question($tabs_gui);
1563 $this->addTab_QuestionFeedback($tabs_gui);
1564 $this->addTab_SuggestedSolution($tabs_gui, static::class);
1565 }
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 469 of file class.assQuestionGUI.php.

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

◆ setErrorMessage()

assQuestionGUI::setErrorMessage ( string  $errormessage)

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

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

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 1955 of file class.assQuestionGUI.php.

1955 : void
1956 {
1957 $this->parent_type_is_lm = $flag;
1958 }

◆ setMoveAfterQuestionId()

assQuestionGUI::setMoveAfterQuestionId ( ?int  $question_id)

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

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

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

+ Here is the caller graph for this function:

◆ setNavigationGUI()

assQuestionGUI::setNavigationGUI ( ?ilTestQuestionNavigationGUI  $navigationGUI)

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

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

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 259 of file class.assQuestionGUI.php.

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

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 394 of file class.assQuestionGUI.php.

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

Referenced by ilTestPlayerAbstractGUI\getQuestionGuiInstance().

+ Here is the caller graph for this function:

◆ setPreviewSession()

assQuestionGUI::setPreviewSession ( ilAssQuestionPreviewSession  $preview_session)

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

1748 : void
1749 {
1750 $this->preview_session = $preview_session;
1751 }

◆ setPreviousSolutionPrefilled()

assQuestionGUI::setPreviousSolutionPrefilled ( bool  $previousSolutionPrefilled)

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

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

◆ setQuestionActionCmd()

assQuestionGUI::setQuestionActionCmd ( string  $questionActionCmd)

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

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

◆ setQuestionCount()

assQuestionGUI::setQuestionCount ( int  $a_question_count)

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

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

Referenced by ilTestPlayerAbstractGUI\showQuestionCmd().

+ Here is the caller graph for this function:

◆ setQuestionHeaderBlockBuilder()

assQuestionGUI::setQuestionHeaderBlockBuilder ( \ilQuestionHeaderBlockBuilder  $questionHeaderBlockBuilder)

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

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

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 1567 of file class.assQuestionGUI.php.

1567 : void
1568 {
1569 }

◆ setQuestionTabs()

assQuestionGUI::setQuestionTabs ( )

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

1545 : void
1546 {
1547 $this->tabs_gui->clearTargets();
1548
1549 if ($this->object->getId() > 0) {
1550 $this->setDefaultTabs($this->tabs_gui);
1551 $this->setQuestionSpecificTabs($this->tabs_gui);
1552 $this->tabs_gui->activateTab('edit_question');
1553 }
1554 $this->addBackTab($this->tabs_gui);
1555 }
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 421 of file class.assQuestionGUI.php.

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

◆ setSequenceNumber()

assQuestionGUI::setSequenceNumber ( int  $nr)

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

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

Referenced by ilTestPlayerAbstractGUI\showQuestionCmd().

+ Here is the caller graph for this function:

◆ setTargetGui()

assQuestionGUI::setTargetGui (   $linkTargetGui)

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

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

Referenced by ilTestPlayerAbstractGUI\getQuestionGuiInstance().

+ Here is the caller graph for this function:

◆ setTargetGuiClass()

assQuestionGUI::setTargetGuiClass ( string  $targetGuiClass)

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

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

◆ setTaxonomyIds()

assQuestionGUI::setTaxonomyIds ( array  $taxonomyIds)

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

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

◆ setTestSpecificProperties()

assQuestionGUI::setTestSpecificProperties ( )
protected

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

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

Referenced by assFormulaQuestionGUI\suggestRange().

+ Here is the caller graph for this function:

◆ suggestedsolution()

assQuestionGUI::suggestedsolution ( bool  $save = false)

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

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

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

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 554 of file class.assQuestionGUI.php.

554 : int
555 {
556 return 0;
557 }

◆ writeQuestionGenericPostData()

assQuestionGUI::writeQuestionGenericPostData ( )
protected

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

1647 : void
1648 {
1649 $this->object->setTitle($this->request_data_collector->string('title'));
1650 $this->object->setAuthor($this->request_data_collector->string('author'));
1651 $this->object->setComment($this->request_data_collector->string('comment'));
1652
1653 $nr_of_tries = $this->request_data_collector->int('nr_of_tries');
1654 if ($this->object->getSelfAssessmentEditingMode()) {
1655 $this->object->setNrOfTries($nr_of_tries);
1656 }
1657
1658 try {
1660 $this->request_data_collector->string('lifecycle')
1661 );
1662 $this->object->setLifecycle($lifecycle);
1664 }
1665
1666 $this->object->setQuestion(
1668 $this->request_data_collector->string('question')
1669 )
1670 );
1671
1673 }
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 105 of file class.assQuestionGUI.php.

◆ $component_repository

ilComponentRepository assQuestionGUI::$component_repository
private

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

◆ $context_allows_sync_to_pool

bool assQuestionGUI::$context_allows_sync_to_pool = false
private

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

◆ $copy_to_existing_pool_on_save

int assQuestionGUI::$copy_to_existing_pool_on_save = null
private

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

◆ $copy_to_new_pool_on_save

string assQuestionGUI::$copy_to_new_pool_on_save = null
private

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

◆ $ctrl

ilCtrl assQuestionGUI::$ctrl
protected

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

◆ $current_user

ilObjUser assQuestionGUI::$current_user
private

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

◆ $db

ilDBInterface assQuestionGUI::$db
private

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

◆ $editContext

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

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

◆ $editForm

ilPropertyFormGUI assQuestionGUI::$editForm = null
protected

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

◆ $error

assQuestionGUI::$error
protected

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

◆ $errormessage

string assQuestionGUI::$errormessage
protected

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

◆ $forms_helper

readonly ilTestLegacyFormsHelper assQuestionGUI::$forms_helper
protected

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

◆ $ilHelp

ilHelpGUI assQuestionGUI::$ilHelp
private

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

◆ $ilObjDataCache

ilObjectDataCache assQuestionGUI::$ilObjDataCache
private

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

◆ $lng

ilLanguage assQuestionGUI::$lng
protected

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

◆ $logger

ilLogger assQuestionGUI::$logger
protected

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

◆ $move_after_question_with_id

int assQuestionGUI::$move_after_question_with_id = null
private

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

◆ $navigationGUI

ilTestQuestionNavigationGUI assQuestionGUI::$navigationGUI = null
private

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

◆ $notes_gui

GUIService assQuestionGUI::$notes_gui
protected

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

◆ $object

assQuestion assQuestionGUI::$object
protected

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

◆ $parent_type_is_lm

bool assQuestionGUI::$parent_type_is_lm = false
protected

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

◆ $presentationContext

string assQuestionGUI::$presentationContext = null
private

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

◆ $preview_session

ilAssQuestionPreviewSession assQuestionGUI::$preview_session = null
private

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

◆ $previousSolutionPrefilled

bool assQuestionGUI::$previousSolutionPrefilled = false
private

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

◆ $question_count

int assQuestionGUI::$question_count
protected

question count in test

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

◆ $question_sync_modal

string assQuestionGUI::$question_sync_modal = ''
private

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

◆ $questionActionCmd

string assQuestionGUI::$questionActionCmd = 'handleQuestionAction'
private

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

◆ $questionHeaderBlockBuilder

ilQuestionHeaderBlockBuilder assQuestionGUI::$questionHeaderBlockBuilder
private

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

◆ $questionrepository

GeneralQuestionPropertiesRepository assQuestionGUI::$questionrepository
protected

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

◆ $rbacsystem

ilRbacSystem assQuestionGUI::$rbacsystem
private

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

◆ $refinery

Refinery assQuestionGUI::$refinery
protected

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

◆ $renderPurpose

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

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

◆ $request_data_collector

readonly RequestDataCollector assQuestionGUI::$request_data_collector
protected

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

◆ $sequence_no

int assQuestionGUI::$sequence_no
protected

sequence number in test

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

◆ $suggestedsolution_repo

SuggestedSolutionsDatabaseRepository assQuestionGUI::$suggestedsolution_repo = null
protected

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

◆ $tabs_gui

ilTabsGUI assQuestionGUI::$tabs_gui
private

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

◆ $targetGuiClass

assQuestionGUI::$targetGuiClass = null
private

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

◆ $taxonomyIds

assQuestionGUI::$taxonomyIds = []
private

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

◆ $tpl

ilGlobalPageTemplate assQuestionGUI::$tpl
protected

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

◆ $tree

ilTree assQuestionGUI::$tree
private

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

◆ $ui

UIServices assQuestionGUI::$ui
protected

Definition at line 102 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 93 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 43 of file class.assQuestionGUI.php.

Referenced by ilKprimChoiceWizardInputGUI\cleanupAnswerText().

◆ CMD_SAVE

const assQuestionGUI::CMD_SAVE = 'save'
private

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

◆ CMD_SAVE_AND_RETURN

const assQuestionGUI::CMD_SAVE_AND_RETURN = 'saveReturn'
private

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

◆ CMD_SYNC_QUESTION

const assQuestionGUI::CMD_SYNC_QUESTION = 'syncQuestion'
private

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

◆ CMD_SYNC_QUESTION_AND_RETURN

const assQuestionGUI::CMD_SYNC_QUESTION_AND_RETURN = 'syncQuestionReturn'

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

Referenced by ilAssQuestionPreviewGUI\showCmd().

◆ CORRECTNESS_MOSTLY_OK

const assQuestionGUI::CORRECTNESS_MOSTLY_OK = 1

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

◆ CORRECTNESS_NOT_OK

const assQuestionGUI::CORRECTNESS_NOT_OK = 0

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

◆ CORRECTNESS_OK

const assQuestionGUI::CORRECTNESS_OK = 2

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

◆ EDIT_CONTEXT_ADJUSTMENT

const assQuestionGUI::EDIT_CONTEXT_ADJUSTMENT = 'adjustment'

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

◆ EDIT_CONTEXT_AUTHORING

const assQuestionGUI::EDIT_CONTEXT_AUTHORING = 'authoring'

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

Referenced by ilObjTestGUI\forwardCommandToQuestion().

◆ FORM_ENCODING_MULTIPART

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

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

◆ FORM_ENCODING_URLENCODE

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

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

◆ FORM_MODE_ADJUST

const assQuestionGUI::FORM_MODE_ADJUST = 'adjust'

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

◆ FORM_MODE_EDIT

const assQuestionGUI::FORM_MODE_EDIT = 'edit'

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

◆ HAS_SPECIAL_QUESTION_COMMANDS

const assQuestionGUI::HAS_SPECIAL_QUESTION_COMMANDS = false
protected

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

◆ PRESENTATION_CONTEXT_RESULTS

const assQuestionGUI::PRESENTATION_CONTEXT_RESULTS = 'pContextResults'

Definition at line 67 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 81 of file class.assQuestionGUI.php.

◆ RENDER_PURPOSE_DEMOPLAY

const assQuestionGUI::RENDER_PURPOSE_DEMOPLAY = 'renderPurposeDemoplay'

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

Referenced by ilAssQuestionPreviewGUI\initQuestion().

◆ RENDER_PURPOSE_INPUT_VALUE

const assQuestionGUI::RENDER_PURPOSE_INPUT_VALUE = 'renderPurposeInputValue'

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

◆ RENDER_PURPOSE_PLAYBACK

const assQuestionGUI::RENDER_PURPOSE_PLAYBACK = 'renderPurposePlayback'

Definition at line 57 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 60 of file class.assQuestionGUI.php.

◆ SESSION_PREVIEW_DATA_BASE_INDEX

const assQuestionGUI::SESSION_PREVIEW_DATA_BASE_INDEX = 'ilAssQuestionPreviewAnswers'

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

◆ SUGGESTED_SOLUTION_COMMANDS_CANCEL

const assQuestionGUI::SUGGESTED_SOLUTION_COMMANDS_CANCEL = 'cancelSuggestedSolution'
protected

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

◆ SUGGESTED_SOLUTION_COMMANDS_DEFAULT

const assQuestionGUI::SUGGESTED_SOLUTION_COMMANDS_DEFAULT = 'suggestedsolution'
protected

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

◆ SUGGESTED_SOLUTION_COMMANDS_SAVE

const assQuestionGUI::SUGGESTED_SOLUTION_COMMANDS_SAVE = 'saveSuggestedSolution'
protected

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


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