ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
assQuestionGUI Class Reference

Basic GUI class for assessment questions. More...

+ Inheritance diagram for assQuestionGUI:
+ Collaboration diagram for assQuestionGUI:

Public Member Functions

 __construct ()
 assQuestionGUI constructor More...
 
 executeCommand ()
 execute command More...
 
 getCommand ($cmd)
 
 getType ()
 needed for page editor compliance More...
 
 getPresentationContext ()
 
 setPresentationContext ($presentationContext)
 
 isTestPresentationContext ()
 
 isPreviousSolutionPrefilled ()
 
 setPreviousSolutionPrefilled ($previousSolutionPrefilled)
 
 getRenderPurpose ()
 
 setRenderPurpose ($renderPurpose)
 
 isRenderPurposePrintPdf ()
 
 isRenderPurposePreview ()
 
 isRenderPurposeInputValue ()
 
 isRenderPurposePlayback ()
 
 isRenderPurposeDemoplay ()
 
 renderPurposeSupportsFormHtml ()
 
 getEditContext ()
 
 setEditContext ($editContext)
 
 isAuthoringEditContext ()
 
 isAdjustmentEditContext ()
 
 setAdjustmentEditContext ()
 
 getNavigationGUI ()
 
 setNavigationGUI ($navigationGUI)
 
 setTaxonomyIds ($taxonomyIds)
 
 getTaxonomyIds ()
 
 setTargetGui ($linkTargetGui)
 
 setTargetGuiClass ($targetGuiClass)
 
 getTargetGuiClass ()
 
 setQuestionHeaderBlockBuilder ($questionHeaderBlockBuilder)
 
 getQuestionHeaderBlockBuilder ()
 
 setQuestionActionCmd ($questionActionCmd)
 
 getQuestionActionCmd ()
 
createQuestionGUI ($question_type, $question_id=-1)
 Creates a question gui representation. More...
 
 populateJavascriptFilesRequiredForWorkForm (ilTemplate $tpl)
 
 getQuestionTemplate ()
 get question template More...
 
 getILIASPage ($html="")
 Returns the ILIAS Page around a question. More...
 
 outQuestionPage ($a_temp_var, $a_postponed=false, $active_id="", $html="")
 output question page More...
 
 cancel ()
 cancel action More...
 
 originalSyncForm ($return_to="", $return_to_feedback='')
 
 sync ()
 
 cancelSync ()
 
 saveEdit ()
 save question More...
 
 save ()
 save question More...
 
 saveReturn ()
 save question More...
 
 apply ()
 apply changes More...
 
 getContextPath ($cont_obj, $a_endnode_id, $a_startnode_id=1)
 get context path in content object tree More...
 
 setSequenceNumber ($nr)
 
 getSequenceNumber ()
 
 setQuestionCount ($a_question_count)
 
 getQuestionCount ()
 
 getErrorMessage ()
 
 setErrorMessage ($errormessage)
 
 addErrorMessage ($errormessage)
 
 outAdditionalOutput ()
 
 getQuestionType ()
 Returns the question type string. More...
 
 getAsValueAttribute ($a_value)
 Returns a HTML value attribute. More...
 
 addNewIdListener (&$a_object, $a_method, $a_parameters="")
 Add a listener that is notified with the new question ID, when a new question is saved. More...
 
 callNewIdListeners ($a_new_id)
 Call the new id listeners. More...
 
 addQuestionFormCommandButtons ($form)
 Add the command buttons of a question properties form. More...
 
 addBasicQuestionFormProperties ($form)
 Add basic question form properties: assessment: title, author, description, question, working time. More...
 
 getAnswerFeedbackOutput ($active_id, $pass)
 Returns the answer generic feedback depending on the results of the question. More...
 
 getGenericFeedbackOutput ($active_id, $pass)
 Returns the answer specific feedback for the question. More...
 
 getGenericFeedbackOutputForCorrectSolution ()
 
 getGenericFeedbackOutputForIncorrectSolution ()
 
 getSpecificFeedbackOutput ($active_id, $pass)
 Returns the answer specific feedback for the question. More...
 
 outQuestionType ()
 
 showSuggestedSolution ()
 
 suggestedsolution ()
 Allows to add suggested solutions for questions. More...
 
 outSolutionExplorer ()
 
 saveSuggestedSolution ()
 
 cancelExplorer ()
 
 outPageSelector ()
 
 outChapterSelector ()
 
 outGlossarySelector ()
 
 linkChilds ()
 
 addPG ()
 
 addST ()
 
 addGIT ()
 
 isSaveCommand ()
 
 setQuestionTabs ()
 
 addTab_SuggestedSolution (ilTabsGUI $tabs, $classname)
 
 getEditQuestionTabCommands ()
 
 getSolutionOutput ( $active_id, $pass=null, $graphicalOutput=false, $result_output=false, $show_question_only=true, $show_feedback=false, $show_correct_solution=false, $show_manual_scoring=false, $show_question_text=true)
 
 isAutosaveable ()
 
 getPreview ($show_question_only=false, $showInlineFeedback=false)
 
 outQuestionForTest ( $formaction, $active_id, $pass, $is_question_postponed=false, $user_post_solutions=false, $show_specific_inline_feedback=false)
 
 magicAfterTestOutput ()
 
 getTestOutput ( $active_id, $pass, $is_question_postponed, $user_post_solutions, $show_specific_inline_feedback)
 
 getFormEncodingType ()
 
 setPreviewSession ($previewSession)
 
 getPreviewSession ()
 
 showHints ()
 

Static Public Member Functions

static _getQuestionGUI ($question_type, $question_id=-1)
 Creates a question gui representation and returns the alias to the question gui note: please do not use $this inside this method to allow static calls. More...
 
static _getGUIClassNameForId ($a_q_id)
 
static _getClassNameForQType ($q_type)
 
static getCommandsFromClassConstants ($guiClassName, $cmdConstantNameBegin='CMD_')
 extracts values of all constants of given class with given prefix as array can be used to get all possible commands in case of these commands are defined as constants More...
 

Data Fields

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 SESSION_PREVIEW_DATA_BASE_INDEX = 'ilAssQuestionPreviewAnswers'
 
 $object
 
 $tpl
 
 $lng
 
 $error
 
 $errormessage
 
 $sequence_no
 sequence number in test More...
 
 $question_count
 question count in test More...
 
const PRESENTATION_CONTEXT_TEST = 'pContextTest'
 
const PRESENTATION_CONTEXT_RESULTS = 'pContextResults'
 
const RENDER_PURPOSE_PLAYBACK = 'renderPurposePlayback'
 
const RENDER_PURPOSE_DEMOPLAY = 'renderPurposeDemoplay'
 
const RENDER_PURPOSE_PREVIEW = 'renderPurposePreview'
 
const RENDER_PURPOSE_PRINT_PDF = 'renderPurposePrintPdf'
 
const RENDER_PURPOSE_INPUT_VALUE = 'renderPurposeInputValue'
 
const EDIT_CONTEXT_AUTHORING = 'authoring'
 
const EDIT_CONTEXT_ADJUSTMENT = 'adjustment'
 

Protected Member Functions

 writePostData ($always=false)
 Evaluates a posted edit form and writes the form data in the question object. More...
 
 renderEditForm ($form)
 
 getUseUnchangedAnswerCheckboxHtml ()
 
 getPreviousSolutionProvidedMessage ()
 
 getPreviousSolutionConfirmationCheckboxHtml ()
 
 saveTaxonomyAssignments ()
 
 populateTaxonomyFormSection (ilPropertyFormGUI $form)
 
 getBasicEditQuestionTabCommands ()
 
 getAdditionalEditQuestionCommands ()
 
 addTab_QuestionFeedback (ilTabsGUI $tabs)
 adds the feedback tab to ilTabsGUI More...
 
 addTab_QuestionHints (ilTabsGUI $tabs)
 adds the hints tab to ilTabsGUI More...
 
 addTab_QuestionPreview (ilTabsGUI $tabsGUI)
 
 hasCorrectSolution ($activeId, $passIndex)
 
 writeQuestionGenericPostData ()
 
 completeTestOutputFormAction ($formAction, $active_id, $pass)
 
 addBackTab (ilTabsGUI $ilTabs)
 
 buildBasicEditFormObject ()
 
 buildEditForm ()
 

Protected Attributes

 $editForm
 

Private Attributes

 $taxonomyIds = array()
 
 $targetGuiClass = null
 
 $questionActionCmd = 'handleQuestionAction'
 
 $questionHeaderBlockBuilder
 
 $navigationGUI
 
 $presentationContext = null
 
 $renderPurpose = self::RENDER_PURPOSE_PLAYBACK
 
 $editContext = self::EDIT_CONTEXT_AUTHORING
 
 $previousSolutionPrefilled = false
 
 $previewSession
 

Detailed Description

Basic GUI class for assessment questions.

The assQuestionGUI class encapsulates basic GUI functions for assessment questions.

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

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

Constructor & Destructor Documentation

◆ __construct()

assQuestionGUI::__construct ( )

assQuestionGUI constructor

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

112 {
113 global $lng, $tpl, $ilCtrl;
114
115 $this->lng =&$lng;
116 $this->tpl =&$tpl;
117 $this->ctrl =&$ilCtrl;
118 $this->ctrl->saveParameter($this, "q_id");
119 $this->ctrl->saveParameter($this, "prev_qid");
120 $this->ctrl->saveParameter($this, "calling_test");
121 $this->ctrl->saveParameter($this, "calling_consumer");
122 $this->ctrl->saveParameter($this, "consumer_context");
123 $this->ctrl->saveParameterByClass('ilAssQuestionPageGUI', 'test_express_mode');
124 $this->ctrl->saveParameterByClass('ilAssQuestionPageGUI', 'calling_consumer');
125 $this->ctrl->saveParameterByClass('ilAssQuestionPageGUI', 'consumer_context');
126 $this->ctrl->saveParameterByClass('ilobjquestionpoolgui', 'test_express_mode');
127 $this->ctrl->saveParameterByClass('ilobjquestionpoolgui', 'calling_consumer');
128 $this->ctrl->saveParameterByClass('ilobjquestionpoolgui', 'consumer_context');
129
130 include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
131 $this->errormessage = $this->lng->txt("fill_out_all_required_fields");
132
133 $this->selfassessmenteditingmode = false;
134 $this->new_id_listeners = array();
135 $this->new_id_listener_cnt = 0;
136
137 $this->navigationGUI = null;
138 }
global $ilCtrl
Definition: ilias.php:18

References $ilCtrl, $lng, and $tpl.

Member Function Documentation

◆ _getClassNameForQType()

static assQuestionGUI::_getClassNameForQType (   $q_type)
static
Deprecated:

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

471 {
472 return $q_type . "GUI";
473 }

Referenced by _getGUIClassNameForId().

+ Here is the caller graph for this function:

◆ _getGUIClassNameForId()

static assQuestionGUI::_getGUIClassNameForId (   $a_q_id)
static
Deprecated:

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

459 {
460 include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
461 include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
462 $q_type = assQuestion::getQuestionTypeFromDb($a_q_id);
463 $class_name = assQuestionGUI::_getClassNameForQType($q_type);
464 return $class_name;
465 }
static _getClassNameForQType($q_type)
static getQuestionTypeFromDb($question_id)
get question type for question id

References _getClassNameForQType(), and assQuestion\getQuestionTypeFromDb().

Referenced by ilQuestionBrowserTableGUI\fillRow().

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

◆ _getQuestionGUI()

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

Creates a question gui representation and returns the alias to the question gui note: please do not use $this inside this method to allow static calls.

Parameters
string$question_typeThe question type as it is used in the language database
integer$question_idThe database ID of an existing question to load it into assQuestionGUI
Returns
assQuestionGUI The alias to the question object

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

427 {
428 global $ilCtrl, $ilDB, $lng;
429
430 include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
431
432 if ((!$question_type) and ($question_id > 0)) {
433 $question_type = assQuestion::getQuestionTypeFromDb($question_id);
434 }
435
436 if (strlen($question_type) == 0) {
437 return null;
438 }
439
440 assQuestion::_includeClass($question_type, 1);
441
442 $question_type_gui = assQuestion::getGuiClassNameByQuestionType($question_type);
443 $question = new $question_type_gui();
444
445 $feedbackObjectClassname = assQuestion::getFeedbackClassNameByQuestionType($question_type);
446 $question->object->feedbackOBJ = new $feedbackObjectClassname($question->object, $ilCtrl, $ilDB, $lng);
447
448 if ($question_id > 0) {
449 $question->object->loadFromDb($question_id);
450 }
451
452 return $question;
453 }
static getFeedbackClassNameByQuestionType($questionType)
static getGuiClassNameByQuestionType($questionType)
static _includeClass($question_type, $gui=0)
Include the php class file for a given question type.
global $ilDB

References $ilCtrl, $ilDB, $lng, assQuestion\_includeClass(), assQuestion\getFeedbackClassNameByQuestionType(), assQuestion\getGuiClassNameByQuestionType(), and assQuestion\getQuestionTypeFromDb().

Referenced by ilObjQuestionPoolGUI\addLocatorItems(), ilTestExpressPageObjectGUI\addPageOfQuestions(), ilObjQuestionPoolGUI\createQuestionForTestObject(), createQuestionGUI(), ilObjQuestionPoolGUI\createQuestionObject(), ilPCQuestionGUI\edit(), ilObjQuestionPoolGUI\editQuestionForTestObject(), ilObjTestGUI\executeCommand(), ilTestExpressPageObjectGUI\executeCommand(), ilObjQuestionPoolGUI\executeCommand(), ilQuestionEditGUI\executeCommand(), ilPageObjectGUI\executeCommand(), ilSCORM2004Asset\exportHTMLPageObjects(), ilQuestionExporter\exportQuestion(), ilObjAssessmentFolder\fetchScoringAdjustableTypes(), ilSCORM2004PageGUI\getQuestionHtmlOfPage(), ilTestExpressPageObjectGUI\handleToolbarCommand(), ilPCQuestion\modifyPageContentPostXsl(), ilAssQuestionSkillAssignmentsGUI\saveSkillQuestionAssignmentPropertiesFormCmd(), ilObjQuestionPoolGUI\setTitleAndDescription(), and ilAssQuestionSkillAssignmentsGUI\showSkillQuestionAssignmentPropertiesFormCmd().

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

◆ addBackTab()

assQuestionGUI::addBackTab ( ilTabsGUI  $ilTabs)
protected
Parameters
ilTabsGUI$ilTabs

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

2104 {
2105 if (($_GET["calling_test"] > 0) || ($_GET["test_ref_id"] > 0)) {
2106 $ref_id = $_GET["calling_test"];
2107 if (strlen($ref_id) == 0) {
2108 $ref_id = $_GET["test_ref_id"];
2109 }
2110
2111 if (!$_GET['test_express_mode'] && !$GLOBALS['___test_express_mode']) {
2112 $ilTabs->setBackTarget($this->lng->txt("backtocallingtest"), "ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=$ref_id");
2113 } else {
2115 $ilTabs->setBackTarget($this->lng->txt("backtocallingtest"), $link);
2116 }
2117 } elseif (isset($_GET['calling_consumer']) && (int) $_GET['calling_consumer']) {
2118 $ref_id = (int) $_GET['calling_consumer'];
2121 $ilTabs->setBackTarget($consumer->getQuestionEditingFormBackTargetLabel(), $consumer->getQuestionEditingFormBackTarget($_GET['consumer_context']));
2122 } else {
2123 require_once 'Services/Link/classes/class.ilLink.php';
2124 $ilTabs->setBackTarget($this->lng->txt("qpl"), ilLink::_getLink($ref_id));
2125 }
2126 } else {
2127 $ilTabs->setBackTarget($this->lng->txt("qpl"), $this->ctrl->getLinkTargetByClass("ilobjquestionpoolgui", "questions"));
2128 }
2129 }
$_GET["client_id"]
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
setBackTarget($a_title, $a_target, $a_frame="")
back target for upper context
static getReturnToPageLink($q_id=null)
$consumer
Definition: demo.php:30
$GLOBALS['loaded']
Global hash that tracks already loaded includes.

