ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
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 ()
 
 supportsAdjustment ()
 

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 Member Functions

 getQuestionTypeTranslation ()
 

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
 
ilComponentFactory $component_factory
 
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 575 of file class.assQuestionGUI.php.

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

1732 : void
1733 {
1734 if ($this->object->getId() <= 0) {
1735 $tabs_gui->setBackTarget(
1736 $this->lng->txt('cancel'),
1737 $this->ctrl->getParentReturnByClass(
1739 ilObject::_lookupType($this->object->getObjId())
1740 ) . 'GUI'
1741 )
1742 );
1743 return;
1744 }
1745 $this->ctrl->setParameterByClass(
1746 ilAssQuestionPreviewGUI::class,
1747 'q_id',
1748 $this->object->getId()
1749 );
1750 $this->ctrl->saveParameterByClass(ilAssQuestionPreviewGUI::class, 'prev_qid');
1752 $this->lng->txt('backtocallingpage'),
1753 $this->ctrl->getLinkTargetByClass(
1754 ilAssQuestionPreviewGUI::class,
1756 )
1757 );
1758 $this->ctrl->clearParameterByClass(ilAssQuestionPreviewGUI::class, 'prev_qid');
1759 }
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 858 of file class.assQuestionGUI.php.

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

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

Referenced by assFormulaQuestionGUI\writePostData().

+ Here is the caller graph for this function:

◆ addGIT()

assQuestionGUI::addGIT ( )

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

1524 : void
1525 {
1526 $target = "il__git_" . $this->request_data_collector->raw("git");
1528 $this->tpl->setOnScreenMessage('success', $this->lng->txt("suggested_solution_added_successfully"), true);
1529 $this->ctrl->redirect($this, 'suggestedsolution');
1530 }
createSuggestedSolutionLinkingTo(string $type, string $target)

References ILIAS\Scripts\PHPStan\$target, ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ addHeaderAction()

assQuestionGUI::addHeaderAction ( )

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

301 : void
302 {
303 }

◆ addNumberOfTriesToFormIfNecessary()

assQuestionGUI::addNumberOfTriesToFormIfNecessary ( ilPropertyFormGUI  $form)
protected

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

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

1508 : void
1509 {
1510 $target = "il__pg_" . $this->request_data_collector->raw("pg");
1512 $this->tpl->setOnScreenMessage('success', $this->lng->txt("suggested_solution_added_successfully"), true);
1513 $this->ctrl->redirect($this, 'suggestedsolution');
1514 }

References ILIAS\Scripts\PHPStan\$target, ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ addQuestionFormCommandButtons()

assQuestionGUI::addQuestionFormCommandButtons ( ilPropertyFormGUI  $form)

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

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

1973 : void
1974 {
1975 $this->tpl->addOnloadCode("
1976 let form = document.querySelector('#ilContentContainer form');
1977 let button = form.querySelector('input[name=\"cmd[save]\"]');
1978 if (form && button) {
1979 form.addEventListener('keydown', function (e) {
1980 if (e.key === 'Enter'
1981 && e.target.type !== 'textarea'
1982 && e.target.type !== 'submit'
1983 && e.target.type !== 'file'
1984 ) {
1985 e.preventDefault();
1986 form.requestSubmit(button);
1987 }
1988 })
1989 }
1990 ");
1991 }

◆ addST()

assQuestionGUI::addST ( )

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

1516 : void
1517 {
1518 $target = "il__st_" . $this->request_data_collector->raw("st");
1520 $this->tpl->setOnScreenMessage('success', $this->lng->txt("suggested_solution_added_successfully"), true);
1521 $this->ctrl->redirect($this, 'suggestedsolution');
1522 }

References ILIAS\Scripts\PHPStan\$target, 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 1632 of file class.assQuestionGUI.php.

1632 : void
1633 {
1635 'edit_question',
1636 $this->ctrl->getLinkTargetByClass(
1637 static::class,
1638 'editQuestion'
1639 ),
1640 'editQuestion',
1641 '',
1642 '',
1643 false
1644 );
1645 }
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 1618 of file class.assQuestionGUI.php.

1618 : void
1619 {
1620 $this->ctrl->setParameterByClass(ilAssQuestionFeedbackEditingGUI::class, 'q_id', $this->object->getId());
1621
1622 $tabs->addTab(
1623 'feedback',
1624 $this->lng->txt('tst_feedback'),
1625 $this->ctrl->getLinkTargetByClass(
1626 ilAssQuestionFeedbackEditingGUI::class,
1628 )
1629 );
1630 }
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 1584 of file class.assQuestionGUI.php.

1584 : void
1585 {
1586 $this->ctrl->setParameterByClass($classname, 'q_id', $this->object->getId());
1587 $tabs->addTarget(
1588 'suggested_solution',
1589 $this->ctrl->getLinkTargetByClass($classname, 'suggestedsolution'),
1590 [
1591 'suggestedsolution',
1592 'saveSuggestedSolution',
1593 'outSolutionExplorer',
1594 'cancel',
1595 'addSuggestedSolution',
1596 'cancelExplorer' ,
1597 'linkChilds',
1598 'removeSuggestedSolution'
1599 ]
1600 );
1601 }

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

+ Here is the call graph for this function:

◆ assessment()

assQuestionGUI::assessment ( )

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

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