References $_GET, $consumer, $GLOBALS, ilLink\_getLink(), ilObjectFactory\getInstanceByRefId(), ilTestExpressPage\getReturnToPageLink(), and ilTabsGUI\setBackTarget().

Referenced by assClozeTestGUI\setQuestionTabs(), assErrorTextGUI\setQuestionTabs(), assFlashQuestionGUI\setQuestionTabs(), assFormulaQuestionGUI\setQuestionTabs(), assImagemapQuestionGUI\setQuestionTabs(), assJavaAppletGUI\setQuestionTabs(), assLongMenuGUI\setQuestionTabs(), assMatchingQuestionGUI\setQuestionTabs(), assMultipleChoiceGUI\setQuestionTabs(), assOrderingHorizontalGUI\setQuestionTabs(), assOrderingQuestionGUI\setQuestionTabs(), setQuestionTabs(), assSingleChoiceGUI\setQuestionTabs(), assTextQuestionGUI\setQuestionTabs(), and assTextSubsetGUI\setQuestionTabs().

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

◆ addBasicQuestionFormProperties()

assQuestionGUI::addBasicQuestionFormProperties (   $form)

Add basic question form properties: assessment: title, author, description, question, working time.

Returns
int Default Nr of Tries

Reimplemented in assClozeTestGUI, and assMultipleChoiceGUI.

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

1095 {
1096 // title
1097 $title = new ilTextInputGUI($this->lng->txt("title"), "title");
1098 $title->setMaxLength(100);
1099 $title->setValue($this->object->getTitle());
1100 $title->setRequired(true);
1101 $form->addItem($title);
1102
1103 if (!$this->object->getSelfAssessmentEditingMode()) {
1104 // author
1105 $author = new ilTextInputGUI($this->lng->txt("author"), "author");
1106 $author->setValue($this->object->getAuthor());
1107 $author->setRequired(true);
1108 $form->addItem($author);
1109
1110 // description
1111 $description = new ilTextInputGUI($this->lng->txt("description"), "comment");
1112 $description->setValue($this->object->getComment());
1113 $description->setRequired(false);
1114 $form->addItem($description);
1115 } else {
1116 // author as hidden field
1117 $hi = new ilHiddenInputGUI("author");
1118 $author = ilUtil::prepareFormOutput($this->object->getAuthor());
1119 if (trim($author) == "") {
1120 $author = "-";
1121 }
1122 $hi->setValue($author);
1123 $form->addItem($hi);
1124 }
1125
1126 // questiontext
1127 $question = new ilTextAreaInputGUI($this->lng->txt("question"), "question");
1128 $question->setValue($this->object->getQuestion());
1129 $question->setRequired(true);
1130 $question->setRows(10);
1131 $question->setCols(80);
1132
1133 if (!$this->object->getSelfAssessmentEditingMode()) {
1134 if ($this->object->getAdditionalContentEditingMode() != assQuestion::ADDITIONAL_CONTENT_EDITING_MODE_PAGE_OBJECT) {
1135 $question->setUseRte(true);
1136 include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
1137 $question->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("assessment"));
1138 $question->addPlugin("latex");
1139 $question->addButton("latex");
1140 $question->addButton("pastelatex");
1141 $question->setRTESupport($this->object->getId(), "qpl", "assessment");
1142 }
1143 } else {
1144 require_once 'Modules/TestQuestionPool/classes/questions/class.ilAssSelfAssessmentQuestionFormatter.php';
1146 $question->setUseTagsForRteOnly(false);
1147 }
1148 $form->addItem($question);
1149
1150 if (!$this->object->getSelfAssessmentEditingMode()) {
1151 // duration
1152 $duration = new ilDurationInputGUI($this->lng->txt("working_time"), "Estimated");
1153 $duration->setShowHours(true);
1154 $duration->setShowMinutes(true);
1155 $duration->setShowSeconds(true);
1156 $ewt = $this->object->getEstimatedWorkingTime();
1157 $duration->setHours($ewt["h"]);
1158 $duration->setMinutes($ewt["m"]);
1159 $duration->setSeconds($ewt["s"]);
1160 $duration->setRequired(false);
1161 $form->addItem($duration);
1162 } else {
1163 // number of tries
1164 if (strlen($this->object->getNrOfTries())) {
1165 $nr_tries = $this->object->getNrOfTries();
1166 } else {
1167 $nr_tries = $this->object->getDefaultNrOfTries();
1168 }
1169 if ($nr_tries < 1) {
1170 $nr_tries = "";
1171 }
1172
1173 $ni = new ilNumberInputGUI($this->lng->txt("qst_nr_of_tries"), "nr_of_tries");
1174 $ni->setValue($nr_tries);
1175 $ni->setMinValue(0);
1176 $ni->setSize(5);
1177 $ni->setMaxLength(5);
1178 $form->addItem($ni);
1179 }
1180 }
const ADDITIONAL_CONTENT_EDITING_MODE_PAGE_OBJECT
constant for additional content editing mode "pageobject"
static getSelfAssessmentTags()
Get tags allowed in question tags in self assessment mode.
This class represents a duration (typical hh:mm:ss) property in a property form.
This class represents a hidden form property in a property form.
This class represents a number property in a property form.
static _getUsedHTMLTags($a_module="")
Returns an array of all allowed HTML tags for text editing.
This class represents a text area property in a property form.
This class represents a text property in a property form.
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms @access public
if(isset($_POST['submit'])) $form

References $description, $form, $title, ilObjAdvancedEditing\_getUsedHTMLTags(), assQuestion\ADDITIONAL_CONTENT_EDITING_MODE_PAGE_OBJECT, ilAssSelfAssessmentQuestionFormatter\getSelfAssessmentTags(), and ilUtil\prepareFormOutput().

Referenced by assImagemapQuestionGUI\buildEditForm(), assKprimChoiceGUI\buildEditForm(), assLongMenuGUI\buildEditForm(), assOrderingQuestionGUI\buildEditForm(), assErrorTextGUI\editQuestion(), assFileUploadGUI\editQuestion(), assFlashQuestionGUI\editQuestion(), assJavaAppletGUI\editQuestion(), assMatchingQuestionGUI\editQuestion(), assNumericGUI\editQuestion(), assOrderingHorizontalGUI\editQuestion(), assSingleChoiceGUI\editQuestion(), assTextQuestionGUI\editQuestion(), and assTextSubsetGUI\editQuestion().

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

◆ addErrorMessage()

assQuestionGUI::addErrorMessage (   $errormessage)

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

1007 {
1008 $this->errormessage .= ((strlen($this->errormessage)) ? "<br />" : "") . $errormessage;
1009 }

References $errormessage.

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

+ Here is the caller graph for this function:

◆ addGIT()

assQuestionGUI::addGIT ( )

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

1775 {
1776 $subquestion_index = 0;
1777 if (strlen($_GET["subquestion_index"]) && $_GET["subquestion_index"] >= 0) {
1778 $subquestion_index = $_GET["subquestion_index"];
1779 }
1780 $this->object->saveSuggestedSolution("git", "il__git_" . $_GET["git"], $subquestion_index);
1781 ilUtil::sendSuccess($this->lng->txt("suggested_solution_added_successfully"), true);
1782 $this->ctrl->redirect($this, "suggestedsolution");
1783 }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.

References $_GET, and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ addNewIdListener()

assQuestionGUI::addNewIdListener ( $a_object,
  $a_method,
  $a_parameters = "" 
)

Add a listener that is notified with the new question ID, when a new question is saved.

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

1050 {
1051 $cnt = $this->new_id_listener_cnt;
1052 $this->new_id_listeners[$cnt]["object"] =&$a_object;
1053 $this->new_id_listeners[$cnt]["method"] = $a_method;
1054 $this->new_id_listeners[$cnt]["parameters"] = $a_parameters;
1055 $this->new_id_listener_cnt++;
1056 }

◆ addPG()

assQuestionGUI::addPG ( )

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

1753 {
1754 $subquestion_index = 0;
1755 if (strlen($_GET["subquestion_index"]) && $_GET["subquestion_index"] >= 0) {
1756 $subquestion_index = $_GET["subquestion_index"];
1757 }
1758 $this->object->saveSuggestedSolution("pg", "il__pg_" . $_GET["pg"], $subquestion_index);
1759 ilUtil::sendSuccess($this->lng->txt("suggested_solution_added_successfully"), true);
1760 $this->ctrl->redirect($this, "suggestedsolution");
1761 }

References $_GET, and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ addQuestionFormCommandButtons()

assQuestionGUI::addQuestionFormCommandButtons (   $form)

Add the command buttons of a question properties form.

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

1080 {
1081 //if (!$this->object->getSelfAssessmentEditingMode() && !$_GET["calling_test"]) $form->addCommandButton("saveEdit", $this->lng->txt("save_edit"));
1082 if (!$this->object->getSelfAssessmentEditingMode()) {
1083 $form->addCommandButton("saveReturn", $this->lng->txt("save_return"));
1084 }
1085 $form->addCommandButton("save", $this->lng->txt("save"));
1086 }

References $form.

Referenced by assImagemapQuestionGUI\buildEditForm(), assKprimChoiceGUI\buildEditForm(), assLongMenuGUI\buildEditForm(), assMultipleChoiceGUI\buildEditForm(), assClozeTestGUI\editQuestion(), assErrorTextGUI\editQuestion(), assFileUploadGUI\editQuestion(), assFlashQuestionGUI\editQuestion(), assJavaAppletGUI\editQuestion(), assMatchingQuestionGUI\editQuestion(), assNumericGUI\editQuestion(), assOrderingHorizontalGUI\editQuestion(), assSingleChoiceGUI\editQuestion(), assTextQuestionGUI\editQuestion(), and assTextSubsetGUI\editQuestion().

+ Here is the caller graph for this function:

◆ addST()

assQuestionGUI::addST ( )

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

1764 {
1765 $subquestion_index = 0;
1766 if (strlen($_GET["subquestion_index"]) && $_GET["subquestion_index"] >= 0) {
1767 $subquestion_index = $_GET["subquestion_index"];
1768 }
1769 $this->object->saveSuggestedSolution("st", "il__st_" . $_GET["st"], $subquestion_index);
1770 ilUtil::sendSuccess($this->lng->txt("suggested_solution_added_successfully"), true);
1771 $this->ctrl->redirect($this, "suggestedsolution");
1772 }

References $_GET, and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ addTab_QuestionFeedback()

assQuestionGUI::addTab_QuestionFeedback ( ilTabsGUI  $tabs)
protected

adds the feedback tab to ilTabsGUI

@global ilCtrl $ilCtrl

Parameters
ilTabsGUI$tabs

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

1926 {
1927 global $ilCtrl;
1928
1929 require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionFeedbackEditingGUI.php';
1930 $tabCommands = self::getCommandsFromClassConstants('ilAssQuestionFeedbackEditingGUI');
1931
1932 $tabLink = $ilCtrl->getLinkTargetByClass('ilAssQuestionFeedbackEditingGUI', ilAssQuestionFeedbackEditingGUI::CMD_SHOW);
1933
1934 $tabs->addTarget('tst_feedback', $tabLink, $tabCommands, $ilCtrl->getCmdClass(), '');
1935 }
static getCommandsFromClassConstants($guiClassName, $cmdConstantNameBegin='CMD_')
extracts values of all constants of given class with given prefix as array can be used to get all pos...
if(!empty($this->data['faventry'])) $tabs
Definition: disco.tpl.php:124

References $ilCtrl, $tabs, ilAssQuestionFeedbackEditingGUI\CMD_SHOW, and getCommandsFromClassConstants().

Referenced by assClozeTestGUI\setQuestionTabs(), assErrorTextGUI\setQuestionTabs(), assFileUploadGUI\setQuestionTabs(), assFlashQuestionGUI\setQuestionTabs(), assFormulaQuestionGUI\setQuestionTabs(), assImagemapQuestionGUI\setQuestionTabs(), assJavaAppletGUI\setQuestionTabs(), assLongMenuGUI\setQuestionTabs(), assMatchingQuestionGUI\setQuestionTabs(), assMultipleChoiceGUI\setQuestionTabs(), assOrderingHorizontalGUI\setQuestionTabs(), assOrderingQuestionGUI\setQuestionTabs(), setQuestionTabs(), assSingleChoiceGUI\setQuestionTabs(), assTextQuestionGUI\setQuestionTabs(), and assTextSubsetGUI\setQuestionTabs().

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

◆ addTab_QuestionHints()

assQuestionGUI::addTab_QuestionHints ( ilTabsGUI  $tabs)
protected

adds the hints tab to ilTabsGUI

@global ilCtrl $ilCtrl

Parameters
ilTabsGUI$tabs

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

1957 {
1958 global $ilCtrl;
1959
1960 require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintsGUI.php';
1961
1962 switch ($ilCtrl->getCmdClass()) {
1963 case 'ilassquestionhintsgui':
1964
1965 $tabCommands = self::getCommandsFromClassConstants('ilAssQuestionHintsGUI');
1966 break;
1967
1968 case 'ilassquestionhintgui':
1969
1970 require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintGUI.php';
1971 $tabCommands = self::getCommandsFromClassConstants('ilAssQuestionHintGUI');
1972 break;
1973
1974 default:
1975
1976 $tabCommands = array();
1977 }
1978
1979 $tabLink = $ilCtrl->getLinkTargetByClass('ilAssQuestionHintsGUI', ilAssQuestionHintsGUI::CMD_SHOW_LIST);
1980
1981 $tabs->addTarget('tst_question_hints_tab', $tabLink, $tabCommands, $ilCtrl->getCmdClass(), '');
1982 }
const CMD_SHOW_LIST
command constants

References $ilCtrl, $tabs, ilAssQuestionHintsGUI\CMD_SHOW_LIST, and getCommandsFromClassConstants().

Referenced by assClozeTestGUI\setQuestionTabs(), assErrorTextGUI\setQuestionTabs(), assFileUploadGUI\setQuestionTabs(), assFlashQuestionGUI\setQuestionTabs(), assFormulaQuestionGUI\setQuestionTabs(), assImagemapQuestionGUI\setQuestionTabs(), assJavaAppletGUI\setQuestionTabs(), assLongMenuGUI\setQuestionTabs(), assMatchingQuestionGUI\setQuestionTabs(), assMultipleChoiceGUI\setQuestionTabs(), assOrderingHorizontalGUI\setQuestionTabs(), assOrderingQuestionGUI\setQuestionTabs(), setQuestionTabs(), assSingleChoiceGUI\setQuestionTabs(), assTextQuestionGUI\setQuestionTabs(), and assTextSubsetGUI\setQuestionTabs().

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

◆ addTab_QuestionPreview()

assQuestionGUI::addTab_QuestionPreview ( ilTabsGUI  $tabsGUI)
protected

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

1985 {
1986 require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionPreviewGUI.php';
1987
1988 $tabsGUI->addTarget(
1990 $this->ctrl->getLinkTargetByClass('ilAssQuestionPreviewGUI', ilAssQuestionPreviewGUI::CMD_SHOW),
1991 array(),
1992 array('ilAssQuestionPreviewGUI')
1993 );
1994 }
addTarget( $a_text, $a_link, $a_cmd="", $a_cmdClass="", $a_frame="", $a_activate=false, $a_dir_text=false)

References ilTabsGUI\addTarget(), ilAssQuestionPreviewGUI\CMD_SHOW, and ilAssQuestionPreviewGUI\TAB_ID_QUESTION_PREVIEW.

Referenced by assClozeTestGUI\setQuestionTabs(), assErrorTextGUI\setQuestionTabs(), assFileUploadGUI\setQuestionTabs(), assFlashQuestionGUI\setQuestionTabs(), assFormulaQuestionGUI\setQuestionTabs(), assImagemapQuestionGUI\setQuestionTabs(), assJavaAppletGUI\setQuestionTabs(), assLongMenuGUI\setQuestionTabs(), assMatchingQuestionGUI\setQuestionTabs(), assMultipleChoiceGUI\setQuestionTabs(), assOrderingHorizontalGUI\setQuestionTabs(), assOrderingQuestionGUI\setQuestionTabs(), setQuestionTabs(), assSingleChoiceGUI\setQuestionTabs(), assTextQuestionGUI\setQuestionTabs(), and assTextSubsetGUI\setQuestionTabs().

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

◆ addTab_SuggestedSolution()

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

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

1890 {
1891 if ($_GET["q_id"]) {
1892 $tabs->addTarget(
1893 "suggested_solution",
1894 $this->ctrl->getLinkTargetByClass($classname, "suggestedsolution"),
1895 array("suggestedsolution", "saveSuggestedSolution", "outSolutionExplorer", "cancel",
1896 "addSuggestedSolution","cancelExplorer", "linkChilds", "removeSuggestedSolution"
1897 ),
1898 $classname,
1899 ""
1900 );
1901 }
1902 }

References $_GET, and $tabs.

Referenced by assClozeTestGUI\setQuestionTabs(), assErrorTextGUI\setQuestionTabs(), assFileUploadGUI\setQuestionTabs(), assFlashQuestionGUI\setQuestionTabs(), assImagemapQuestionGUI\setQuestionTabs(), assJavaAppletGUI\setQuestionTabs(), assLongMenuGUI\setQuestionTabs(), assMatchingQuestionGUI\setQuestionTabs(), assMultipleChoiceGUI\setQuestionTabs(), assOrderingHorizontalGUI\setQuestionTabs(), assOrderingQuestionGUI\setQuestionTabs(), setQuestionTabs(), assSingleChoiceGUI\setQuestionTabs(), assTextQuestionGUI\setQuestionTabs(), and assTextSubsetGUI\setQuestionTabs().

+ Here is the caller graph for this function:

◆ apply()

assQuestionGUI::apply ( )

apply changes

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

945 {
946 $this->writePostData();
947 $this->object->saveToDb();
948 $this->ctrl->setParameter($this, "q_id", $this->object->getId());
949 $this->editQuestion();
950 }
writePostData($always=false)
Evaluates a posted edit form and writes the form data in the question object.

References writePostData().

+ Here is the call graph for this function:

◆ buildBasicEditFormObject()

assQuestionGUI::buildBasicEditFormObject ( )
protected
Returns
ilPropertyFormGUI

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

2156 {
2157 require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
2158 $form = new ilPropertyFormGUI();
2159
2160 $form->setFormAction($this->ctrl->getFormAction($this));
2161
2162 $form->setId($this->getType());
2163 $form->setTitle($this->outQuestionType());
2164
2165 $form->setTableWidth('100%');
2166
2167 $form->setMultipart(true);
2168
2169 return $form;
2170 }
getType()
needed for page editor compliance
This class represents a property form user interface.

References $form, getType(), and outQuestionType().

Referenced by assImagemapQuestionGUI\buildEditForm(), assKprimChoiceGUI\buildEditForm(), and assLongMenuGUI\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, assMultipleChoiceGUI, and assOrderingQuestionGUI.

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

2182 {
2183 $errors = $this->editQuestion(true); // TODO bheyser: editQuestion should be added to the abstract base class with a unified signature
2184 return $this->editForm;
2185 }
$errors
Definition: index.php:6

References $editForm, and $errors.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ callNewIdListeners()

assQuestionGUI::callNewIdListeners (   $a_new_id)

Call the new id listeners.

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

1062 {
1063 for ($i=0; $i<$this->new_id_listener_cnt; $i++) {
1064 $this->new_id_listeners[$i]["parameters"]["new_id"] = $a_new_id;
1065 $object =&$this->new_id_listeners[$i]["object"];
1066 $method = $this->new_id_listeners[$i]["method"];
1067 $parameters = $this->new_id_listeners[$i]["parameters"];
1068 //var_dump($object);
1069 //var_dump($method);
1070 //var_dump($parameters);
1071
1072 $object->$method($parameters);
1073 }
1074 }
$i
Definition: disco.tpl.php:19

References $i, and $object.

Referenced by save(), saveReturn(), and assFormulaQuestionGUI\saveReturnFQ().

+ Here is the caller graph for this function:

◆ cancel()

assQuestionGUI::cancel ( )

cancel action

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

621 {
622 if ($_GET["calling_test"]) {
623 $_GET["ref_id"] = $_GET["calling_test"];
624 ilUtil::redirect("ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=" . $_GET["calling_test"]);
625 } elseif ($_GET["test_ref_id"]) {
626 $_GET["ref_id"] = $_GET["test_ref_id"];
627 ilUtil::redirect("ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=" . $_GET["test_ref_id"]);
628 } else {
629 if ($_GET["q_id"] > 0) {
630 $this->ctrl->setParameterByClass("ilAssQuestionPageGUI", "q_id", $_GET["q_id"]);
631 $this->ctrl->redirectByClass("ilAssQuestionPageGUI", "edit");
632 } else {
633 $this->ctrl->redirectByClass("ilobjquestionpoolgui", "questions");
634 }
635 }
636 }
static redirect($a_script)

References $_GET, and ilUtil\redirect().

+ Here is the call graph for this function:

◆ cancelExplorer()

assQuestionGUI::cancelExplorer ( )

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

1605 {
1606 $this->ctrl->redirect($this, "suggestedsolution");
1607 }

◆ cancelSync()

assQuestionGUI::cancelSync ( )

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

695 {
696 if (strlen($_GET["return_to"])) {
697 $this->ctrl->redirect($this, $_GET["return_to"]);
698 }
699 if (strlen($_REQUEST['return_to_fb'])) {
700 $this->ctrl->redirectByClass('ilAssQuestionFeedbackEditingGUI', 'showFeedbackForm');
701 } else {
702 if (isset($_GET['calling_consumer']) && (int) $_GET['calling_consumer']) {
703 $ref_id = (int) $_GET['calling_consumer'];
706 ilUtil::redirect($consumer->getQuestionEditingFormBackTarget($_GET['consumer_context']));
707 }
708 require_once 'Services/Link/classes/class.ilLink.php';
710 }
711 $_GET["ref_id"] = $_GET["calling_test"];
712
713 if ($_REQUEST['test_express_mode']) {
715 } else {
716 ilUtil::redirect("ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=" . $_GET["calling_test"]);
717 }
718 }
719 }

References $_GET, $consumer, ilLink\_getLink(), ilObjectFactory\getInstanceByRefId(), ilTestExpressPage\getReturnToPageLink(), and ilUtil\redirect().

+ Here is the call graph for this function:

◆ completeTestOutputFormAction()

assQuestionGUI::completeTestOutputFormAction (   $formAction,
  $active_id,
  $pass 
)
protected

Reimplemented in assImagemapQuestionGUI.

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

2078 {
2079 return $formAction;
2080 }

Referenced by outQuestionForTest().

+ Here is the caller graph for this function:

◆ createQuestionGUI()

& assQuestionGUI::createQuestionGUI (   $question_type,
  $question_id = -1 
)

Creates a question gui representation.

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

Parameters
string$question_typeThe question type as it is used in the language database
integer$question_idThe database ID of an existing question to load it into assQuestionGUI
Returns
object The alias to the question object @access public
Deprecated:
: WTF is this? GUIobject::question should be a GUIobject !? WTF is a question alias !?

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

488 {
489 include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
490 $this->question =&assQuestionGUI::_getQuestionGUI($question_type, $question_id);
491 }
static _getQuestionGUI($question_type, $question_id=-1)
Creates a question gui representation and returns the alias to the question gui note: please do not u...

References _getQuestionGUI().

+ Here is the call graph for this function:

◆ executeCommand()

assQuestionGUI::executeCommand ( )

execute command

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

144 {
145 global $DIC; /* @var \ILIAS\DI\Container $DIC */
146 $ilHelp = $DIC['ilHelp']; /* @var ilHelpGUI $ilHelp */
147 $ilHelp->setScreenIdComponent('qpl');
148
149 $cmd = $this->ctrl->getCmd("editQuestion");
150 $next_class = $this->ctrl->getNextClass($this);
151
152 $cmd = $this->getCommand($cmd);
153
154 switch ($next_class) {
155 case 'ilformpropertydispatchgui':
156 $form = $this->buildEditForm();
157
158 require_once 'Services/Form/classes/class.ilFormPropertyDispatchGUI.php';
159 $form_prop_dispatch = new ilFormPropertyDispatchGUI();
160 $form_prop_dispatch->setItem($form->getItemByPostVar(ilUtil::stripSlashes($_GET['postvar'])));
161 return $this->ctrl->forwardCommand($form_prop_dispatch);
162 break;
163
164 default:
165 $ret = $this->$cmd();
166 break;
167 }
168 return $ret;
169 }
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$ret
Definition: parser.php:6
global $DIC
Definition: saml.php:7