1775 {
1776 $form = new ilPropertyFormGUI();
1777 $form->setFormAction($this->ctrl->getFormAction($this));
1778 $form->setId($this->getType());
1779 $form->setTitle($this->outQuestionType());
1780 $form->setTableWidth('100%');
1781 $form->setMultipart(true);
1782 return $form;
1783 }
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 1790 of file class.assQuestionGUI.php.

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

2062 : string
2063 {
2064 if (strtolower($this->request_data_collector->string('cmdClass')) === 'ilassquestionpreviewgui') {
2065 return $this->ctrl->getLinkTargetByClass(ilObjQuestionPoolGUI::class, 'downloadFile');
2066 }
2067 return $this->ctrl->getLinkTargetByClass(ilObjTestGUI::class, 'downloadFile');
2068 }

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

1796 : string
1797 {
1798 return '<div id="focus"></div>';
1799 }

◆ cancelExplorer()

assQuestionGUI::cancelExplorer ( )

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

1357 : void
1358 {
1359 $this->ctrl->redirect($this, 'suggestedsolution');
1360 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ cancelSuggestedSolution()

assQuestionGUI::cancelSuggestedSolution ( )

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

1100 : void
1101 {
1102 $this->suggestedsolution();
1103 }
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 1943 of file class.assQuestionGUI.php.

1943 : array
1944 {
1945 if (!is_array($answer_text)) {
1946 return [];
1947 }
1948
1949 if ($is_rte) {
1951 $answer_text,
1952 false,
1954 );
1955 }
1956
1958 $answer_text,
1959 true,
1960 self::ALLOWED_PLAIN_TEXT_TAGS
1961 );
1962 }
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 1993 of file class.assQuestionGUI.php.

1993 : bool
1994 {
1995 return in_array($cmd, static::ADDITIONAL_CMDS_NEEDING_EXISTING_QST);
1996 }

◆ completeTestOutputFormAction()

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

Reimplemented in assImagemapQuestionGUI.

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

1718 : string {
1719 return $form_action;
1720 }

◆ createSuggestedSolutionLinkingTo()

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

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

1473 {
1474 $repo = $this->getSuggestedSolutionsRepo();
1475 $question_id = $this->object->getId();
1476 $subquestion_index = $this->request_data_collector->int('subquestion_index');
1477 $subquestion_index = ($subquestion_index > 0) ? $subquestion_index : 0;
1478
1479 $solution = $repo->create($question_id, $type)
1480 ->withSubquestionIndex($subquestion_index)
1481 ->withInternalLink($target);
1482
1483 $repo->update([$solution]);
1484 }

References ILIAS\Scripts\PHPStan\$target.

◆ editQuestion()

◆ escapeTemplatePlaceholders()

assQuestionGUI::escapeTemplatePlaceholders ( string  $text)
protected

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

1785 : string
1786 {
1787 return str_replace(['{','}'], ['&#123;','&#125;'], $text);
1788 }
$text
Definition: xapiexit.php:21

References $text.

◆ executeCommand()

assQuestionGUI::executeCommand ( )

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

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

1838 : string
1839 {
1840 switch ($correctness) {
1842 $icon_name = 'standard/icon_not_ok.svg';
1843 $label = $this->lng->txt("answer_is_wrong");
1844 break;
1846 $icon_name = 'standard/icon_mostly_ok.svg';
1847 $label = $this->lng->txt("answer_is_not_correct_but_positive");
1848 break;
1850 $icon_name = 'standard/icon_ok.svg';
1851 $label = $this->lng->txt("answer_is_right");
1852 break;
1853 default:
1854 return '';
1855 }
1856 $path = ilUtil::getImagePath($icon_name);
1857 $icon = $this->ui->factory()->symbol()->icon()->custom(
1858 $path,
1859 $label
1860 );
1861 return $this->ui->renderer()->render($icon);
1862 }
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)

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

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

◆ getAdditionalEditQuestionCommands()

assQuestionGUI::getAdditionalEditQuestionCommands ( )
protected

Reimplemented in assKprimChoiceGUI.

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

1613 : array
1614 {
1615 return [];
1616 }

◆ getAnswerFrequencyTableGUI()

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

Reimplemented in assClozeTestGUI, assKprimChoiceGUI, assLongMenuGUI, and assMatchingQuestionGUI.

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

1817 {
1818 $table = new ilAnswerFrequencyStatisticTableGUI($parentGui, $parentCmd, $this->object);
1819 $table->setQuestionIndex($questionIndex);
1820 $table->setData($this->getAnswersFrequency($relevantAnswers, $questionIndex));
1821 $table->initColumns();
1822 return $table;
1823 }
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 841 of file class.assQuestionGUI.php.

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

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

2041 : ?string {
2042 $autosave_solutions = $this->object->getSolutionValues($active_id, $pass, false);
2043 if ($autosave_solutions === []) {
2044 return null;
2045 }
2046 return $this->renderSolutionOutput(
2047 $autosave_solutions,
2048 $active_id,
2049 $pass,
2050 $graphical_output,
2051 $result_output,
2052 $show_question_only,
2053 $show_feedback,
2054 $show_correct_solution,
2055 $show_manual_scoring,
2056 $show_question_text,
2057 $show_autosave_title,
2058 $show_inline_feedback
2059 );
2060 }
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 1608 of file class.assQuestionGUI.php.