References $_GET, $DIC, $form, $ret, buildEditForm(), getCommand(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ getAdditionalEditQuestionCommands()

assQuestionGUI::getAdditionalEditQuestionCommands ( )
protected

Reimplemented in assKprimChoiceGUI.

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

1915 {
1916 return array();
1917 }

Referenced by getEditQuestionTabCommands().

+ Here is the caller graph for this function:

◆ getAnswerFeedbackOutput()

assQuestionGUI::getAnswerFeedbackOutput (   $active_id,
  $pass 
)

Returns the answer generic feedback depending on the results of the question.

Deprecated:
Use getGenericFeedbackOutput instead.
Parameters
integer$active_idActive ID of the user
integer$passActive pass
Returns
string HTML Code with the answer specific feedback @access public

Reimplemented in assClozeTestGUI.

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

1240 {
1241 return $this->getGenericFeedbackOutput($active_id, $pass);
1242 }
getGenericFeedbackOutput($active_id, $pass)
Returns the answer specific feedback for the question.

References $pass, and getGenericFeedbackOutput().

Referenced by assFileUploadGUI\getSolutionOutput(), assImagemapQuestionGUI\getSolutionOutput(), assJavaAppletGUI\getSolutionOutput(), assMultipleChoiceGUI\getSolutionOutput(), assSingleChoiceGUI\getSolutionOutput(), and assTextSubsetGUI\getSolutionOutput().

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

◆ getAsValueAttribute()

assQuestionGUI::getAsValueAttribute (   $a_value)

Returns a HTML value attribute.

Parameters
mixed$a_valueA given text or value
Returns
string The value as HTML value attribute @access public

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

1036 {
1037 $result = "";
1038 if (strlen($a_value)) {
1039 $result = " value=\"$a_value\" ";
1040 }
1041 return $result;
1042 }
$result

References $result.

◆ getBasicEditQuestionTabCommands()

assQuestionGUI::getBasicEditQuestionTabCommands ( )
protected

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

1910 {
1911 return array('editQuestion', 'save', 'saveEdit', 'originalSyncForm');
1912 }

Referenced by getEditQuestionTabCommands().

+ Here is the caller graph for this function:

◆ getCommand()

assQuestionGUI::getCommand (   $cmd)

Reimplemented in assClozeTestGUI, assFlashQuestionGUI, assFormulaQuestionGUI, assImagemapQuestionGUI, assJavaAppletGUI, assLongMenuGUI, assNumericGUI, and assOrderingHorizontalGUI.

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

172 {
173 return $cmd;
174 }

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ getCommandsFromClassConstants()

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

extracts values of all constants of given class with given prefix as array can be used to get all possible commands in case of these commands are defined as constants

Parameters
string$guiClassName
string$cmdConstantNameBegin
Returns
array

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

1799 {
1800 $reflectionClass = new ReflectionClass($guiClassName);
1801
1802 $commands = null;
1803
1804 if ($reflectionClass instanceof ReflectionClass) {
1805 $commands = array();
1806
1807 foreach ($reflectionClass->getConstants() as $constName => $constValue) {
1808 if (substr($constName, 0, strlen($cmdConstantNameBegin)) == $cmdConstantNameBegin) {
1809 $commands[] = $constValue;
1810 }
1811 }
1812 }
1813
1814 return $commands;
1815 }

Referenced by addTab_QuestionFeedback(), addTab_QuestionHints(), and ilPCQuestionGUI\setTabs().

+ Here is the caller graph for this function:

◆ getContextPath()

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

get context path in content object tree

Parameters
int$a_endnode_idid of endnode
int$a_startnode_idid of startnode

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

959 {
960 $path = "";
961
962 $tmpPath = $cont_obj->getLMTree()->getPathFull($a_endnode_id, $a_startnode_id);
963
964 // count -1, to exclude the learning module itself
965 for ($i = 1; $i < (count($tmpPath) - 1); $i++) {
966 if ($path != "") {
967 $path .= " > ";
968 }
969
970 $path .= $tmpPath[$i]["title"];
971 }
972
973 return $path;
974 }

References $i, and $path.

Referenced by outPageSelector().

+ Here is the caller graph for this function:

◆ getEditContext()

assQuestionGUI::getEditContext ( )
Returns
string

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

281 {
282 return $this->editContext;
283 }

References $editContext.

Referenced by isAdjustmentEditContext(), and isAuthoringEditContext().

+ Here is the caller graph for this function:

◆ getEditQuestionTabCommands()

assQuestionGUI::getEditQuestionTabCommands ( )
final

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

1905 {
1906 return array_merge($this->getBasicEditQuestionTabCommands(), $this->getAdditionalEditQuestionCommands());
1907 }

References getAdditionalEditQuestionCommands(), and getBasicEditQuestionTabCommands().

Referenced by setQuestionTabs().

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

◆ getErrorMessage()

assQuestionGUI::getErrorMessage ( )

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

997 {
998 return $this->errormessage;
999 }

References $errormessage.

Referenced by assTextQuestionGUI\addSuggestedSolution(), assFlashQuestionGUI\suggestRange(), and assFormulaQuestionGUI\suggestRange().

+ Here is the caller graph for this function:

◆ getFormEncodingType()

assQuestionGUI::getFormEncodingType ( )

Reimplemented in assFileUploadGUI.

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

2096 {
2098 }

References FORM_ENCODING_URLENCODE.

Referenced by outQuestionForTest(), and ilTestPlayerAbstractGUI\showQuestionViewable().

+ Here is the caller graph for this function:

◆ getGenericFeedbackOutput()

assQuestionGUI::getGenericFeedbackOutput (   $active_id,
  $pass 
)

Returns the answer specific feedback for the question.

Parameters
integer$active_idActive ID of the user
integer$passActive pass
Returns
string HTML Code with the answer specific feedback @access public

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

1254 {
1255 $output = "";
1256 include_once "./Modules/Test/classes/class.ilObjTest.php";
1257 $manual_feedback = ilObjTest::getManualFeedback($active_id, $this->object->getId(), $pass);
1258 if (strlen($manual_feedback)) {
1259 return $manual_feedback;
1260 }
1261 $correct_feedback = $this->object->feedbackOBJ->getGenericFeedbackTestPresentation($this->object->getId(), true);
1262 $incorrect_feedback = $this->object->feedbackOBJ->getGenericFeedbackTestPresentation($this->object->getId(), false);
1263 if (strlen($correct_feedback . $incorrect_feedback)) {
1264 $reached_points = $this->object->calculateReachedPoints($active_id, $pass);
1265 $max_points = $this->object->getMaximumPoints();
1266 if ($reached_points == $max_points) {
1267 $output = $correct_feedback;
1268 } else {
1269 $output = $incorrect_feedback;
1270 }
1271 }
1272 return $this->object->prepareTextareaOutput($output, true);
1273 }
static getManualFeedback($active_id, $question_id, $pass)
Retrieves the manual feedback for a question in a test.
if(!is_dir( $entity_dir)) exit("Fatal Error ([A-Za-z0-9]+)\s+" &#(? foreach( $entity_files as $file) $output

References $output, $pass, and ilObjTest\getManualFeedback().

Referenced by getAnswerFeedbackOutput(), assOrderingQuestionGUI\getSolutionOutput(), assClozeTestGUI\getSolutionOutput(), assErrorTextGUI\getSolutionOutput(), assFormulaQuestionGUI\getSolutionOutput(), assKprimChoiceGUI\getSolutionOutput(), assLongMenuGUI\getSolutionOutput(), assMatchingQuestionGUI\getSolutionOutput(), assNumericGUI\getSolutionOutput(), assOrderingHorizontalGUI\getSolutionOutput(), assTextQuestionGUI\getSolutionOutput(), and ilTestPlayerAbstractGUI\populateGenericFeedbackBlock().

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

◆ getGenericFeedbackOutputForCorrectSolution()

assQuestionGUI::getGenericFeedbackOutputForCorrectSolution ( )

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

1276 {
1277 return $this->object->prepareTextareaOutput(
1278 $this->object->feedbackOBJ->getGenericFeedbackTestPresentation($this->object->getId(), true),
1279 true
1280 );
1281 }

◆ getGenericFeedbackOutputForIncorrectSolution()

assQuestionGUI::getGenericFeedbackOutputForIncorrectSolution ( )

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

1284 {
1285 return $this->object->prepareTextareaOutput(
1286 $this->object->feedbackOBJ->getGenericFeedbackTestPresentation($this->object->getId(), false),
1287 true
1288 );
1289 }

◆ getILIASPage()

assQuestionGUI::getILIASPage (   $html = "")

Returns the ILIAS Page around a question.

Returns
string The ILIAS page content @access public

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

533 {
534 include_once("./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php");
535 $page_gui = new ilAssQuestionPageGUI($this->object->getId());
536 $page_gui->setQuestionHTML(array($this->object->getId() => $html));
537 $page_gui->setOutputMode("presentation");
538 $presentation = $page_gui->presentation();
539 $presentation = preg_replace("/src=\"\\.\\//ims", "src=\"" . ILIAS_HTTP_PATH . "/", $presentation);
540 return $presentation;
541 }
Question page GUI class.
$html
Definition: example_001.php:87

References $html.

Referenced by assClozeTestGUI\getPreview(), assErrorTextGUI\getPreview(), assFileUploadGUI\getPreview(), assFlashQuestionGUI\getPreview(), assFormulaQuestionGUI\getPreview(), assImagemapQuestionGUI\getPreview(), assJavaAppletGUI\getPreview(), assKprimChoiceGUI\getPreview(), assLongMenuGUI\getPreview(), assMatchingQuestionGUI\getPreview(), assMultipleChoiceGUI\getPreview(), assNumericGUI\getPreview(), assOrderingHorizontalGUI\getPreview(), assOrderingQuestionGUI\getPreview(), assSingleChoiceGUI\getPreview(), assTextQuestionGUI\getPreview(), assTextSubsetGUI\getPreview(), assOrderingQuestionGUI\getSolutionOutput(), assClozeTestGUI\getSolutionOutput(), assErrorTextGUI\getSolutionOutput(), assFileUploadGUI\getSolutionOutput(), assFlashQuestionGUI\getSolutionOutput(), assFormulaQuestionGUI\getSolutionOutput(), assImagemapQuestionGUI\getSolutionOutput(), assJavaAppletGUI\getSolutionOutput(), assKprimChoiceGUI\getSolutionOutput(), assLongMenuGUI\getSolutionOutput(), assMatchingQuestionGUI\getSolutionOutput(), assMultipleChoiceGUI\getSolutionOutput(), assNumericGUI\getSolutionOutput(), assOrderingHorizontalGUI\getSolutionOutput(), assSingleChoiceGUI\getSolutionOutput(), assTextQuestionGUI\getSolutionOutput(), assTextSubsetGUI\getSolutionOutput(), assErrorTextGUI\getTestOutput(), assFileUploadGUI\getTestOutput(), and assOrderingHorizontalGUI\getTestOutput().

+ Here is the caller graph for this function:

◆ getNavigationGUI()

assQuestionGUI::getNavigationGUI ( )
Returns
ilTestQuestionNavigationGUI

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

318 {
320 }

References $navigationGUI.

Referenced by outQuestionPage().

+ Here is the caller graph for this function:

◆ getPresentationContext()

assQuestionGUI::getPresentationContext ( )
Returns
string

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

188 {
190 }

References $presentationContext.

Referenced by isTestPresentationContext().

+ Here is the caller graph for this function:

◆ getPreview()

◆ getPreviewSession()

◆ getPreviousSolutionConfirmationCheckboxHtml()

assQuestionGUI::getPreviousSolutionConfirmationCheckboxHtml ( )
protected

Reimplemented in assFileUploadGUI, and assImagemapQuestionGUI.

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

608 {
609 $tpl = new ilTemplate('tpl.tst_question_additional_behaviour_checkbox.html', true, true, 'Modules/TestQuestionPool');
610 // hey: prevPassSolutions - use abtract template
611 $tpl->setVariable('TXT_FORCE_FORM_DIFF_LABEL', $this->lng->txt('use_previous_solution'));
612 // hey.
613 return $tpl->get();
614 }
special template class to simplify handling of ITX/PEAR

References $tpl.

Referenced by outQuestionPage().

+ Here is the caller graph for this function:

◆ getPreviousSolutionProvidedMessage()

assQuestionGUI::getPreviousSolutionProvidedMessage ( )
protected

Reimplemented in assFileUploadGUI.

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

603 {
604 return $this->lng->txt('use_previous_solution_advice');
605 }

Referenced by outQuestionPage().

+ Here is the caller graph for this function:

◆ getQuestionActionCmd()

◆ getQuestionCount()

assQuestionGUI::getQuestionCount ( )

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

992 {
994 }
$question_count
question count in test

References $question_count.

◆ getQuestionHeaderBlockBuilder()

assQuestionGUI::getQuestionHeaderBlockBuilder ( )
Returns
\ilQuestionHeaderBlockBuilder $questionHeaderBlockBuilder

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

References $questionHeaderBlockBuilder.

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

+ Here is the caller graph for this function:

◆ getQuestionTemplate()

assQuestionGUI::getQuestionTemplate ( )

get question template

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

502 {
503 // @todo Björn: Maybe this has to be changed for PHP 7/ILIAS 5.2.x (ilObjTestGUI::executeCommand, switch -> default case -> $this->prepareOutput(); already added a template to the CONTENT variable wrapped in a block named content)
504 if (!$this->tpl->blockExists('content')) {
505 $this->tpl->addBlockFile("CONTENT", "content", "tpl.il_as_qpl_content.html", "Modules/TestQuestionPool");
506 }
507 // @todo Björn: Maybe this has to be changed for PHP 7/ILIAS 5.2.x (ilObjTestGUI::executeCommand, switch -> default case -> $this->prepareOutput(); already added a template to the STATUSLINE variable wrapped in a block named statusline)
508 if (!$this->tpl->blockExists('statusline')) {
509 $this->tpl->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html");
510 }
511 // @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
512 if (!$this->tpl->blockExists('adm_content')) {
513 $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_question.html", "Modules/TestQuestionPool");
514 }
515 }

Referenced by assTextQuestionGUI\addSuggestedSolution(), assImagemapQuestionGUI\areaEditor(), assClozeTestGUI\editQuestion(), assErrorTextGUI\editQuestion(), assFileUploadGUI\editQuestion(), assFlashQuestionGUI\editQuestion(), assJavaAppletGUI\editQuestion(), assMatchingQuestionGUI\editQuestion(), assMultipleChoiceGUI\editQuestion(), assNumericGUI\editQuestion(), assOrderingHorizontalGUI\editQuestion(), assSingleChoiceGUI\editQuestion(), assTextQuestionGUI\editQuestion(), assTextSubsetGUI\editQuestion(), assImagemapQuestionGUI\editQuestion(), assKprimChoiceGUI\editQuestion(), assLongMenuGUI\editQuestion(), and renderEditForm().

+ Here is the caller graph for this function:

◆ getQuestionType()

assQuestionGUI::getQuestionType ( )

Returns the question type string.

Returns the question type string

Returns
string The question type string @access public

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

1024 {
1025 return $this->object->getQuestionType();
1026 }

Referenced by ilScoringAdjustmentGUI\allowedInAdjustment(), and getType().

+ Here is the caller graph for this function:

◆ getRenderPurpose()

assQuestionGUI::getRenderPurpose ( )
Returns
string

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

227 {
229 }

References $renderPurpose.

Referenced by isRenderPurposeDemoplay(), isRenderPurposeInputValue(), isRenderPurposePlayback(), isRenderPurposePreview(), isRenderPurposePrintPdf(), and suggestedsolution().

+ Here is the caller graph for this function:

◆ getSequenceNumber()

assQuestionGUI::getSequenceNumber ( )

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

982 {
983 return $this->sequence_no;
984 }
$sequence_no
sequence number in test

References $sequence_no.

◆ getSolutionOutput()

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

◆ getSpecificFeedbackOutput()

assQuestionGUI::getSpecificFeedbackOutput (   $active_id,
  $pass 
)
abstract

Returns the answer specific feedback for the question.

This method should be overwritten by the actual question.

Todo:
Mark this method abstract!
Parameters
integer$active_idActive ID of the user
integer$passActive pass
Returns
string HTML Code with the answer specific feedback @access public

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

◆ getTargetGuiClass()

assQuestionGUI::getTargetGuiClass ( )

◆ getTaxonomyIds()

assQuestionGUI::getTaxonomyIds ( )

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

336 {
337 return $this->taxonomyIds;
338 }

References $taxonomyIds.

Referenced by populateTaxonomyFormSection(), and saveTaxonomyAssignments().

+ Here is the caller graph for this function:

◆ getTestOutput()

assQuestionGUI::getTestOutput (   $active_id,
  $pass,
  $is_question_postponed,
  $user_post_solutions,
  $show_specific_inline_feedback 
)
abstract

◆ getType()

assQuestionGUI::getType ( )

needed for page editor compliance

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

180 {
181 return $this->getQuestionType();
182 }
getQuestionType()
Returns the question type string.

References getQuestionType().

Referenced by buildBasicEditFormObject().

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

◆ getUseUnchangedAnswerCheckboxHtml()

assQuestionGUI::getUseUnchangedAnswerCheckboxHtml ( )
protected

Reimplemented in assMultipleChoiceGUI.

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

592 {
593 // hey: prevPassSolutions - use abstracted template to share with other purposes of this kind
594 $tpl = new ilTemplate('tpl.tst_question_additional_behaviour_checkbox.html', true, true, 'Modules/TestQuestionPool');
595 $tpl->setVariable('TXT_FORCE_FORM_DIFF_LABEL', $this->object->getTestPresentationConfig()->getUseUnchangedAnswerLabel());
596 // hey.
597 return $tpl->get();
598 }

References $tpl.

Referenced by outQuestionPage().

+ Here is the caller graph for this function:

◆ hasCorrectSolution()

◆ isAdjustmentEditContext()

assQuestionGUI::isAdjustmentEditContext ( )
Parameters
bool$isAdjustmentEditContext

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

305 {
307 }

References EDIT_CONTEXT_ADJUSTMENT, and getEditContext().

Referenced by assOrderingQuestionGUI\populateAnswerSpecificFormPart(), and assOrderingQuestionGUI\writeAnswerSpecificPostData().

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

◆ isAuthoringEditContext()

assQuestionGUI::isAuthoringEditContext ( )
Parameters
bool$isAuthoringEditContext

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

297 {
299 }

References EDIT_CONTEXT_AUTHORING, and getEditContext().

+ Here is the call graph for this function:

◆ isAutosaveable()

assQuestionGUI::isAutosaveable ( )

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

2017 {
2018 return $this->object->isAutosaveable();
2019 }

◆ isPreviousSolutionPrefilled()

assQuestionGUI::isPreviousSolutionPrefilled ( )
Returns
boolean

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

References $previousSolutionPrefilled.

◆ isRenderPurposeDemoplay()

assQuestionGUI::isRenderPurposeDemoplay ( )

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

References getRenderPurpose(), and RENDER_PURPOSE_DEMOPLAY.

Referenced by assOrderingQuestionGUI\isInteractivePresentation().

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

◆ isRenderPurposeInputValue()

assQuestionGUI::isRenderPurposeInputValue ( )

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

250 {
252 }

References getRenderPurpose(), and RENDER_PURPOSE_INPUT_VALUE.

Referenced by renderPurposeSupportsFormHtml().

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

◆ isRenderPurposePlayback()

assQuestionGUI::isRenderPurposePlayback ( )

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

255 {
257 }

References getRenderPurpose(), and RENDER_PURPOSE_PLAYBACK.

Referenced by assOrderingQuestionGUI\isInteractivePresentation().

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

◆ isRenderPurposePreview()

assQuestionGUI::isRenderPurposePreview ( )

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

245 {
247 }

References getRenderPurpose(), and RENDER_PURPOSE_PREVIEW.

+ Here is the call graph for this function:

◆ isRenderPurposePrintPdf()

assQuestionGUI::isRenderPurposePrintPdf ( )

◆ isSaveCommand()

◆ isTestPresentationContext()

◆ linkChilds()

assQuestionGUI::linkChilds ( )

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

1731 {
1732 $this->ctrl->saveParameter($this, array("subquestion_index", "link_new_type", "search_link_type"));
1733 switch ($_GET["search_link_type"]) {
1734 case "pg":
1735 return $this->outPageSelector();
1736 break;
1737 case "st":
1738 return $this->outChapterSelector();
1739 break;
1740 case "glo":
1741 return $this->outGlossarySelector();
1742 break;
1743 case "lm":
1744 $subquestion_index = ($_GET["subquestion_index"] > 0) ? $_GET["subquestion_index"] : 0;
1745 $this->object->saveSuggestedSolution("lm", "il__lm_" . $_GET["source_id"], $subquestion_index);
1746 ilUtil::sendSuccess($this->lng->txt("suggested_solution_added_successfully"), true);
1747 $this->ctrl->redirect($this, "suggestedsolution");
1748 break;
1749 }
1750 }

References $_GET, outChapterSelector(), outGlossarySelector(), outPageSelector(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ magicAfterTestOutput()

assQuestionGUI::magicAfterTestOutput ( )

Reimplemented in assTextQuestionGUI.

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

2083 {
2084 return;
2085 }

Referenced by outQuestionForTest().

+ Here is the caller graph for this function:

◆ originalSyncForm()

assQuestionGUI::originalSyncForm (   $return_to = "",
  $return_to_feedback = '' 
)
Parameters
string$return_to
string$return_to_feedbackilAssQuestionFeedbackEditingGUI

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

643 {
644 if (strlen($return_to)) {
645 $this->ctrl->setParameter($this, "return_to", $return_to);
646 } elseif ($_REQUEST['return_to']) {
647 $this->ctrl->setParameter($this, "return_to", $_REQUEST['return_to']);
648 }
649 if (strlen($return_to_feedback)) {
650 $this->ctrl->setParameter($this, 'return_to_fb', 'true');
651 }
652
653 $this->ctrl->saveParameter($this, 'test_express_mode');
654
655 $template = new ilTemplate("tpl.il_as_qpl_sync_original.html", true, true, "Modules/TestQuestionPool");
656 $template->setVariable("BUTTON_YES", $this->lng->txt("yes"));
657 $template->setVariable("BUTTON_NO", $this->lng->txt("no"));
658 $template->setVariable("FORM_ACTION", $this->ctrl->getFormAction($this));
659 $template->setVariable("TEXT_SYNC", $this->lng->txt("confirm_sync_questions"));
660 $this->tpl->setVariable("ADM_CONTENT", $template->get());
661 }
$template

References $template.

Referenced by suggestedsolution().

+ Here is the caller graph for this function:

◆ outAdditionalOutput()

assQuestionGUI::outAdditionalOutput ( )

Reimplemented in assTextQuestionGUI.

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

1012 {
1013 }

◆ outChapterSelector()

assQuestionGUI::outChapterSelector ( )

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

1669 {
1670 require_once 'Modules/TestQuestionPool/classes/tables/class.ilQuestionInternalLinkSelectionTableGUI.php';
1671 require_once 'Modules/LearningModule/classes/class.ilObjContentObjectGUI.php';
1672
1673 $this->ctrl->setParameter($this, 'q_id', $this->object->getId());
1674
1675 $cont_obj_gui = new ilObjContentObjectGUI('', $_GET['source_id'], true);
1676 $cont_obj = $cont_obj_gui->object;
1677 $ctree = $cont_obj->getLMTree();
1678 $nodes = $ctree->getSubtree($ctree->getNodeData($ctree->getRootId()));
1679
1680 $rows = array();
1681
1682 foreach ($nodes as $node) {
1683 if ($node['type'] == $_GET['search_link_type']) {
1684 $this->ctrl->setParameter($this, $node['type'], $node['obj_id']);
1685 $rows[] = array(
1686 'title' => $node['title'],
1687 'description' => '',
1688 'text_add' => $this->lng->txt('add'),
1689 'href_add' => $this->ctrl->getLinkTarget($this, 'add' . strtoupper($node['type']))
1690 );
1691 }
1692 }
1693
1694 $table = new ilQuestionInternalLinkSelectionTableGUI($this, 'cancelExplorer', __METHOD__);
1695 $table->setTitle($this->lng->txt('obj_' . ilUtil::stripSlashes($_GET['search_link_type'])));
1696 $table->setData($rows);
1697
1698 $this->tpl->setContent($table->getHTML());
1699 }
Class ilObjContentObjectGUI.
if(empty($password)) $table
Definition: pwgen.php:24
$rows
Definition: xhr_table.php:10

References $_GET, $rows, $table, and ilUtil\stripSlashes().

Referenced by linkChilds().

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

◆ outGlossarySelector()

assQuestionGUI::outGlossarySelector ( )

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

1702 {
1703 require_once 'Modules/TestQuestionPool/classes/tables/class.ilQuestionInternalLinkSelectionTableGUI.php';
1704 require_once 'Modules/Glossary/classes/class.ilObjGlossary.php';
1705
1706 $this->ctrl->setParameter($this, 'q_id', $this->object->getId());
1707
1708 $glossary = new ilObjGlossary($_GET['source_id'], true);
1709 $terms = $glossary->getTermList();
1710
1711 $rows = array();
1712
1713 foreach ($terms as $term) {
1714 $this->ctrl->setParameter($this, 'git', $term['id']);
1715 $rows[] = array(
1716 'title' => $term['term'],
1717 'description' => '',
1718 'text_add' => $this->lng->txt('add'),
1719 'href_add' => $this->ctrl->getLinkTarget($this, 'addGIT')
1720 );
1721 }
1722
1723 $table = new ilQuestionInternalLinkSelectionTableGUI($this, 'cancelExplorer', __METHOD__);
1724 $table->setTitle($this->lng->txt('glossary_term'));
1725 $table->setData($rows);
1726
1727 $this->tpl->setContent($table->getHTML());
1728 }
Class ilObjGlossary.

References $_GET, $rows, and $table.

Referenced by linkChilds().

+ Here is the caller graph for this function:

◆ outPageSelector()

assQuestionGUI::outPageSelector ( )

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

1610 {
1611 require_once 'Modules/TestQuestionPool/classes/tables/class.ilQuestionInternalLinkSelectionTableGUI.php';
1612 require_once 'Modules/LearningModule/classes/class.ilLMPageObject.php';
1613 require_once 'Modules/LearningModule/classes/class.ilObjContentObjectGUI.php';
1614
1615 $this->ctrl->setParameter($this, 'q_id', $this->object->getId());
1616
1617 $cont_obj_gui = new ilObjContentObjectGUI('', $_GET['source_id'], true);
1618 $cont_obj = $cont_obj_gui->object;
1619 $pages = ilLMPageObject::getPageList($cont_obj->getId());
1620 $shownpages = array();
1621 $tree = $cont_obj->getLMTree();
1622 $chapters = $tree->getSubtree($tree->getNodeData($tree->getRootId()));
1623
1624 $rows = array();
1625
1626 foreach ($chapters as $chapter) {
1627 $chapterpages = $tree->getChildsByType($chapter['obj_id'], 'pg');
1628 foreach ($chapterpages as $page) {
1629 if ($page['type'] == $_GET['search_link_type']) {
1630 array_push($shownpages, $page['obj_id']);
1631
1632 if ($tree->isInTree($page['obj_id'])) {
1633 $path_str = $this->getContextPath($cont_obj, $page['obj_id']);
1634 } else {
1635 $path_str = '---';
1636 }
1637
1638 $this->ctrl->setParameter($this, $page['type'], $page['obj_id']);
1639 $rows[] = array(
1640 'title' => $page['title'],
1641 'description' => ilUtil::prepareFormOutput($path_str),
1642 'text_add' => $this->lng->txt('add'),
1643 'href_add' => $this->ctrl->getLinkTarget($this, 'add' . strtoupper($page['type']))
1644 );
1645 }
1646 }
1647 }
1648 foreach ($pages as $page) {
1649 if (!in_array($page['obj_id'], $shownpages)) {
1650 $this->ctrl->setParameter($this, $page['type'], $page['obj_id']);
1651 $rows[] = array(
1652 'title' => $page['title'],
1653 'description' => '---',
1654 'text_add' => $this->lng->txt('add'),
1655 'href_add' => $this->ctrl->getLinkTarget($this, 'add' . strtoupper($page['type']))
1656 );
1657 }
1658 }
1659
1660 require_once 'Modules/TestQuestionPool/classes/tables/class.ilQuestionInternalLinkSelectionTableGUI.php';
1661 $table = new ilQuestionInternalLinkSelectionTableGUI($this, 'cancelExplorer', __METHOD__);
1662 $table->setTitle($this->lng->txt('obj_' . ilUtil::stripSlashes($_GET['search_link_type'])));
1663 $table->setData($rows);
1664
1665 $this->tpl->setContent($table->getHTML());
1666 }
getContextPath($cont_obj, $a_endnode_id, $a_startnode_id=1)
get context path in content object tree
static getPageList($lm_id)
static

References $_GET, $rows, $table, getContextPath(), ilLMPageObject\getPageList(), ilUtil\prepareFormOutput(), and ilUtil\stripSlashes().

Referenced by linkChilds().

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

◆ outQuestionForTest()

assQuestionGUI::outQuestionForTest (   $formaction,
  $active_id,
  $pass,
  $is_question_postponed = false,
  $user_post_solutions = false,
  $show_specific_inline_feedback = false 
)
final
Parameters
string$formaction
integer$active_id
integer | null$pass
bool$is_question_postponed
bool$user_post_solutions
bool$show_specific_inline_feedback

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

2056 {
2057 $formaction = $this->completeTestOutputFormAction($formaction, $active_id, $pass);
2058
2059 $test_output = $this->getTestOutput(
2060 $active_id,
2061 $pass,
2062 $is_question_postponed,
2063 $user_post_solutions,
2064 $show_specific_inline_feedback
2065 );
2066
2067 $this->magicAfterTestOutput();
2068
2069 $this->tpl->setVariable("QUESTION_OUTPUT", $test_output);
2070 $this->tpl->setVariable("FORMACTION", $formaction);
2071 $this->tpl->setVariable("ENCTYPE", 'enctype="' . $this->getFormEncodingType() . '"');
2072 $this->tpl->setVariable("FORM_TIMESTAMP", time());
2073 }
getTestOutput( $active_id, $pass, $is_question_postponed, $user_post_solutions, $show_specific_inline_feedback)
completeTestOutputFormAction($formAction, $active_id, $pass)

References $pass, completeTestOutputFormAction(), getFormEncodingType(), getTestOutput(), and magicAfterTestOutput().

Referenced by ilTestPlayerAbstractGUI\showQuestionEditable().

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

◆ outQuestionPage()

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

output question page

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

547 {
548 // hey: prevPassSolutions - add the "use previous answer"
549 // hey: prevPassSolutions - refactored identifiers
550 if ($this->object->getTestPresentationConfig()->isSolutionInitiallyPrefilled()) {
551 // hey
554 } elseif // (!) --> if ($this->object->getTestQuestionConfig()->isUnchangedAnswerPossible())
555 // hey.
556// fau: testNav - add the "use unchanged answer checkbox"
557 // hey: prevPassSolutions - refactored identifiers
558 ($this->object->getTestPresentationConfig()->isUnchangedAnswerPossible()) {
559 // hey.
561 }
562 // fau.
563
564 $this->lng->loadLanguageModule("content");
565
566 // fau: testNav - add question buttons below question, add actions menu
567 include_once("./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php");
568 $page_gui = new ilAssQuestionPageGUI($this->object->getId());
569 $page_gui->setOutputMode("presentation");
570 $page_gui->setTemplateTargetVar($a_temp_var);
571
572 if ($this->getNavigationGUI()) {
573 $html .= $this->getNavigationGUI()->getHTML();
574 $page_gui->setQuestionActionsHTML($this->getNavigationGUI()->getActionsHTML());
575 }
576 // fau.
577
578 if (strlen($html)) {
579 $page_gui->setQuestionHTML(array($this->object->getId() => $html));
580 }
581
582 // fau: testNav - fill the header with subtitle blocks for question info an actions
583 $page_gui->setPresentationTitle($this->questionHeaderBlockBuilder->getPresentationTitle());
584 $page_gui->setQuestionInfoHTML($this->questionHeaderBlockBuilder->getQuestionInfoHTML());
585 // fau.
586
587 return $page_gui->presentation();
588 }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.

References $html, getNavigationGUI(), getPreviousSolutionConfirmationCheckboxHtml(), getPreviousSolutionProvidedMessage(), getUseUnchangedAnswerCheckboxHtml(), and ilUtil\sendInfo().

Referenced by assClozeTestGUI\getTestOutput(), assErrorTextGUI\getTestOutput(), assLongMenuGUI\getTestOutput(), assMultipleChoiceGUI\getTestOutput(), assKprimChoiceGUI\getTestOutput(), assNumericGUI\getTestOutput(), assFileUploadGUI\getTestOutput(), assFlashQuestionGUI\getTestOutput(), assFormulaQuestionGUI\getTestOutput(), assImagemapQuestionGUI\getTestOutput(), assJavaAppletGUI\getTestOutput(), assOrderingHorizontalGUI\getTestOutput(), assSingleChoiceGUI\getTestOutput(), assMatchingQuestionGUI\getTestOutput(), assTextQuestionGUI\getTestOutput(), assTextSubsetGUI\getTestOutput(), assOrderingQuestionGUI\getTestOutput(), ilTestPlayerAbstractGUI\populateInstantResponseModal(), and ilTestPlayerAbstractGUI\showQuestionViewable().

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

◆ outQuestionType()

assQuestionGUI::outQuestionType ( )

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

1305 {
1306 $count = $this->object->isInUse();
1307
1308 if ($this->object->_questionExistsInPool($this->object->getId()) && $count) {
1309 global $rbacsystem;
1310 if ($rbacsystem->checkAccess("write", $_GET["ref_id"])) {
1311 ilUtil::sendInfo(sprintf($this->lng->txt("qpl_question_is_in_use"), $count));
1312 }
1313 }
1314
1315 return assQuestion::_getQuestionTypeName($this->object->getQuestionType());
1316 }
sprintf('%.4f', $callTime)
static _getQuestionTypeName($type_tag)
Return the translation for a given question type tag.

References $_GET, assQuestion\_getQuestionTypeName(), ilUtil\sendInfo(), and sprintf.

Referenced by buildBasicEditFormObject(), assMultipleChoiceGUI\buildEditForm(), assOrderingQuestionGUI\buildEditForm(), assClozeTestGUI\editQuestion(), assErrorTextGUI\editQuestion(), assFileUploadGUI\editQuestion(), assFlashQuestionGUI\editQuestion(), assJavaAppletGUI\editQuestion(), assMatchingQuestionGUI\editQuestion(), assNumericGUI\editQuestion(), assOrderingHorizontalGUI\editQuestion(), assSingleChoiceGUI\editQuestion(), assTextQuestionGUI\editQuestion(), and assTextSubsetGUI\editQuestion().

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

◆ outSolutionExplorer()

assQuestionGUI::outSolutionExplorer ( )

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

1532 {
1533 global $tree;
1534
1535 include_once("./Modules/TestQuestionPool/classes/class.ilSolutionExplorer.php");
1536 $type = $_GET["link_new_type"];
1537 $search = $_GET["search_link_type"];
1538 $this->ctrl->setParameter($this, "link_new_type", $type);
1539 $this->ctrl->setParameter($this, "search_link_type", $search);
1540 $this->ctrl->saveParameter($this, array("subquestion_index", "link_new_type", "search_link_type"));
1541
1542 ilUtil::sendInfo($this->lng->txt("select_object_to_link"));
1543
1544 $parent_ref_id = $tree->getParentId($_GET["ref_id"]);
1545 $exp = new ilSolutionExplorer($this->ctrl->getLinkTarget($this, 'suggestedsolution'), get_class($this));
1546 $exp->setExpand($_GET['expand_sol'] ? $_GET['expand_sol'] : $parent_ref_id);
1547 $exp->setExpandTarget($this->ctrl->getLinkTarget($this, 'outSolutionExplorer'));
1548 $exp->setTargetGet("ref_id");
1549 $exp->setRefId($_GET["ref_id"]);
1550 $exp->addFilter($type);
1551 $exp->setSelectableType($type);
1552 if (isset($_GET['expandCurrentPath']) && $_GET['expandCurrentPath']) {
1553 $exp->expandPathByRefId($parent_ref_id);
1554 }
1555
1556 // build html-output
1557 $exp->setOutput(0);
1558
1559 $template = new ilTemplate("tpl.il_as_qpl_explorer.html", true, true, "Modules/TestQuestionPool");
1560 $template->setVariable("EXPLORER_TREE", $exp->getOutput());
1561 $template->setVariable("BUTTON_CANCEL", $this->lng->txt("cancel"));
1562 $template->setVariable("FORMACTION", $this->ctrl->getFormAction($this, "suggestedsolution"));
1563 $this->tpl->setVariable("ADM_CONTENT", $template->get());
1564 }
$type

References $_GET, $template, $type, and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ populateJavascriptFilesRequiredForWorkForm()

assQuestionGUI::populateJavascriptFilesRequiredForWorkForm ( ilTemplate  $tpl)

Reimplemented in assMultipleChoiceGUI.

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

494 {
495 $tpl->addJavaScript('Modules/TestQuestionPool/js/ilAssMultipleChoice.js');
496 }

References $tpl.

◆ populateTaxonomyFormSection()

assQuestionGUI::populateTaxonomyFormSection ( ilPropertyFormGUI  $form)
protected

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

1198 {
1199 if (count($this->getTaxonomyIds())) {
1200 // this is needed by ilTaxSelectInputGUI in some cases
1201 require_once 'Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php';
1202 ilOverlayGUI::initJavaScript();
1203
1204 $sectHeader = new ilFormSectionHeaderGUI();
1205 $sectHeader->setTitle($this->lng->txt('qpl_qst_edit_form_taxonomy_section'));
1206 $form->addItem($sectHeader);
1207
1208 require_once 'Services/Taxonomy/classes/class.ilTaxSelectInputGUI.php';
1209
1210 foreach ($this->getTaxonomyIds() as $taxonomyId) {
1211 $taxonomy = new ilObjTaxonomy($taxonomyId);
1212 $label = sprintf($this->lng->txt('qpl_qst_edit_form_taxonomy'), $taxonomy->getTitle());
1213 $postvar = "tax_node_assign_$taxonomyId";
1214
1215 $taxSelect = new ilTaxSelectInputGUI($taxonomy->getId(), $postvar, true);
1216 $taxSelect->setTitle($label);
1217
1218 require_once 'Services/Taxonomy/classes/class.ilTaxNodeAssignment.php';
1219 $taxNodeAssignments = new ilTaxNodeAssignment(ilObject::_lookupType($this->object->getObjId()), $this->object->getObjId(), 'quest', $taxonomyId);
1220 $assignedNodes = $taxNodeAssignments->getAssignmentsOfItem($this->object->getId());
1221
1222 $taxSelect->setValue(array_map(function ($assignedNode) {
1223 return $assignedNode['node_id'];
1224 }, $assignedNodes));
1225 $form->addItem($taxSelect);
1226 }
1227 }
1228 }
This class represents a section header in a property form.
static _lookupType($a_id, $a_reference=false)
lookup object type
Taxonomy node <-> item assignment.
Select taxonomy nodes input GUI.

References $form, ilObject\_lookupType(), getTaxonomyIds(), and sprintf.

Referenced by assImagemapQuestionGUI\buildEditForm(), assKprimChoiceGUI\buildEditForm(), assLongMenuGUI\buildEditForm(), assMultipleChoiceGUI\buildEditForm(), assOrderingQuestionGUI\buildEditForm(), assClozeTestGUI\editQuestion(), assErrorTextGUI\editQuestion(), assFileUploadGUI\editQuestion(), assFlashQuestionGUI\editQuestion(), assJavaAppletGUI\editQuestion(), assMatchingQuestionGUI\editQuestion(), assNumericGUI\editQuestion(), assOrderingHorizontalGUI\editQuestion(), assSingleChoiceGUI\editQuestion(), assTextQuestionGUI\editQuestion(), and assTextSubsetGUI\editQuestion().

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

◆ renderEditForm()

assQuestionGUI::renderEditForm (   $form)
protected
Parameters
$form

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

521 {
522 $this->getQuestionTemplate();
523 $this->tpl->setVariable("QUESTION_DATA", $form->getHTML());
524 }
getQuestionTemplate()
get question template

References $form, and getQuestionTemplate().

Referenced by assOrderingQuestionGUI\changeToPictures(), assOrderingQuestionGUI\changeToText(), assOrderingQuestionGUI\editQuestion(), assOrderingQuestionGUI\orderNestedPictures(), assOrderingQuestionGUI\orderNestedTerms(), assOrderingQuestionGUI\removeElementImage(), assOrderingQuestionGUI\uploadElementImage(), and assOrderingQuestionGUI\writePostData().

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

◆ renderPurposeSupportsFormHtml()

assQuestionGUI::renderPurposeSupportsFormHtml ( )

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

265 {
266 if ($this->isRenderPurposePrintPdf()) {
267 return false;
268 }
269
270 if ($this->isRenderPurposeInputValue()) {
271 return false;
272 }
273
274 return true;
275 }

References isRenderPurposeInputValue(), and isRenderPurposePrintPdf().

Referenced by assKprimChoiceGUI\getSolutionOutput(), assMultipleChoiceGUI\getSolutionOutput(), assSingleChoiceGUI\getSolutionOutput(), assTextQuestionGUI\getSolutionOutput(), and assClozeTestGUI\populateSolutiontextToGapTpl().

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

◆ save()

assQuestionGUI::save ( )

save question

in express mode, so add question to test directly

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

772 {
773 global $ilUser;
774 $old_id = $_GET["q_id"];
775 $result = $this->writePostData();
776
777 if ($result == 0) {
778 $ilUser->setPref("tst_lastquestiontype", $this->object->getQuestionType());
779 $ilUser->writePref("tst_lastquestiontype", $this->object->getQuestionType());
780 $this->object->saveToDb();
781 $originalexists = $this->object->_questionExistsInPool($this->object->original_id);
782
783
784 include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
785 if (($_GET["calling_test"] || (isset($_GET['calling_consumer']) && (int) $_GET['calling_consumer'])) && $originalexists && assQuestion::_isWriteable($this->object->original_id, $ilUser->getId())) {
786 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
787 $this->ctrl->setParameter($this, 'return_to', 'editQuestion');
788 $this->ctrl->redirect($this, "originalSyncForm");
789 return;
790 } elseif ($_GET["calling_test"]) {
791 require_once 'Modules/Test/classes/class.ilObjTest.php';
792 $test = new ilObjTest($_GET["calling_test"]);
793 if (!assQuestion::_questionExistsInTest($this->object->getId(), $test->getTestId())) {
794 global $tree, $ilDB, $ilPluginAdmin;
795
796 include_once("./Modules/Test/classes/class.ilObjTest.php");
797 $_GET["ref_id"] = $_GET["calling_test"];
798 $test = new ilObjTest($_GET["calling_test"], true);
799
800 require_once 'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
801 $testQuestionSetConfigFactory = new ilTestQuestionSetConfigFactory($tree, $ilDB, $ilPluginAdmin, $test);
802
803 $new_id = $test->insertQuestion(
804 $testQuestionSetConfigFactory->getQuestionSetConfig(),
805 $this->object->getId()
806 );
807
808 if (isset($_REQUEST['prev_qid'])) {
809 $test->moveQuestionAfter($this->object->getId() + 1, $_REQUEST['prev_qid']);
810 }
811
812 $this->ctrl->setParameter($this, 'q_id', $new_id);
813 $this->ctrl->setParameter($this, 'calling_test', $_GET['calling_test']);
814 #$this->ctrl->setParameter($this, 'test_ref_id', false);
815 }
816 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
817 $this->ctrl->redirect($this, 'editQuestion');
818 } else {
819 $this->callNewIdListeners($this->object->getId());
820
821 if ($this->object->getId() != $old_id) {
822 // first save
823 $this->ctrl->setParameterByClass($_GET["cmdClass"], "q_id", $this->object->getId());
824 $this->ctrl->setParameterByClass($_GET["cmdClass"], "sel_question_types", $_GET["sel_question_types"]);
825 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
826
827 //global $___test_express_mode;
831 if ($_REQUEST['prev_qid']) {
832 // @todo: bheyser/mbecker wtf? ..... thx@jposselt ....
833 // mbecker: Possible fix: Just instantiate the obj?
834 include_once("./Modules/Test/classes/class.ilObjTest.php");
835 $test = new ilObjTest($_GET["ref_id"], true);
836 $test->moveQuestionAfter($_REQUEST['prev_qid'], $this->object->getId());
837 }
838 if ( /*$___test_express_mode || */ $_REQUEST['express_mode']) {
839 global $tree, $ilDB, $ilPluginAdmin;
840
841 include_once("./Modules/Test/classes/class.ilObjTest.php");
842 $test = new ilObjTest($_GET["ref_id"], true);
843
844 require_once 'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
845 $testQuestionSetConfigFactory = new ilTestQuestionSetConfigFactory($tree, $ilDB, $ilPluginAdmin, $test);
846
847 $test->insertQuestion(
848 $testQuestionSetConfigFactory->getQuestionSetConfig(),
849 $this->object->getId()
850 );
851
852 require_once 'Modules/Test/classes/class.ilTestExpressPage.php';
853 $_REQUEST['q_id'] = $this->object->getId();
855 }
856
857 $this->ctrl->redirectByClass($_GET["cmdClass"], "editQuestion");
858 }
859 if (strcmp($_SESSION["info"], "") != 0) {
860 ilUtil::sendSuccess($_SESSION["info"] . "<br />" . $this->lng->txt("msg_obj_modified"), true);
861 } else {
862 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
863 }
864 $this->ctrl->redirect($this, 'editQuestion');
865 }
866 }
867 }
$test
Definition: Utf8Test.php:84
$_SESSION["AccountId"]
callNewIdListeners($a_new_id)
Call the new id listeners.
static _questionExistsInTest($question_id, $test_id)
static _isWriteable($question_id, $user_id)
Returns true if the question is writeable by a certain user.
$ilUser
Definition: imgupload.php:18

References $_GET, $_SESSION, $ilDB, $ilUser, $result, $test, assQuestion\_isWriteable(), assQuestion\_questionExistsInTest(), callNewIdListeners(), ilTestExpressPage\getReturnToPageLink(), ilUtil\redirect(), ilUtil\sendSuccess(), and writePostData().

Referenced by assFormulaQuestionGUI\saveFQ().

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

◆ saveEdit()

assQuestionGUI::saveEdit ( )

save question

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

725 {
726 global $ilUser;
727
728 $result = $this->writePostData();
729 if ($result == 0) {
730 $ilUser->setPref("tst_lastquestiontype", $this->object->getQuestionType());
731 $ilUser->writePref("tst_lastquestiontype", $this->object->getQuestionType());
732 $this->object->saveToDb();
733 $originalexists = $this->object->_questionExists($this->object->original_id);
734 include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
735 if ($_GET["calling_test"] && $originalexists && assQuestion::_isWriteable($this->object->original_id, $ilUser->getId())) {
736 $this->ctrl->redirect($this, "originalSyncForm");
737 } elseif ($_GET["calling_test"]) {
738 $_GET["ref_id"] = $_GET["calling_test"];
739 ilUtil::redirect("ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=" . $_GET["calling_test"]);
740 return;
741 } elseif ($_GET["test_ref_id"]) {
742 global $tree, $ilDB, $ilPluginAdmin;
743
744 include_once("./Modules/Test/classes/class.ilObjTest.php");
745 $_GET["ref_id"] = $_GET["test_ref_id"];
746 $test = new ilObjTest($_GET["test_ref_id"], true);
747
748 require_once 'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
749 $testQuestionSetConfigFactory = new ilTestQuestionSetConfigFactory($tree, $ilDB, $ilPluginAdmin, $test);
750
751 $test->insertQuestion($testQuestionSetConfigFactory->getQuestionSetConfig(), $this->object->getId());
752
753 ilUtil::redirect("ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=" . $_GET["test_ref_id"]);
754 } else {
755 $this->ctrl->setParameter($this, "q_id", $this->object->getId());
756 $this->editQuestion();
757 if (strcmp($_SESSION["info"], "") != 0) {
758 ilUtil::sendSuccess($_SESSION["info"] . "<br />" . $this->lng->txt("msg_obj_modified"), false);
759 } else {
760 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), false);
761 }
762 $this->ctrl->setParameterByClass("ilAssQuestionPageGUI", "q_id", $this->object->getId());
763 $this->ctrl->redirectByClass("ilAssQuestionPageGUI", "edit");
764 }
765 }
766 }

References $_GET, $_SESSION, $ilDB, $ilUser, $result, $test, assQuestion\_isWriteable(), ilUtil\redirect(), ilUtil\sendSuccess(), and writePostData().

+ Here is the call graph for this function:

◆ saveReturn()

assQuestionGUI::saveReturn ( )

save question

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

873 {
874 global $ilUser;
875 $old_id = $_GET["q_id"];
876 $result = $this->writePostData();
877 if ($result == 0) {
878 $ilUser->setPref("tst_lastquestiontype", $this->object->getQuestionType());
879 $ilUser->writePref("tst_lastquestiontype", $this->object->getQuestionType());
880 $this->object->saveToDb();
881 $originalexists = $this->object->_questionExistsInPool($this->object->original_id);
882 include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
883 if (($_GET["calling_test"] || (isset($_GET['calling_consumer']) && (int) $_GET['calling_consumer'])) && $originalexists && assQuestion::_isWriteable($this->object->original_id, $ilUser->getId())) {
884 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
885 $this->ctrl->setParameter($this, 'test_express_mode', $_REQUEST['test_express_mode']);
886 $this->ctrl->redirect($this, "originalSyncForm");
887 return;
888 } elseif ($_GET["calling_test"]) {
889 require_once 'Modules/Test/classes/class.ilObjTest.php';
890 $test = new ilObjTest($_GET["calling_test"]);
891 #var_dump(assQuestion::_questionExistsInTest($this->object->getId(), $test->getTestId()));
892 $q_id = $this->object->getId();
893 if (!assQuestion::_questionExistsInTest($this->object->getId(), $test->getTestId())) {
894 global $tree, $ilDB, $ilPluginAdmin;
895
896 include_once("./Modules/Test/classes/class.ilObjTest.php");
897 $_GET["ref_id"] = $_GET["calling_test"];
898 $test = new ilObjTest($_GET["calling_test"], true);
899
900 require_once 'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
901 $testQuestionSetConfigFactory = new ilTestQuestionSetConfigFactory($tree, $ilDB, $ilPluginAdmin, $test);
902
903 $new_id = $test->insertQuestion(
904 $testQuestionSetConfigFactory->getQuestionSetConfig(),
905 $this->object->getId()
906 );
907
908 $q_id = $new_id;
909 if (isset($_REQUEST['prev_qid'])) {
910 $test->moveQuestionAfter($this->object->getId() + 1, $_REQUEST['prev_qid']);
911 }
912
913 $this->ctrl->setParameter($this, 'q_id', $new_id);
914 $this->ctrl->setParameter($this, 'calling_test', $_GET['calling_test']);
915 #$this->ctrl->setParameter($this, 'test_ref_id', false);
916 }
917 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
918 if ( /*$___test_express_mode || */
919 $_REQUEST['test_express_mode']
920 ) {
922 } else {
923 ilUtil::redirect("ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=" . $_GET["calling_test"]);
924 }
925 } else {
926 if ($this->object->getId() != $old_id) {
927 $this->callNewIdListeners($this->object->getId());
928 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
929 $this->ctrl->redirectByClass("ilobjquestionpoolgui", "questions");
930 }
931 if (strcmp($_SESSION["info"], "") != 0) {
932 ilUtil::sendSuccess($_SESSION["info"] . "<br />" . $this->lng->txt("msg_obj_modified"), true);
933 } else {
934 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
935 }
936 $this->ctrl->redirectByClass("ilobjquestionpoolgui", "questions");
937 }
938 }
939 }

References $_GET, $_SESSION, $ilDB, $ilUser, $result, $test, assQuestion\_isWriteable(), assQuestion\_questionExistsInTest(), callNewIdListeners(), ilTestExpressPage\getReturnToPageLink(), ilUtil\redirect(), ilUtil\sendSuccess(), and writePostData().

+ Here is the call graph for this function:

◆ saveSuggestedSolution()

assQuestionGUI::saveSuggestedSolution ( )

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

1567 {
1568 global $tree;
1569
1570 include_once("./Modules/TestQuestionPool/classes/class.ilSolutionExplorer.php");
1571 switch ($_POST["solutiontype"]) {
1572 case "lm":
1573 $type = "lm";
1574 $search = "lm";
1575 break;
1576 case "git":
1577 $type = "glo";
1578 $search = "glo";
1579 break;
1580 case "st":
1581 $type = "lm";
1582 $search = "st";
1583 break;
1584 case "pg":
1585 $type = "lm";
1586 $search = "pg";
1587 break;
1588 case "file":
1589 case "text":
1590 return $this->suggestedsolution();
1591 break;
1592 default:
1593 return $this->suggestedsolution();
1594 break;
1595 }
1596 if (isset($_POST['solutiontype'])) {
1597 $this->ctrl->setParameter($this, 'expandCurrentPath', 1);
1598 }
1599 $this->ctrl->setParameter($this, "link_new_type", $type);
1600 $this->ctrl->setParameter($this, "search_link_type", $search);
1601 $this->ctrl->redirect($this, "outSolutionExplorer");
1602 }
$_POST["username"]
suggestedsolution()
Allows to add suggested solutions for questions.

References $_POST, $type, and suggestedsolution().

+ Here is the call graph for this function:

◆ saveTaxonomyAssignments()

assQuestionGUI::saveTaxonomyAssignments ( )
protected

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

1183 {
1184 if (count($this->getTaxonomyIds())) {
1185 require_once 'Services/Taxonomy/classes/class.ilTaxAssignInputGUI.php';
1186
1187 foreach ($this->getTaxonomyIds() as $taxonomyId) {
1188 $postvar = "tax_node_assign_$taxonomyId";
1189
1190 $tax_node_assign = new ilTaxAssignInputGUI($taxonomyId, true, '', $postvar);
1191 // TODO: determine tst/qpl when tax assigns become maintainable within tests
1192 $tax_node_assign->saveInput("qpl", $this->object->getObjId(), "quest", $this->object->getId());
1193 }
1194 }
1195 }
Input GUI class for taxonomy assignments.

References getTaxonomyIds().

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

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

◆ setAdjustmentEditContext()

assQuestionGUI::setAdjustmentEditContext ( )

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

310 {
311 return $this->setEditContext(self::EDIT_CONTEXT_ADJUSTMENT);
312 }
setEditContext($editContext)

References setEditContext().

+ Here is the call graph for this function:

◆ setEditContext()

assQuestionGUI::setEditContext (   $editContext)
Parameters
string$editContext

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

289 {
290 $this->editContext = $editContext;
291 }

References $editContext.

Referenced by setAdjustmentEditContext().

+ Here is the caller graph for this function:

◆ setErrorMessage()

assQuestionGUI::setErrorMessage (   $errormessage)

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

1002 {
1003 $this->errormessage = $errormessage;
1004 }

References $errormessage.

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

+ Here is the caller graph for this function:

◆ setNavigationGUI()

assQuestionGUI::setNavigationGUI (   $navigationGUI)
Parameters
ilTestQuestionNavigationGUI$navigationGUI

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

326 {
327 $this->navigationGUI = $navigationGUI;
328 }

References $navigationGUI.

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

+ Here is the caller graph for this function:

◆ setPresentationContext()

assQuestionGUI::setPresentationContext (   $presentationContext)
Parameters
string$presentationContext

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

196 {
197 $this->presentationContext = $presentationContext;
198 }

References $presentationContext.

◆ setPreviewSession()

assQuestionGUI::setPreviewSession (   $previewSession)
Parameters
\ilAssQuestionPreviewSession$previewSession

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

2140 {
2141 $this->previewSession = $previewSession;
2142 }

References $previewSession.

◆ setPreviousSolutionPrefilled()

assQuestionGUI::setPreviousSolutionPrefilled (   $previousSolutionPrefilled)
Parameters
boolean$previousSolutionPrefilled

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

218 {
219 $this->previousSolutionPrefilled = $previousSolutionPrefilled;
220 }

References $previousSolutionPrefilled.

◆ setQuestionActionCmd()

assQuestionGUI::setQuestionActionCmd (   $questionActionCmd)

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

374 {
375 $this->questionActionCmd = $questionActionCmd;
376
377 if (is_object($this->object)) {
378 $this->object->questionActionCmd = $questionActionCmd;
379 }
380 }

References $questionActionCmd.

◆ setQuestionCount()

assQuestionGUI::setQuestionCount (   $a_question_count)

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

987 {
988 $this->question_count = $a_question_count;
989 }

◆ setQuestionHeaderBlockBuilder()

assQuestionGUI::setQuestionHeaderBlockBuilder (   $questionHeaderBlockBuilder)
Parameters
\ilQuestionHeaderBlockBuilder$questionHeaderBlockBuilder

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

359 {
360 $this->questionHeaderBlockBuilder = $questionHeaderBlockBuilder;
361 }

References $questionHeaderBlockBuilder.

◆ setQuestionTabs()

assQuestionGUI::setQuestionTabs ( )

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

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

1818 {
1819 global $rbacsystem, $ilTabs;
1820
1821 $ilTabs->clearTargets();
1822
1823 $this->ctrl->setParameterByClass("ilAssQuestionPageGUI", "q_id", $_GET["q_id"]);
1824 include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
1825 $q_type = $this->object->getQuestionType();
1826
1827 if (strlen($q_type)) {
1828 $classname = $q_type . "GUI";
1829 $this->ctrl->setParameterByClass(strtolower($classname), "sel_question_types", $q_type);
1830 $this->ctrl->setParameterByClass(strtolower($classname), "q_id", $_GET["q_id"]);
1831 }
1832
1833 if ($_GET["q_id"]) {
1834 if ($rbacsystem->checkAccess('write', $_GET["ref_id"])) {
1835 // edit page
1836 $ilTabs->addTarget(
1837 "edit_page",
1838 $this->ctrl->getLinkTargetByClass("ilAssQuestionPageGUI", "edit"),
1839 array("edit", "insert", "exec_pg"),
1840 "",
1841 "",
1842 $force_active
1843 );
1844 }
1845
1846 $this->addTab_QuestionPreview($ilTabs);
1847 }
1848 $force_active = false;
1849 if ($rbacsystem->checkAccess('write', $_GET["ref_id"])) {
1850 $url = "";
1851 if ($classname) {
1852 $url = $this->ctrl->getLinkTargetByClass($classname, "editQuestion");
1853 }
1854 $force_active = false;
1855 // edit question properties
1856 $ilTabs->addTarget(
1857 "edit_question",
1858 $url,
1860 $classname,
1861 "",
1862 $force_active
1863 );
1864 }
1865
1866 // add tab for question feedback within common class assQuestionGUI
1867 $this->addTab_QuestionFeedback($ilTabs);
1868
1869 // add tab for question hint within common class assQuestionGUI
1870 $this->addTab_QuestionHints($ilTabs);
1871
1872 // add tab for question's suggested solution within common class assQuestionGUI
1873 $this->addTab_SuggestedSolution($ilTabs, $classname);
1874
1875 // Assessment of questions sub menu entry
1876 if ($_GET["q_id"]) {
1877 $ilTabs->addTarget(
1878 "statistics",
1879 $this->ctrl->getLinkTargetByClass($classname, "assessment"),
1880 array("assessment"),
1881 $classname,
1882 ""
1883 );
1884 }
1885
1886 $this->addBackTab($ilTabs);
1887 }
addTab_QuestionHints(ilTabsGUI $tabs)
adds the hints tab to ilTabsGUI
addTab_SuggestedSolution(ilTabsGUI $tabs, $classname)
addBackTab(ilTabsGUI $ilTabs)
addTab_QuestionFeedback(ilTabsGUI $tabs)
adds the feedback tab to ilTabsGUI
addTab_QuestionPreview(ilTabsGUI $tabsGUI)
$url

References $_GET, $url, addBackTab(), addTab_QuestionFeedback(), addTab_QuestionHints(), addTab_QuestionPreview(), addTab_SuggestedSolution(), and getEditQuestionTabCommands().

+ Here is the call graph for this function:

◆ setRenderPurpose()

assQuestionGUI::setRenderPurpose (   $renderPurpose)
Parameters
string$renderPurpose

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

235 {
236 $this->renderPurpose = $renderPurpose;
237 }

References $renderPurpose.

Referenced by suggestedsolution().

+ Here is the caller graph for this function:

◆ setSequenceNumber()

assQuestionGUI::setSequenceNumber (   $nr)

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

977 {
978 $this->sequence_no = $nr;
979 }

◆ setTargetGui()

assQuestionGUI::setTargetGui (   $linkTargetGui)

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

341 {
342 $this->setTargetGuiClass(get_class($linkTargetGui));
343 }
setTargetGuiClass($targetGuiClass)

References setTargetGuiClass().

+ Here is the call graph for this function:

◆ setTargetGuiClass()

assQuestionGUI::setTargetGuiClass (   $targetGuiClass)

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

346 {
347 $this->targetGuiClass = $targetGuiClass;
348 }

References $targetGuiClass.

Referenced by setTargetGui().

+ Here is the caller graph for this function:

◆ setTaxonomyIds()

assQuestionGUI::setTaxonomyIds (   $taxonomyIds)

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

331 {
332 $this->taxonomyIds = $taxonomyIds;
333 }

References $taxonomyIds.

◆ showHints()

assQuestionGUI::showHints ( )

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

2173 {
2174 global $ilCtrl;
2175 $ilCtrl->redirectByClass('ilAssQuestionHintsGUI', ilAssQuestionHintsGUI::CMD_SHOW_LIST);
2176 }

References $ilCtrl, and ilAssQuestionHintsGUI\CMD_SHOW_LIST.

◆ showSuggestedSolution()

assQuestionGUI::showSuggestedSolution ( )

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

1319 {
1320 $this->suggestedsolution();
1321 }

References suggestedsolution().

+ Here is the call graph for this function:

◆ suggestedsolution()

assQuestionGUI::suggestedsolution ( )

Allows to add suggested solutions for questions.

@access public

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

1329 {
1330 global $ilUser;
1331 global $ilAccess;
1332
1333 $save = (is_array($_POST["cmd"]) && array_key_exists("suggestedsolution", $_POST["cmd"])) ? true : false;
1334
1335 if ($save && $_POST["deleteSuggestedSolution"] == 1) {
1336 $this->object->deleteSuggestedSolutions();
1337 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
1338 $this->ctrl->redirect($this, "suggestedsolution");
1339 }
1340
1341 $output = "";
1342 $solution_array = $this->object->getSuggestedSolution(0);
1343 $options = array(
1344 "lm" => $this->lng->txt("obj_lm"),
1345 "st" => $this->lng->txt("obj_st"),
1346 "pg" => $this->lng->txt("obj_pg"),
1347 "git" => $this->lng->txt("glossary_term"),
1348 "file" => $this->lng->txt("fileDownload"),
1349 "text" => $this->lng->txt("solutionText")
1350 );
1351
1352 if ((strcmp($_POST["solutiontype"], "file") == 0) && (strcmp($solution_array["type"], "file") != 0)) {
1353 $solution_array = array(
1354 "type" => "file"
1355 );
1356 } elseif ((strcmp($_POST["solutiontype"], "text") == 0) && (strcmp($solution_array["type"], "text") != 0)) {
1357 $oldOutputMode = $this->getRenderPurpose();
1358 $this->setRenderPurpose(self::RENDER_PURPOSE_INPUT_VALUE);
1359
1360 $solution_array = array(
1361 "type" => "text",
1362 "value" => $this->getSolutionOutput(0, null, false, false, true, false, true)
1363 );
1364 $this->setRenderPurpose($oldsaveSuggestedSolutionOutputMode);
1365 }
1366 if ($save && strlen($_POST["filename"])) {
1367 $solution_array["value"]["filename"] = $_POST["filename"];
1368 }
1369 if ($save && strlen($_POST["solutiontext"])) {
1370 $solution_array["value"] = $_POST["solutiontext"];
1371 }
1372 include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
1373 if (count($solution_array)) {
1374 $form = new ilPropertyFormGUI();
1375 $form->setFormAction($this->ctrl->getFormAction($this));
1376 $form->setTitle($this->lng->txt("solution_hint"));
1377 $form->setMultipart(true);
1378 $form->setTableWidth("100%");
1379 $form->setId("suggestedsolutiondisplay");
1380
1381 // suggested solution output
1382 include_once "./Modules/TestQuestionPool/classes/class.ilSolutionTitleInputGUI.php";
1383 $title = new ilSolutionTitleInputGUI($this->lng->txt("showSuggestedSolution"), "solutiontype");
1384 $template = new ilTemplate("tpl.il_as_qpl_suggested_solution_input_presentation.html", true, true, "Modules/TestQuestionPool");
1385 if (strlen($solution_array["internal_link"])) {
1386 $href = assQuestion::_getInternalLinkHref($solution_array["internal_link"]);
1387 $template->setCurrentBlock("preview");
1388 $template->setVariable("TEXT_SOLUTION", $this->lng->txt("suggested_solution"));
1389 $template->setVariable("VALUE_SOLUTION", " <a href=\"$href\" target=\"content\">" . $this->lng->txt("view") . "</a> ");
1390 $template->parseCurrentBlock();
1391 } elseif ((strcmp($solution_array["type"], "file") == 0) && (is_array($solution_array["value"]))) {
1392 $href = $this->object->getSuggestedSolutionPathWeb() . $solution_array["value"]["name"];
1393 $template->setCurrentBlock("preview");
1394 $template->setVariable("TEXT_SOLUTION", $this->lng->txt("suggested_solution"));
1395 $template->setVariable("VALUE_SOLUTION", " <a href=\"$href\" target=\"content\">" . ilUtil::prepareFormOutput((strlen($solution_array["value"]["filename"])) ? $solution_array["value"]["filename"] : $solution_array["value"]["name"]) . "</a> ");
1396 $template->parseCurrentBlock();
1397 }
1398 $template->setVariable("TEXT_TYPE", $this->lng->txt("type"));
1399 $template->setVariable("VALUE_TYPE", $options[$solution_array["type"]]);
1400 $title->setHtml($template->get());
1401 $deletesolution = new ilCheckboxInputGUI("", "deleteSuggestedSolution");
1402 $deletesolution->setOptionTitle($this->lng->txt("deleteSuggestedSolution"));
1403 $title->addSubItem($deletesolution);
1404 $form->addItem($title);
1405
1406 if (strcmp($solution_array["type"], "file") == 0) {
1407 // file
1408 $file = new ilFileInputGUI($this->lng->txt("fileDownload"), "file");
1409 $file->setRequired(true);
1410 $file->enableFileNameSelection("filename");
1411 //$file->setSuffixes(array("doc","xls","png","jpg","gif","pdf"));
1412 if ($_FILES["file"]["tmp_name"] && $file->checkInput()) {
1413 if (!file_exists($this->object->getSuggestedSolutionPath())) {
1414 ilUtil::makeDirParents($this->object->getSuggestedSolutionPath());
1415 }
1416
1417 $res = ilUtil::moveUploadedFile($_FILES["file"]["tmp_name"], $_FILES["file"]["name"], $this->object->getSuggestedSolutionPath() . $_FILES["file"]["name"]);
1418 if ($res) {
1419 ilUtil::renameExecutables($this->object->getSuggestedSolutionPath());
1420
1421 // remove an old file download
1422 if (is_array($solution_array["value"])) {
1423 @unlink($this->object->getSuggestedSolutionPath() . $solution_array["value"]["name"]);
1424 }
1425 $file->setValue($_FILES["file"]["name"]);
1426 $this->object->saveSuggestedSolution("file", "", 0, array("name" => $_FILES["file"]["name"], "type" => $_FILES["file"]["type"], "size" => $_FILES["file"]["size"], "filename" => $_POST["filename"]));
1427 $originalexists = $this->object->_questionExistsInPool($this->object->original_id);
1428 if (($_GET["calling_test"] || (isset($_GET['calling_consumer']) && (int) $_GET['calling_consumer'])) && $originalexists && assQuestion::_isWriteable($this->object->original_id, $ilUser->getId())) {
1429 return $this->originalSyncForm("suggestedsolution");
1430 } else {
1431 ilUtil::sendSuccess($this->lng->txt("suggested_solution_added_successfully"), true);
1432 $this->ctrl->redirect($this, "suggestedsolution");
1433 }
1434 } else {
1435 // BH: $res as info string? wtf? it holds a bool or something else!!?
1437 }
1438 } else {
1439 if (is_array($solution_array["value"])) {
1440 $file->setValue($solution_array["value"]["name"]);
1441 $file->setFilename((strlen($solution_array["value"]["filename"])) ? $solution_array["value"]["filename"] : $solution_array["value"]["name"]);
1442 }
1443 }
1444 $form->addItem($file);
1445 $hidden = new ilHiddenInputGUI("solutiontype");
1446 $hidden->setValue("file");
1447 $form->addItem($hidden);
1448 } elseif (strcmp($solution_array["type"], "text") == 0) {
1449 $solutionContent = $solution_array['value'];
1450 $solutionContent = $this->object->fixSvgToPng($solutionContent);
1451 $solutionContent = $this->object->fixUnavailableSkinImageSources($solutionContent);
1452 $question = new ilTextAreaInputGUI($this->lng->txt("solutionText"), "solutiontext");
1453 $question->setValue($this->object->prepareTextareaOutput($solutionContent));
1454 $question->setRequired(true);
1455 $question->setRows(10);
1456 $question->setCols(80);
1457 $question->setUseRte(true);
1458 $question->addPlugin("latex");
1459 $question->addButton("latex");
1460 $question->setRTESupport($this->object->getId(), "qpl", "assessment");
1461 $hidden = new ilHiddenInputGUI("solutiontype");
1462 $hidden->setValue("text");
1463 $form->addItem($hidden);
1464 $form->addItem($question);
1465 }
1466 if ($ilAccess->checkAccess("write", "", $_GET['ref_id'])) {
1467 $form->addCommandButton('showSuggestedSolution', $this->lng->txt('cancel'));
1468 $form->addCommandButton('suggestedsolution', $this->lng->txt('save'));
1469 }
1470
1471 if ($save) {
1472 if ($form->checkInput()) {
1473 switch ($solution_array["type"]) {
1474 case "file":
1475 $this->object->saveSuggestedSolution("file", "", 0, array(
1476 "name" => $solution_array["value"]["name"],
1477 "type" => $solution_array["value"]["type"],
1478 "size" => $solution_array["value"]["size"],
1479 "filename" => $_POST["filename"]
1480 ));
1481 break;
1482 case "text":
1483 $this->object->saveSuggestedSolution("text", "", 0, $solution_array["value"]);
1484 break;
1485 }
1486 $originalexists = $this->object->_questionExistsInPool($this->object->original_id);
1487 if (($_GET["calling_test"] || (isset($_GET['calling_consumer']) && (int) $_GET['calling_consumer'])) && $originalexists && assQuestion::_isWriteable($this->object->original_id, $ilUser->getId())) {
1488 return $this->originalSyncForm("suggestedsolution");
1489 } else {
1490 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
1491 $this->ctrl->redirect($this, "suggestedsolution");
1492 }
1493 }
1494 }
1495
1496 $output = $form->getHTML();
1497 }
1498
1499 $savechange = (strcmp($this->ctrl->getCmd(), "saveSuggestedSolution") == 0) ? true : false;
1500
1501 $changeoutput = "";
1502 if ($ilAccess->checkAccess("write", "", $_GET['ref_id'])) {
1503 $formchange = new ilPropertyFormGUI();
1504 $formchange->setFormAction($this->ctrl->getFormAction($this));
1505 $formchange->setTitle((count($solution_array)) ? $this->lng->txt("changeSuggestedSolution") : $this->lng->txt("addSuggestedSolution"));
1506 $formchange->setMultipart(false);
1507 $formchange->setTableWidth("100%");
1508 $formchange->setId("suggestedsolution");
1509
1510 $solutiontype = new ilRadioGroupInputGUI($this->lng->txt("suggestedSolutionType"), "solutiontype");
1511 foreach ($options as $opt_value => $opt_caption) {
1512 $solutiontype->addOption(new ilRadioOption($opt_caption, $opt_value));
1513 }
1514 if (count($solution_array)) {
1515 $solutiontype->setValue($solution_array["type"]);
1516 }
1517 $solutiontype->setRequired(true);
1518 $formchange->addItem($solutiontype);
1519
1520 $formchange->addCommandButton("saveSuggestedSolution", $this->lng->txt("select"));
1521
1522 if ($savechange) {
1523 $formchange->checkInput();
1524 }
1525 $changeoutput = $formchange->getHTML();
1526 }
1527
1528 $this->tpl->setVariable("ADM_CONTENT", $changeoutput . $output);
1529 }
if(!isset( $_REQUEST[ 'ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
Definition: as_login.php:20
getSolutionOutput( $active_id, $pass=null, $graphicalOutput=false, $result_output=false, $show_question_only=true, $show_feedback=false, $show_correct_solution=false, $show_manual_scoring=false, $show_question_text=true)
originalSyncForm($return_to="", $return_to_feedback='')
setRenderPurpose($renderPurpose)
static _getInternalLinkHref($target="")
This class represents a checkbox property in a property form.
This class represents a file property in a property form.
This class represents a property in a property form.
This class represents an option in a radio group.
This class represents a custom property in a property form.
static makeDirParents($a_dir)
Create a new directory and all parent directories.
static renameExecutables($a_dir)
Rename uploaded executables for security reasons.
if(!file_exists("$old.txt")) if( $old===$new) if(file_exists("$new.txt")) $file
foreach($_POST as $key=> $value) $res

References $_GET, $_POST, $file, $form, $ilUser, $options, $output, $res, $template, $title, assQuestion\_getInternalLinkHref(), assQuestion\_isWriteable(), getRenderPurpose(), getSolutionOutput(), ilUtil\makeDirParents(), originalSyncForm(), ilUtil\prepareFormOutput(), ilUtil\renameExecutables(), ilUtil\sendInfo(), ilUtil\sendSuccess(), and setRenderPurpose().

Referenced by saveSuggestedSolution(), and showSuggestedSolution().

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

◆ sync()

assQuestionGUI::sync ( )

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

664 {
665 $original_id = $this->object->original_id;
666 if ($original_id) {
667 $this->object->syncWithOriginal();
668 }
669 if (strlen($_GET["return_to"])) {
670 $this->ctrl->redirect($this, $_GET["return_to"]);
671 }
672 if (strlen($_REQUEST["return_to_fb"])) {
673 $this->ctrl->redirectByClass('ilAssQuestionFeedbackEditingGUI', 'showFeedbackForm');
674 } else {
675 if (isset($_GET['calling_consumer']) && (int) $_GET['calling_consumer']) {
676 $ref_id = (int) $_GET['calling_consumer'];
679 ilUtil::redirect($consumer->getQuestionEditingFormBackTarget($_GET['consumer_context']));
680 }
681 require_once 'Services/Link/classes/class.ilLink.php';
683 }
684 $_GET["ref_id"] = $_GET["calling_test"];
685
686 if ($_REQUEST['test_express_mode']) {
688 } else {
689 ilUtil::redirect("ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=" . $_GET["calling_test"]);
690 }
691 }
692 }

References $_GET, $consumer, ilLink\_getLink(), ilObjectFactory\getInstanceByRefId(), ilTestExpressPage\getReturnToPageLink(), and ilUtil\redirect().

+ Here is the call graph for this function:

◆ writePostData()

assQuestionGUI::writePostData (   $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, assFlashQuestionGUI, assFormulaQuestionGUI, assImagemapQuestionGUI, assJavaAppletGUI, assLongMenuGUI, assMatchingQuestionGUI, assMultipleChoiceGUI, assNumericGUI, assOrderingHorizontalGUI, assSingleChoiceGUI, assTextQuestionGUI, assTextSubsetGUI, assOrderingQuestionGUI, and assKprimChoiceGUI.

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

392 {
393 }

Referenced by apply(), save(), saveEdit(), and saveReturn().

+ Here is the caller graph for this function:

◆ writeQuestionGenericPostData()

assQuestionGUI::writeQuestionGenericPostData ( )
protected

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

2022 {
2023 $this->object->setTitle($_POST["title"]);
2024 $this->object->setAuthor($_POST["author"]);
2025 $this->object->setComment($_POST["comment"]);
2026 if ($this->object->getSelfAssessmentEditingMode()) {
2027 $this->object->setNrOfTries($_POST['nr_of_tries']);
2028 }
2029 $this->object->setQuestion(ilUtil::stripOnlySlashes($_POST['question'])); // ?
2030 $this->object->setEstimatedWorkingTime(
2031 $_POST["Estimated"]["hh"],
2032 $_POST["Estimated"]["mm"],
2033 $_POST["Estimated"]["ss"]
2034 );
2035 }
static stripOnlySlashes($a_str)
strip slashes if magic qoutes is enabled

References $_POST, and ilUtil\stripOnlySlashes().

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

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

Field Documentation

◆ $editContext

assQuestionGUI::$editContext = self::EDIT_CONTEXT_AUTHORING
private

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

Referenced by getEditContext(), and setEditContext().

◆ $editForm

assQuestionGUI::$editForm
protected

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

Referenced by buildEditForm().

◆ $error

assQuestionGUI::$error

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

◆ $errormessage

assQuestionGUI::$errormessage

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

Referenced by addErrorMessage(), getErrorMessage(), and setErrorMessage().

◆ $lng

assQuestionGUI::$lng

◆ $navigationGUI

assQuestionGUI::$navigationGUI
private

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

Referenced by getNavigationGUI(), and setNavigationGUI().

◆ $object

assQuestionGUI::$object

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

Referenced by callNewIdListeners().

◆ $presentationContext

assQuestionGUI::$presentationContext = null
private

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

Referenced by getPresentationContext(), and setPresentationContext().

◆ $previewSession

assQuestionGUI::$previewSession
private

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

Referenced by getPreviewSession(), and setPreviewSession().

◆ $previousSolutionPrefilled

assQuestionGUI::$previousSolutionPrefilled = false
private

◆ $question_count

assQuestionGUI::$question_count

question count in test

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

Referenced by getQuestionCount().

◆ $questionActionCmd

assQuestionGUI::$questionActionCmd = 'handleQuestionAction'
private

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

Referenced by getQuestionActionCmd(), and setQuestionActionCmd().

◆ $questionHeaderBlockBuilder

assQuestionGUI::$questionHeaderBlockBuilder
private

◆ $renderPurpose

assQuestionGUI::$renderPurpose = self::RENDER_PURPOSE_PLAYBACK
private

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

Referenced by getRenderPurpose(), and setRenderPurpose().

◆ $sequence_no

assQuestionGUI::$sequence_no

sequence number in test

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

Referenced by getSequenceNumber().

◆ $targetGuiClass

assQuestionGUI::$targetGuiClass = null
private

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

Referenced by getTargetGuiClass(), and setTargetGuiClass().

◆ $taxonomyIds

assQuestionGUI::$taxonomyIds = array()
private

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

Referenced by getTaxonomyIds(), and setTaxonomyIds().

◆ $tpl

◆ EDIT_CONTEXT_ADJUSTMENT

const assQuestionGUI::EDIT_CONTEXT_ADJUSTMENT = 'adjustment'

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

Referenced by isAdjustmentEditContext().

◆ EDIT_CONTEXT_AUTHORING

const assQuestionGUI::EDIT_CONTEXT_AUTHORING = 'authoring'

◆ FORM_ENCODING_MULTIPART

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

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

Referenced by assFileUploadGUI\getFormEncodingType().

◆ FORM_ENCODING_URLENCODE

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

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

Referenced by getFormEncodingType().

◆ FORM_MODE_ADJUST

const assQuestionGUI::FORM_MODE_ADJUST = 'adjust'

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

◆ FORM_MODE_EDIT

const assQuestionGUI::FORM_MODE_EDIT = 'edit'

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

◆ PRESENTATION_CONTEXT_RESULTS

const assQuestionGUI::PRESENTATION_CONTEXT_RESULTS = 'pContextResults'

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

◆ PRESENTATION_CONTEXT_TEST

const assQuestionGUI::PRESENTATION_CONTEXT_TEST = 'pContextTest'

◆ RENDER_PURPOSE_DEMOPLAY

const assQuestionGUI::RENDER_PURPOSE_DEMOPLAY = 'renderPurposeDemoplay'

◆ RENDER_PURPOSE_INPUT_VALUE

const assQuestionGUI::RENDER_PURPOSE_INPUT_VALUE = 'renderPurposeInputValue'

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

Referenced by isRenderPurposeInputValue().

◆ RENDER_PURPOSE_PLAYBACK

const assQuestionGUI::RENDER_PURPOSE_PLAYBACK = 'renderPurposePlayback'

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

Referenced by isRenderPurposePlayback().

◆ RENDER_PURPOSE_PREVIEW

◆ RENDER_PURPOSE_PRINT_PDF

◆ SESSION_PREVIEW_DATA_BASE_INDEX

const assQuestionGUI::SESSION_PREVIEW_DATA_BASE_INDEX = 'ilAssQuestionPreviewAnswers'

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


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