1608 : array
1609 {
1610 return ['editQuestion', 'save', 'originalSyncForm'];
1611 }

◆ getCommandsFromClassConstants()

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

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

1540 : array {
1541 $reflectionClass = new ReflectionClass($guiClassName);
1542
1543 $commands = null;
1544
1545 if ($reflectionClass instanceof ReflectionClass) {
1546 $commands = [];
1547
1548 foreach ($reflectionClass->getConstants() as $constName => $constValue) {
1549 if (substr($constName, 0, strlen($cmdConstantNameBegin)) == $cmdConstantNameBegin) {
1550 $commands[] = $constValue;
1551 }
1552 }
1553 }
1554
1555 return $commands;
1556 }

Referenced by ilPCQuestionGUI\setTabs().

+ Here is the caller graph for this function:

◆ getCommentsPanelHTML()

assQuestionGUI::getCommentsPanelHTML ( )

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

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

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

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

◆ getCopyToExistingPoolOnSave()

assQuestionGUI::getCopyToExistingPoolOnSave ( )

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

271 : ?int
272 {
274 }

Referenced by ilObjTestGUI\executeAfterQuestionCreationTasks().

+ Here is the caller graph for this function:

◆ getCopyToNewPoolOnSave()

assQuestionGUI::getCopyToNewPoolOnSave ( )

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

281 : ?string
282 {
284 }

Referenced by ilObjTestGUI\executeAfterQuestionCreationTasks().

+ Here is the caller graph for this function:

◆ getEditContext()

assQuestionGUI::getEditContext ( )

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

466 : string
467 {
468 return $this->editContext;
469 }

◆ getEditQuestionTabCommands()

assQuestionGUI::getEditQuestionTabCommands ( )
final

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

1603 : array
1604 {
1605 return array_merge($this->getBasicEditQuestionTabCommands(), $this->getAdditionalEditQuestionCommands());
1606 }

◆ getErrorMessage()

assQuestionGUI::getErrorMessage ( )

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

821 : string
822 {
823 return $this->errormessage;
824 }

Referenced by assFormulaQuestionGUI\suggestRange().

+ Here is the caller graph for this function:

◆ getFormEncodingType()

assQuestionGUI::getFormEncodingType ( )

Reimplemented in assFileUploadGUI.

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

1727 : string
1728 {
1730 }

◆ getGenericFeedbackOutput()

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

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

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

1045 : string
1046 {
1048 $this->object->feedbackOBJ->getGenericFeedbackTestPresentation($this->object->getId(), true),
1049 true
1050 ));
1051 }

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

+ Here is the call graph for this function:

◆ getGenericFeedbackOutputForIncorrectSolution()

assQuestionGUI::getGenericFeedbackOutputForIncorrectSolution ( )

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

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

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

+ Here is the call graph for this function:

◆ getHeaderAction()

assQuestionGUI::getHeaderAction ( )

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

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

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

References ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ getMoveAfterQuestionId()

assQuestionGUI::getMoveAfterQuestionId ( )

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

291 : ?int
292 {
294 }

Referenced by ilObjTestGUI\executeAfterQuestionCreationTasks().

+ Here is the caller graph for this function:

◆ getNavigationGUI()

assQuestionGUI::getNavigationGUI ( )

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

◆ getObject()

◆ getPresentationContext()

assQuestionGUI::getPresentationContext ( )

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

391 : ?string
392 {
394 }

◆ getPresentationJavascripts()

assQuestionGUI::getPresentationJavascripts ( )

Reimplemented in assMultipleChoiceGUI.

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

611 : array
612 {
613 return [];
614 }

◆ getPreview()

◆ getPreviewSession()

assQuestionGUI::getPreviewSession ( )
Returns
ilAssQuestionPreviewSession|null

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

◆ getPreviousSolutionConfirmationCheckboxHtml()

assQuestionGUI::getPreviousSolutionConfirmationCheckboxHtml ( )
protected

Reimplemented in assFileUploadGUI, and assImagemapQuestionGUI.

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

690 : string
691 {
692 $tpl = new ilTemplate('tpl.tst_question_additional_behaviour_checkbox.html', true, true, 'components/ILIAS/TestQuestionPool');
693 $tpl->setVariable('TXT_FORCE_FORM_DIFF_LABEL', $this->lng->txt('use_previous_solution'));
694 return $tpl->get();
695 }
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 ILIAS\News\Common\Table\$tpl, ilGlobalPageTemplate\get(), ILIAS\Repository\lng(), and ILIAS\UICore\GlobalTemplate\setVariable().

+ Here is the call graph for this function:

◆ getPreviousSolutionProvidedMessage()

assQuestionGUI::getPreviousSolutionProvidedMessage ( )
protected

Reimplemented in assFileUploadGUI.

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

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

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getQuestionActionCmd()

assQuestionGUI::getQuestionActionCmd ( )

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

547 : string
548 {
550 }

◆ getQuestionCount()

assQuestionGUI::getQuestionCount ( )

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

816 : int
817 {
819 }
int $question_count
question count in test

◆ getQuestionHeaderBlockBuilder()

assQuestionGUI::getQuestionHeaderBlockBuilder ( )

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

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

2009 : string
2010 {
2011 if ($cmd_class === '') {
2012 $cmd_class = static::class;
2013 }
2014 $modal = $this->ui->factory()->modal()->interruptive(
2015 $this->lng->txt('confirm'),
2016 $this->lng->txt('confirm_sync_questions'),
2017 $this->ctrl->getFormActionByClass($cmd_class, $cmd)
2018 )->withAffectedItems([
2019 $this->ui->factory()->modal()->interruptiveItem()->standard(
2020 (string) $this->object->getOriginalId(),
2021 $this->object->getTitleForHTMLOutput()
2022 )
2023 ])->withActionButtonLabel($this->lng->txt('sync_question_to_pool'));
2024 return $this->ui->renderer()->render(
2025 $modal->withOnLoad($modal->getShowSignal())
2026 );
2027 }

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

+ Here is the call graph for this function:

◆ getQuestionTemplate()

assQuestionGUI::getQuestionTemplate ( )

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

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

◆ getQuestionType()

assQuestionGUI::getQuestionType ( )

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

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

◆ getQuestionTypeTranslation()

assQuestionGUI::getQuestionTypeTranslation ( )
private

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

1076 : string
1077 {
1078 foreach ($this->component_factory->getActivePluginsInSlot('qst') as $plugin) {
1079 if ($plugin->getQuestionType() === $this->object->getQuestionType()) {
1080 return $plugin->getQuestionTypeTranslation();
1081 }
1082 }
1083
1084 return $this->lng->txt($this->object->getQuestionType());
1085 }

References XapiProxy\$plugin, ILIAS\Repository\lng(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ getRenderPurpose()

assQuestionGUI::getRenderPurpose ( )

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

418 : string
419 {
421 }

◆ getSequenceNumber()

assQuestionGUI::getSequenceNumber ( )

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

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

1806 : array
1807 {
1808 return [0];
1809 }

◆ getSuggestedSolutionsRepo()

assQuestionGUI::getSuggestedSolutionsRepo ( )
protected

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

1931 {
1932 if (is_null($this->suggestedsolution_repo)) {
1933 $dic = QuestionPoolDIC::dic();
1934 $this->suggestedsolution_repo = $dic['question.repo.suggestedsolutions'];
1935 }
1937 }
SuggestedSolutionsDatabaseRepository $suggestedsolution_repo

References XapiProxy\$dic.

◆ getTargetGuiClass()

assQuestionGUI::getTargetGuiClass ( )

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

521 : ?string
522 {
524 }

◆ getTaxonomyIds()

assQuestionGUI::getTaxonomyIds ( )

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

506 : array
507 {
508 return $this->taxonomyIds;
509 }

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

386 : string
387 {
388 return $this->getQuestionType();
389 }

◆ getTypeOptions()

assQuestionGUI::getTypeOptions ( )
protected

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

1087 : array
1088 {
1089 foreach (SuggestedSolution::TYPES as $k => $v) {
1090 $options[$k] = $this->lng->txt($v);
1091 }
1092 return $options;
1093 }

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

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

References ILIAS\News\Common\Table\$tpl, ilGlobalPageTemplate\get(), ILIAS\Repository\object(), and ILIAS\UICore\GlobalTemplate\setVariable().

+ Here is the call graph for this function:

◆ hasCorrectSolution()

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

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

1647 : bool
1648 {
1649 $reachedPoints = $this->object->getAdjustedReachedPoints((int) $activeId, (int) $passIndex, true);
1650 $maximumPoints = $this->object->getMaximumPoints();
1651
1652 return $reachedPoints == $maximumPoints;
1653 }

◆ hasInlineFeedback()

assQuestionGUI::hasInlineFeedback ( )

Reimplemented in assKprimChoiceGUI, assMultipleChoiceGUI, and assSingleChoiceGUI.

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

296 : bool
297 {
298 return false;
299 }

Referenced by ilTestPlayerAbstractGUI\populateInstantResponseBlocks().

+ Here is the caller graph for this function:

◆ hasSpecialQuestionCommands()

assQuestionGUI::hasSpecialQuestionCommands ( )
protected

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

380 : bool
381 {
382 return static::HAS_SPECIAL_QUESTION_COMMANDS;
383 }

◆ isAdjustmentEditContext()

assQuestionGUI::isAdjustmentEditContext ( )

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

481 : bool
482 {
484 }

◆ isAnswerFrequencyStatisticSupported()

assQuestionGUI::isAnswerFrequencyStatisticSupported ( )

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

1801 : bool
1802 {
1803 return true;
1804 }

Referenced by ilTestCorrectionsGUI\setCorrectionTabsContext().

+ Here is the caller graph for this function:

◆ isAuthoringEditContext()

assQuestionGUI::isAuthoringEditContext ( )

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

476 : bool
477 {
479 }

◆ isAutosaveable()

assQuestionGUI::isAutosaveable ( )

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

1655 : bool
1656 {
1657 return $this->object instanceof QuestionAutosaveable;
1658 }

◆ isInLearningModuleContext()

assQuestionGUI::isInLearningModuleContext ( )

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

1964 : bool
1965 {
1967 }

Referenced by assOrderingQuestionGUI\populateQuestionSpecificFormPart().

+ Here is the caller graph for this function:

◆ isPreviousSolutionPrefilled()

assQuestionGUI::isPreviousSolutionPrefilled ( )

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

407 : bool
408 {
410 }

◆ isRenderPurposeDemoplay()

assQuestionGUI::isRenderPurposeDemoplay ( )

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

448 : bool
449 {
451 }

◆ isRenderPurposeInputValue()

assQuestionGUI::isRenderPurposeInputValue ( )

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

438 : bool
439 {
441 }

◆ isRenderPurposePlayback()

assQuestionGUI::isRenderPurposePlayback ( )

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

443 : bool
444 {
446 }

◆ isRenderPurposePreview()

assQuestionGUI::isRenderPurposePreview ( )

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

433 : bool
434 {
436 }

◆ isRenderPurposePrintPdf()

assQuestionGUI::isRenderPurposePrintPdf ( )

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

428 : bool
429 {
431 }

◆ isSaveCommand()

assQuestionGUI::isSaveCommand ( )

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

1532 : bool
1533 {
1534 return in_array($this->ctrl->getCmd(), self::QUESTION_SAVE_CMDS);
1535 }

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

401 : bool
402 {
404 }

◆ linkChilds()

assQuestionGUI::linkChilds ( )

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

1486 : void
1487 {
1488 $this->ctrl->saveParameter($this, ["subquestion_index", "link_new_type", "search_link_type"]);
1489 switch ($this->request_data_collector->string("search_link_type")) {
1490 case "pg":
1491 $this->outPageSelector();
1492 break;
1493 case "st":
1494 $this->outChapterSelector();
1495 break;
1496 case "glo":
1497 $this->outGlossarySelector();
1498 break;
1499 case "lm":
1500 $target = "il__lm_" . $this->request_data_collector->raw("source_id");
1502 $this->tpl->setOnScreenMessage('success', $this->lng->txt("suggested_solution_added_successfully"), true);
1503 $this->ctrl->redirect($this, 'suggestedsolution');
1504 break;
1505 }
1506 }

References ILIAS\Scripts\PHPStan\$target, ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ magicAfterTestOutput()

assQuestionGUI::magicAfterTestOutput ( )

Reimplemented in assTextQuestionGUI.

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

1722 : void
1723 {
1724 return;
1725 }

◆ needsSyncQuery()

assQuestionGUI::needsSyncQuery ( )

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

2003 : bool
2004 {
2005 return $this->context_allows_sync_to_pool
2006 && $this->object->hasWritableOriginalInQuestionPool();
2007 }

◆ outChapterSelector()

assQuestionGUI::outChapterSelector ( )

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

1416 : void
1417 {
1418 $this->ctrl->setParameter($this, 'q_id', $this->object->getId());
1419
1420 $cont_obj_gui = new ilObjContentObjectGUI('', $this->request_data_collector->int('source_id'), true);
1421 $cont_obj = $cont_obj_gui->getObject();
1422 $ctree = $cont_obj->getLMTree();
1423 $nodes = $ctree->getSubtree($ctree->getNodeData($ctree->getRootId()));
1424
1425 $rows = [];
1426
1427 foreach ($nodes as $node) {
1428 if ($node['type'] == $this->request_data_collector->raw('search_link_type')) {
1429 $this->ctrl->setParameter($this, $node['type'], $node['obj_id']);
1430 $rows[] = [
1431 'title' => $node['title'],
1432 'description' => '',
1433 'text_add' => $this->lng->txt('add'),
1434 'href_add' => $this->ctrl->getLinkTarget($this, 'add' . strtoupper($node['type']))
1435 ];
1436 }
1437 }
1438
1439 $table = new ilQuestionInternalLinkSelectionTableGUI($this, 'cancelExplorer', __METHOD__);
1440 $table->setTitle($this->lng->txt('obj_' . ilUtil::stripSlashes($this->request_data_collector->string('search_link_type'))));
1441 $table->setData($rows);
1442
1443 $this->tpl->setContent($table->getHTML());
1444 }
Class ilObjContentObjectGUI.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References ILIAS\Scripts\PHPStan\$rows, 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 1446 of file class.assQuestionGUI.php.

1446 : void
1447 {
1448 $this->ctrl->setParameter($this, 'q_id', $this->object->getId());
1449
1450 $glossary = new ilObjGlossary($this->request_data_collector->int('source_id'), true);
1451 $terms = $glossary->getTermList();
1452
1453 $rows = [];
1454
1455 foreach ($terms as $term) {
1456 $this->ctrl->setParameter($this, 'git', $term['id']);
1457 $rows[] = [
1458 'title' => $term['term'],
1459 'description' => '',
1460 'text_add' => $this->lng->txt('add'),
1461 'href_add' => $this->ctrl->getLinkTarget($this, 'addGIT')
1462 ];
1463 }
1464
1465 $table = new ilQuestionInternalLinkSelectionTableGUI($this, 'cancelExplorer', __METHOD__);
1466 $table->setTitle($this->lng->txt('glossary_term'));
1467 $table->setData($rows);
1468
1469 $this->tpl->setContent($table->getHTML());
1470 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References ILIAS\Scripts\PHPStan\$rows, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ outPageSelector()

assQuestionGUI::outPageSelector ( )

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

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

1695 : void {
1696 $formaction = $this->completeTestOutputFormAction($formaction, $active_id, $pass);
1697
1698 $test_output = $this->getTestOutput(
1699 $active_id,
1700 $pass,
1701 $is_question_postponed,
1702 $user_post_solutions,
1703 $show_specific_inline_feedback
1704 );
1705
1706 $this->magicAfterTestOutput();
1707
1708 $this->tpl->setVariable("QUESTION_OUTPUT", $test_output);
1709 $this->tpl->setVariable("FORMACTION", $formaction);
1710 $this->tpl->setVariable("ENCTYPE", 'enctype="' . $this->getFormEncodingType() . '"');
1711 $this->tpl->setVariable("FORM_TIMESTAMP", (string) time());
1712 }
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 646 of file class.assQuestionGUI.php.

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

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

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

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

1289 : void
1290 {
1291 $type = $this->request_data_collector->string("link_new_type");
1292 $search = $this->request_data_collector->string("search_link_type");
1293 $this->ctrl->setParameter($this, "link_new_type", $type);
1294 $this->ctrl->setParameter($this, "search_link_type", $search);
1295 $this->ctrl->saveParameter($this, ["subquestion_index", "link_new_type", "search_link_type"]);
1296
1297 $this->tpl->setOnScreenMessage('info', $this->lng->txt("select_object_to_link"));
1298
1299 $parent_ref_id = $this->tree->getParentId($this->request_data_collector->getRefId());
1300 $exp = new ilSolutionExplorer($this->ctrl->getLinkTarget($this, 'suggestedsolution'), get_class($this));
1301 $exp->setExpand($this->request_data_collector->raw('expand_sol') ? $this->request_data_collector->raw('expand_sol') : $parent_ref_id);
1302 $exp->setExpandTarget($this->ctrl->getLinkTarget($this, 'outSolutionExplorer'));
1303 $exp->setTargetGet("ref_id");
1304 $exp->setRefId($this->request_data_collector->getRefId());
1305 $exp->addFilter($type);
1306 $exp->setSelectableType($type);
1307 if ($this->request_data_collector->isset('expandCurrentPath') && $this->request_data_collector->raw('expandCurrentPath')) {
1308 $exp->expandPathByRefId($parent_ref_id);
1309 }
1310
1311 // build html-output
1312 $exp->setOutput(0);
1313
1314 $template = new ilTemplate("tpl.il_as_qpl_explorer.html", true, true, "components/ILIAS/TestQuestionPool");
1315 $template->setVariable("EXPLORER_TREE", $exp->getOutput());
1316 $template->setVariable("BUTTON_CANCEL", $this->lng->txt("cancel"));
1317 $template->setVariable("FORMACTION", $this->ctrl->getFormAction($this, "suggestedsolution"));
1318 $this->tpl->setVariable("ADM_CONTENT", $template->get());
1319 }
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 604 of file class.assQuestionGUI.php.

604 : void
605 {
606 foreach ($this->getPresentationJavascripts() as $jsFile) {
607 $tpl->addJavaScript($jsFile);
608 }
609 }
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\News\Common\Table\$tpl, and 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 979 of file class.assQuestionGUI.php.

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

1825 : void
1826 {
1827 }

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

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

305 : void
306 {
307 echo $this->getHeaderAction() . $this->ui->mainTemplate()->getOnLoadCodeForAsynch();
308 exit;
309 }
exit
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

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

+ Here is the call graph for this function:

◆ renderEditForm()

assQuestionGUI::renderEditForm ( ilPropertyFormGUI  $form)
protected

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

624 : void
625 {
627 $this->getQuestionTemplate();
628 $this->tpl->setVariable('QUESTION_DATA', $form->getHTML() . $this->question_sync_modal);
629 }

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

1925 {
1926 return $this->ui->renderer()->render($this->ui->factory()->legacy()->latexContent($content));
1927 }

References ILIAS\Repository\ui().

+ Here is the call graph for this function:

◆ renderPurposeSupportsFormHtml()

assQuestionGUI::renderPurposeSupportsFormHtml ( )

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

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

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

2078 : void
2079 {
2080 $this->preview_session = new ilAssQuestionPreviewSession(
2081 $this->current_user->getId(),
2082 $this->object->getId()
2083 );
2084 $this->preview_session->setRandomizerSeed(null);
2085 $this->preview_session->setParticipantsSolution(null);
2086 $this->preview_session->setInstantResponseActive(false);
2087 }

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

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

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

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

1095 : void
1096 {
1097 $this->suggestedsolution(true);
1098 }

◆ saveSuggestedSolutionType()

assQuestionGUI::saveSuggestedSolutionType ( )

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

1321 : void
1322 {
1323 $solution_type = $this->request_data_collector->string('solutiontype');
1324
1325 switch ($solution_type) {
1326 case 'lm':
1327 $type = 'lm';
1328 $search = 'lm';
1329 break;
1330 case 'git':
1331 $type = 'glo';
1332 $search = 'glo';
1333 break;
1334 case 'st':
1335 $type = 'lm';
1336 $search = 'st';
1337 break;
1338 case 'pg':
1339 $type = 'lm';
1340 $search = 'pg';
1341 break;
1342 case 'file':
1343 case 'text':
1344 default:
1345 $this->suggestedsolution();
1346 return;
1347 }
1348
1349 if (isset($solution_type)) {
1350 $this->ctrl->setParameter($this, 'expandCurrentPath', 1);
1351 }
1352 $this->ctrl->setParameter($this, 'link_new_type', $type);
1353 $this->ctrl->setParameter($this, 'search_link_type', $search);
1354 $this->ctrl->redirect($this, 'outSolutionExplorer');
1355 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ saveTaxonomyAssignments()

assQuestionGUI::saveTaxonomyAssignments ( )
protected

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

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

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

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

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

◆ setContextAllowsSyncToPool()

assQuestionGUI::setContextAllowsSyncToPool ( bool  $sync_allowed)

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

1998 : void
1999 {
2000 $this->context_allows_sync_to_pool = $sync_allowed;
2001 }

◆ setCopyToExistingPoolOnSave()

assQuestionGUI::setCopyToExistingPoolOnSave ( ?int  $pool_ref_id)

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

266 : void
267 {
268 $this->copy_to_existing_pool_on_save = $pool_ref_id;
269 }

Referenced by ilObjTestGUI\executeAfterQuestionCreationTasks().

+ Here is the caller graph for this function:

◆ setCopyToNewPoolOnSave()

assQuestionGUI::setCopyToNewPoolOnSave ( ?string  $pool_title)

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

276 : void
277 {
278 $this->copy_to_new_pool_on_save = $pool_title;
279 }

Referenced by ilObjTestGUI\executeAfterQuestionCreationTasks().

+ Here is the caller graph for this function:

◆ setDefaultTabs()

assQuestionGUI::setDefaultTabs ( ilTabsGUI  $tabs_gui)
protected

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

1570 : void
1571 {
1572 $this->ctrl->setParameterByClass(ilAssQuestionPageGUI::class, 'q_id', $this->object->getId());
1573 $this->ctrl->setParameterByClass(static::class, 'q_id', $this->object->getId());
1574
1575 $this->addTab_Question($tabs_gui);
1576 $this->addTab_QuestionFeedback($tabs_gui);
1577 $this->addTab_SuggestedSolution($tabs_gui, static::class);
1578 }
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 471 of file class.assQuestionGUI.php.

471 : void
472 {
473 $this->editContext = $editContext;
474 }

◆ setErrorMessage()

assQuestionGUI::setErrorMessage ( string  $errormessage)

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

826 : void
827 {
828 $this->errormessage = $errormessage;
829 }

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

1968 : void
1969 {
1970 $this->parent_type_is_lm = $flag;
1971 }

◆ setMoveAfterQuestionId()

assQuestionGUI::setMoveAfterQuestionId ( ?int  $question_id)

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

286 : void
287 {
288 $this->move_after_question_with_id = $question_id;
289 }

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

+ Here is the caller graph for this function:

◆ setNavigationGUI()

assQuestionGUI::setNavigationGUI ( ?ilTestQuestionNavigationGUI  $navigationGUI)

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

496 : void
497 {
498 $this->navigationGUI = $navigationGUI;
499 }

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

261 : void
262 {
263 $this->object = $question;
264 }

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

396 : void
397 {
398 $this->presentationContext = $presentationContext;
399 }

Referenced by ilTestPlayerAbstractGUI\getQuestionGuiInstance().

+ Here is the caller graph for this function:

◆ setPreviewSession()

assQuestionGUI::setPreviewSession ( ilAssQuestionPreviewSession  $preview_session)

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

1761 : void
1762 {
1763 $this->preview_session = $preview_session;
1764 }

◆ setPreviousSolutionPrefilled()

assQuestionGUI::setPreviousSolutionPrefilled ( bool  $previousSolutionPrefilled)

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

412 : void
413 {
414 $this->previousSolutionPrefilled = $previousSolutionPrefilled;
415 }

◆ setQuestionActionCmd()

assQuestionGUI::setQuestionActionCmd ( string  $questionActionCmd)

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

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

◆ setQuestionCount()

assQuestionGUI::setQuestionCount ( int  $a_question_count)

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

811 : void
812 {
813 $this->question_count = $a_question_count;
814 }

Referenced by ilTestPlayerAbstractGUI\showQuestionCmd().

+ Here is the caller graph for this function:

◆ setQuestionHeaderBlockBuilder()

assQuestionGUI::setQuestionHeaderBlockBuilder ( \ilQuestionHeaderBlockBuilder  $questionHeaderBlockBuilder)

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

526 : void
527 {
528 $this->questionHeaderBlockBuilder = $questionHeaderBlockBuilder;
529 }

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

1580 : void
1581 {
1582 }

◆ setQuestionTabs()

assQuestionGUI::setQuestionTabs ( )

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

1558 : void
1559 {
1560 $this->tabs_gui->clearTargets();
1561
1562 if ($this->object->getId() > 0) {
1563 $this->setDefaultTabs($this->tabs_gui);
1564 $this->setQuestionSpecificTabs($this->tabs_gui);
1565 $this->tabs_gui->activateTab('edit_question');
1566 }
1567 $this->addBackTab($this->tabs_gui);
1568 }
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 423 of file class.assQuestionGUI.php.

423 : void
424 {
425 $this->renderPurpose = $renderPurpose;
426 }

◆ setSequenceNumber()

assQuestionGUI::setSequenceNumber ( int  $nr)

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

801 : void
802 {
803 $this->sequence_no = $nr;
804 }

Referenced by ilTestPlayerAbstractGUI\showQuestionCmd().

+ Here is the caller graph for this function:

◆ setTargetGui()

assQuestionGUI::setTargetGui (   $linkTargetGui)

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

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

Referenced by ilTestPlayerAbstractGUI\getQuestionGuiInstance().

+ Here is the caller graph for this function:

◆ setTargetGuiClass()

assQuestionGUI::setTargetGuiClass ( string  $targetGuiClass)

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

516 : void
517 {
518 $this->targetGuiClass = $targetGuiClass;
519 }

◆ setTaxonomyIds()

assQuestionGUI::setTaxonomyIds ( array  $taxonomyIds)

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

501 : void
502 {
503 $this->taxonomyIds = $taxonomyIds;
504 }

◆ setTestSpecificProperties()

assQuestionGUI::setTestSpecificProperties ( )
protected

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

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

Referenced by assFormulaQuestionGUI\suggestRange().

+ Here is the caller graph for this function:

◆ suggestedsolution()

assQuestionGUI::suggestedsolution ( bool  $save = false)

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

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

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:

◆ supportsAdjustment()

assQuestionGUI::supportsAdjustment ( )

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

2070 : bool
2071 {
2072 return ($this instanceof ilGuiQuestionScoringAdjustable
2073 || $this instanceof ilGuiAnswerScoringAdjustable)
2074 && ($this->getObject() instanceof ilObjQuestionScoringAdjustable
2075 || $this->getObject() instanceof ilObjAnswerScoringAdjustable);
2076 }
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...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ syncQuestion()

assQuestionGUI::syncQuestion ( )

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

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

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

556 : int
557 {
558 return 0;
559 }

◆ writeQuestionGenericPostData()

assQuestionGUI::writeQuestionGenericPostData ( )
protected

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

1660 : void
1661 {
1662 $this->object->setTitle($this->request_data_collector->string('title'));
1663 $this->object->setAuthor($this->request_data_collector->string('author'));
1664 $this->object->setComment($this->request_data_collector->string('comment'));
1665
1666 $nr_of_tries = $this->request_data_collector->int('nr_of_tries');
1667 if ($this->object->getSelfAssessmentEditingMode()) {
1668 $this->object->setNrOfTries($nr_of_tries);
1669 }
1670
1671 try {
1673 $this->request_data_collector->string('lifecycle')
1674 );
1675 $this->object->setLifecycle($lifecycle);
1677 }
1678
1679 $this->object->setQuestion(
1681 $this->request_data_collector->string('question')
1682 )
1683 );
1684
1686 }
static stripOnlySlashes(string $a_str)

References Vendor\Package\$e, $lifecycle, 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_factory

ilComponentFactory assQuestionGUI::$component_factory
private

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

◆ $copy_to_existing_pool_on_save

int assQuestionGUI::$copy_to_existing_pool_on_save = null
private

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

◆ $copy_to_new_pool_on_save

string assQuestionGUI::$copy_to_new_pool_on_save = null
private

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

◆ $ctrl

ilCtrl assQuestionGUI::$ctrl
protected

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

◆ $current_user

ilObjUser assQuestionGUI::$current_user
private

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

◆ $editForm

ilPropertyFormGUI assQuestionGUI::$editForm = null
protected

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

◆ $error

assQuestionGUI::$error
protected

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

◆ $errormessage

string assQuestionGUI::$errormessage
protected

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

◆ $forms_helper

readonly ilTestLegacyFormsHelper assQuestionGUI::$forms_helper
protected

Definition at line 152 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 120 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 159 of file class.assQuestionGUI.php.

◆ $navigationGUI

ilTestQuestionNavigationGUI assQuestionGUI::$navigationGUI = null
private

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

◆ $notes_gui

GUIService assQuestionGUI::$notes_gui
protected

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

◆ $object

assQuestion assQuestionGUI::$object
protected

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

◆ $parent_type_is_lm

bool assQuestionGUI::$parent_type_is_lm = false
protected

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

◆ $presentationContext

string assQuestionGUI::$presentationContext = null
private

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

◆ $preview_session

ilAssQuestionPreviewSession assQuestionGUI::$preview_session = null
private

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

◆ $previousSolutionPrefilled

bool assQuestionGUI::$previousSolutionPrefilled = false
private

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

◆ $question_count

int assQuestionGUI::$question_count
protected

question count in test

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

◆ $question_sync_modal

string assQuestionGUI::$question_sync_modal = ''
private

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

◆ $questionActionCmd

string assQuestionGUI::$questionActionCmd = 'handleQuestionAction'
private

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

◆ $questionHeaderBlockBuilder

ilQuestionHeaderBlockBuilder assQuestionGUI::$questionHeaderBlockBuilder
private

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

◆ $questionrepository

GeneralQuestionPropertiesRepository assQuestionGUI::$questionrepository
protected

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

◆ $renderPurpose

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

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

◆ $request_data_collector

readonly RequestDataCollector assQuestionGUI::$request_data_collector
protected

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

◆ $sequence_no

int assQuestionGUI::$sequence_no
protected

sequence number in test

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

◆ $suggestedsolution_repo

SuggestedSolutionsDatabaseRepository assQuestionGUI::$suggestedsolution_repo = null
protected

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

◆ $taxonomyIds

assQuestionGUI::$taxonomyIds = []
private

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

◆ $tpl

ilGlobalPageTemplate assQuestionGUI::$tpl
protected

Definition at line 119 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: