ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 ()
 
 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)
 
 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 Member Functions

 getUseUnchangedAnswerCheckboxHtml ()
 

Private Attributes

 $taxonomyIds = array()
 
 $targetGuiClass = null
 
 $questionActionCmd = 'handleQuestionAction'
 
 $questionHeaderBlockBuilder
 
 $navigationGUI
 
 $presentationContext = null
 
 $renderPurpose = self::RENDER_PURPOSE_PLAYBACK
 
 $editContext = self::EDIT_CONTEXT_AUTHORING
 
 $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 104 of file class.assQuestionGUI.php.

105 {
106 global $lng, $tpl, $ilCtrl;
107
108 $this->lng =& $lng;
109 $this->tpl =& $tpl;
110 $this->ctrl =& $ilCtrl;
111 $this->ctrl->saveParameter($this, "q_id");
112 $this->ctrl->saveParameter($this, "prev_qid");
113 $this->ctrl->saveParameter($this, "calling_test");
114 $this->ctrl->saveParameter($this, "calling_consumer");
115 $this->ctrl->saveParameter($this, "consumer_context");
116 $this->ctrl->saveParameterByClass('ilAssQuestionPageGUI', 'test_express_mode');
117 $this->ctrl->saveParameterByClass('ilAssQuestionPageGUI', 'calling_consumer');
118 $this->ctrl->saveParameterByClass('ilAssQuestionPageGUI', 'consumer_context');
119 $this->ctrl->saveParameterByClass('ilobjquestionpoolgui', 'test_express_mode');
120 $this->ctrl->saveParameterByClass('ilobjquestionpoolgui', 'calling_consumer');
121 $this->ctrl->saveParameterByClass('ilobjquestionpoolgui', 'consumer_context');
122
123 include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
124 $this->errormessage = $this->lng->txt("fill_out_all_required_fields");
125
126 $this->selfassessmenteditingmode = false;
127 $this->new_id_listeners = array();
128 $this->new_id_listener_cnt = 0;
129
130 $this->navigationGUI = null;
131 }
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 449 of file class.assQuestionGUI.php.

450 {
451 return $q_type . "GUI";
452 }

Referenced by _getGUIClassNameForId().

+ Here is the caller graph for this function:

◆ _getGUIClassNameForId()

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

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

438 {
439 include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
440 include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
441 $q_type = assQuestion::getQuestionTypeFromDb($a_q_id);
442 $class_name = assQuestionGUI::_getClassNameForQType($q_type);
443 return $class_name;
444 }
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 405 of file class.assQuestionGUI.php.

406 {
407 global $ilCtrl, $ilDB, $lng;
408
409 include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
410
411 if ((!$question_type) and ($question_id > 0))
412 {
413 $question_type = assQuestion::getQuestionTypeFromDb($question_id);
414 }
415
416 if (strlen($question_type) == 0) return NULL;
417
418 assQuestion::_includeClass($question_type, 1);
419
420 $question_type_gui = assQuestion::getGuiClassNameByQuestionType($question_type);
421 $question = new $question_type_gui();
422
423 $feedbackObjectClassname = assQuestion::getFeedbackClassNameByQuestionType($question_type);
424 $question->object->feedbackOBJ = new $feedbackObjectClassname($question->object, $ilCtrl, $ilDB, $lng);
425
426 if ($question_id > 0)
427 {
428 $question->object->loadFromDb($question_id);
429 }
430
431 return $question;
432 }
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 2232 of file class.assQuestionGUI.php.

2233 {
2234 if(($_GET["calling_test"] > 0) || ($_GET["test_ref_id"] > 0))
2235 {
2236 $ref_id = $_GET["calling_test"];
2237 if(strlen($ref_id) == 0) $ref_id = $_GET["test_ref_id"];
2238
2239 if(!$_GET['test_express_mode'] && !$GLOBALS['___test_express_mode'])
2240 {
2241 $ilTabs->setBackTarget($this->lng->txt("backtocallingtest"), "ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=$ref_id");
2242 }
2243 else
2244 {
2246 $ilTabs->setBackTarget($this->lng->txt("backtocallingtest"), $link);
2247 }
2248 }
2249 else if(isset($_GET['calling_consumer']) && (int)$_GET['calling_consumer'])
2250 {
2251 $ref_id = (int)$_GET['calling_consumer'];
2253 if($consumer instanceof ilQuestionEditingFormConsumer)
2254 {
2255 $ilTabs->setBackTarget($consumer->getQuestionEditingFormBackTargetLabel(), $consumer->getQuestionEditingFormBackTarget($_GET['consumer_context']));
2256 }
2257 else
2258 {
2259 require_once 'Services/Link/classes/class.ilLink.php';
2260 $ilTabs->setBackTarget($this->lng->txt("qpl"), ilLink::_getLink($ref_id));
2261 }
2262 }
2263 else
2264 {
2265 $ilTabs->setBackTarget($this->lng->txt("qpl"), $this->ctrl->getLinkTargetByClass("ilobjquestionpoolgui", "questions"));
2266 }
2267 }
$_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)
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
$ref_id
Definition: sahs_server.php:39

References $_GET, $GLOBALS, $ref_id, 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 1156 of file class.assQuestionGUI.php.

1157 {
1158 // title
1159 $title = new ilTextInputGUI($this->lng->txt("title"), "title");
1160 $title->setMaxLength(100);
1161 $title->setValue($this->object->getTitle());
1162 $title->setRequired(TRUE);
1163 $form->addItem($title);
1164
1165 if (!$this->object->getSelfAssessmentEditingMode())
1166 {
1167 // author
1168 $author = new ilTextInputGUI($this->lng->txt("author"), "author");
1169 $author->setValue($this->object->getAuthor());
1170 $author->setRequired(TRUE);
1171 $form->addItem($author);
1172
1173 // description
1174 $description = new ilTextInputGUI($this->lng->txt("description"), "comment");
1175 $description->setValue($this->object->getComment());
1176 $description->setRequired(FALSE);
1177 $form->addItem($description);
1178 }
1179 else
1180 {
1181 // author as hidden field
1182 $hi = new ilHiddenInputGUI("author");
1183 $author = ilUtil::prepareFormOutput($this->object->getAuthor());
1184 if (trim($author) == "")
1185 {
1186 $author = "-";
1187 }
1188 $hi->setValue($author);
1189 $form->addItem($hi);
1190
1191 }
1192
1193 // questiontext
1194 $question = new ilTextAreaInputGUI($this->lng->txt("question"), "question");
1195 $question->setValue($this->object->getQuestion());
1196 $question->setRequired(TRUE);
1197 $question->setRows(10);
1198 $question->setCols(80);
1199
1200 if (!$this->object->getSelfAssessmentEditingMode())
1201 {
1202 if( $this->object->getAdditionalContentEditingMode() != assQuestion::ADDITIONAL_CONTENT_EDITING_MODE_PAGE_OBJECT )
1203 {
1204 $question->setUseRte(TRUE);
1205 include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
1206 $question->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("assessment"));
1207 $question->addPlugin("latex");
1208 $question->addButton("latex");
1209 $question->addButton("pastelatex");
1210 $question->setRTESupport($this->object->getId(), "qpl", "assessment");
1211 }
1212 }
1213 else
1214 {
1215 require_once 'Modules/TestQuestionPool/classes/questions/class.ilAssSelfAssessmentQuestionFormatter.php';
1217 $question->setUseTagsForRteOnly(false);
1218 }
1219 $form->addItem($question);
1220
1221 if (!$this->object->getSelfAssessmentEditingMode())
1222 {
1223 // duration
1224 $duration = new ilDurationInputGUI($this->lng->txt("working_time"), "Estimated");
1225 $duration->setShowHours(TRUE);
1226 $duration->setShowMinutes(TRUE);
1227 $duration->setShowSeconds(TRUE);
1228 $ewt = $this->object->getEstimatedWorkingTime();
1229 $duration->setHours($ewt["h"]);
1230 $duration->setMinutes($ewt["m"]);
1231 $duration->setSeconds($ewt["s"]);
1232 $duration->setRequired(FALSE);
1233 $form->addItem($duration);
1234 }
1235 else
1236 {
1237 // number of tries
1238 if (strlen($this->object->getNrOfTries()))
1239 {
1240 $nr_tries = $this->object->getNrOfTries();
1241 }
1242 else
1243 {
1244 $nr_tries = $this->object->getDefaultNrOfTries();
1245 }
1246 if ($nr_tries < 1)
1247 {
1248 $nr_tries = "";
1249 }
1250
1251 $ni = new ilNumberInputGUI($this->lng->txt("qst_nr_of_tries"), "nr_of_tries");
1252 $ni->setValue($nr_tries);
1253 $ni->setMinValue(0);
1254 $ni->setSize(5);
1255 $ni->setMaxLength(5);
1256 $form->addItem($ni);
1257 }
1258 }
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

References $duration, $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 1064 of file class.assQuestionGUI.php.

1065 {
1066 $this->errormessage .= ((strlen($this->errormessage)) ? "<br />" : "") . $errormessage;
1067 }

References $errormessage.

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

+ Here is the caller graph for this function:

◆ addGIT()

assQuestionGUI::addGIT ( )

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

1905 {
1906 $subquestion_index = 0;
1907 if (strlen($_GET["subquestion_index"]) && $_GET["subquestion_index"] >= 0)
1908 {
1909 $subquestion_index = $_GET["subquestion_index"];
1910 }
1911 $this->object->saveSuggestedSolution("git", "il__git_" . $_GET["git"], $subquestion_index);
1912 ilUtil::sendSuccess($this->lng->txt("suggested_solution_added_successfully"), TRUE);
1913 $this->ctrl->redirect($this, "suggestedsolution");
1914 }
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 1108 of file class.assQuestionGUI.php.

1109 {
1110 $cnt = $this->new_id_listener_cnt;
1111 $this->new_id_listeners[$cnt]["object"] =& $a_object;
1112 $this->new_id_listeners[$cnt]["method"] = $a_method;
1113 $this->new_id_listeners[$cnt]["parameters"] = $a_parameters;
1114 $this->new_id_listener_cnt++;
1115 }

◆ addPG()

assQuestionGUI::addPG ( )

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

1881 {
1882 $subquestion_index = 0;
1883 if (strlen($_GET["subquestion_index"]) && $_GET["subquestion_index"] >= 0)
1884 {
1885 $subquestion_index = $_GET["subquestion_index"];
1886 }
1887 $this->object->saveSuggestedSolution("pg", "il__pg_" . $_GET["pg"], $subquestion_index);
1888 ilUtil::sendSuccess($this->lng->txt("suggested_solution_added_successfully"), TRUE);
1889 $this->ctrl->redirect($this, "suggestedsolution");
1890 }

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

1141 {
1142 //if (!$this->object->getSelfAssessmentEditingMode() && !$_GET["calling_test"]) $form->addCommandButton("saveEdit", $this->lng->txt("save_edit"));
1143 if(!$this->object->getSelfAssessmentEditingMode())
1144 {
1145 $form->addCommandButton("saveReturn", $this->lng->txt("save_return"));
1146 }
1147 $form->addCommandButton("save", $this->lng->txt("save"));
1148 }

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

1893 {
1894 $subquestion_index = 0;
1895 if (strlen($_GET["subquestion_index"]) && $_GET["subquestion_index"] >= 0)
1896 {
1897 $subquestion_index = $_GET["subquestion_index"];
1898 }
1899 $this->object->saveSuggestedSolution("st", "il__st_" . $_GET["st"], $subquestion_index);
1900 ilUtil::sendSuccess($this->lng->txt("suggested_solution_added_successfully"), TRUE);
1901 $this->ctrl->redirect($this, "suggestedsolution");
1902 }

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

2052 {
2053 global $ilCtrl;
2054
2055 require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionFeedbackEditingGUI.php';
2056 $tabCommands = self::getCommandsFromClassConstants('ilAssQuestionFeedbackEditingGUI');
2057
2058 $tabLink = $ilCtrl->getLinkTargetByClass('ilAssQuestionFeedbackEditingGUI', ilAssQuestionFeedbackEditingGUI::CMD_SHOW);
2059
2060 $tabs->addTarget('tst_feedback', $tabLink, $tabCommands, $ilCtrl->getCmdClass(), '');
2061 }
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...
addTarget($a_text, $a_link, $a_cmd="", $a_cmdClass="", $a_frame="", $a_activate=false, $a_dir_text=false)

References $ilCtrl, ilTabsGUI\addTarget(), 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 2082 of file class.assQuestionGUI.php.

2083 {
2084 global $ilCtrl;
2085
2086 require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintsGUI.php';
2087
2088 switch( $ilCtrl->getCmdClass() )
2089 {
2090 case 'ilassquestionhintsgui':
2091
2092 $tabCommands = self::getCommandsFromClassConstants('ilAssQuestionHintsGUI');
2093 break;
2094
2095 case 'ilassquestionhintgui':
2096
2097 require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintGUI.php';
2098 $tabCommands = self::getCommandsFromClassConstants('ilAssQuestionHintGUI');
2099 break;
2100
2101 default:
2102
2103 $tabCommands = array();
2104 }
2105
2106 $tabLink = $ilCtrl->getLinkTargetByClass('ilAssQuestionHintsGUI', ilAssQuestionHintsGUI::CMD_SHOW_LIST);
2107
2108 $tabs->addTarget('tst_question_hints_tab', $tabLink, $tabCommands, $ilCtrl->getCmdClass(), '');
2109 }
const CMD_SHOW_LIST
command constants

References $ilCtrl, ilTabsGUI\addTarget(), 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

◆ addTab_SuggestedSolution()

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

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

2016 {
2017 if ($_GET["q_id"])
2018 {
2019 $tabs->addTarget("suggested_solution",
2020 $this->ctrl->getLinkTargetByClass($classname, "suggestedsolution"),
2021 array("suggestedsolution", "saveSuggestedSolution", "outSolutionExplorer", "cancel",
2022 "addSuggestedSolution","cancelExplorer", "linkChilds", "removeSuggestedSolution"
2023 ),
2024 $classname,
2025 ""
2026 );
2027 }
2028 }

References $_GET, and ilTabsGUI\addTarget().

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 call graph for this function:
+ Here is the caller graph for this function:

◆ apply()

assQuestionGUI::apply ( )

apply changes

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

1001 {
1002 $this->writePostData();
1003 $this->object->saveToDb();
1004 $this->ctrl->setParameter($this, "q_id", $this->object->getId());
1005 $this->editQuestion();
1006 }
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 2293 of file class.assQuestionGUI.php.

2294 {
2295 require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
2296 $form = new ilPropertyFormGUI();
2297
2298 $form->setFormAction($this->ctrl->getFormAction($this));
2299
2300 $form->setId($this->getType());
2301 $form->setTitle($this->outQuestionType());
2302
2303 $form->setTableWidth('100%');
2304
2305 $form->setMultipart(true);
2306
2307 return $form;
2308 }
getType()
needed for page editor compliance
This class represents a property form user interface.

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

2320 {
2321 $errors = $this->editQuestion(true); // TODO bheyser: editQuestion should be added to the abstract base class with a unified signature
2322 return $this->editForm;
2323 }
$errors

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

1121 {
1122
1123 for ($i=0; $i<$this->new_id_listener_cnt; $i++)
1124 {
1125 $this->new_id_listeners[$i]["parameters"]["new_id"] = $a_new_id;
1126 $object =& $this->new_id_listeners[$i]["object"];
1127 $method = $this->new_id_listeners[$i]["method"];
1128 $parameters = $this->new_id_listeners[$i]["parameters"];
1129//var_dump($object);
1130//var_dump($method);
1131//var_dump($parameters);
1132
1133 $object->$method($parameters);
1134 }
1135 }

References $object.

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

+ Here is the caller graph for this function:

◆ cancel()

assQuestionGUI::cancel ( )

cancel action

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

608 {
609 if ($_GET["calling_test"])
610 {
611 $_GET["ref_id"] = $_GET["calling_test"];
612 ilUtil::redirect("ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=".$_GET["calling_test"]);
613 }
614 elseif ($_GET["test_ref_id"])
615 {
616 $_GET["ref_id"] = $_GET["test_ref_id"];
617 ilUtil::redirect("ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=".$_GET["test_ref_id"]);
618 }
619 else
620 {
621 if ($_GET["q_id"] > 0)
622 {
623 $this->ctrl->setParameterByClass("ilAssQuestionPageGUI", "q_id", $_GET["q_id"]);
624 $this->ctrl->redirectByClass("ilAssQuestionPageGUI", "edit");
625 }
626 else
627 {
628 $this->ctrl->redirectByClass("ilobjquestionpoolgui", "questions");
629 }
630 }
631 }
static redirect($a_script)
http redirect to other script

References $_GET, and ilUtil\redirect().

+ Here is the call graph for this function:

◆ cancelExplorer()

assQuestionGUI::cancelExplorer ( )

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

1721 {
1722 $this->ctrl->redirect($this, "suggestedsolution");
1723 }

◆ cancelSync()

assQuestionGUI::cancelSync ( )

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

703 {
704 if (strlen($_GET["return_to"]))
705 {
706 $this->ctrl->redirect($this, $_GET["return_to"]);
707 }
708 if(strlen($_REQUEST['return_to_fb']))
709 {
710 $this->ctrl->redirectByClass('ilAssQuestionFeedbackEditingGUI', 'showFeedbackForm');
711 }
712 else
713 {
714 if(isset($_GET['calling_consumer']) && (int)$_GET['calling_consumer'])
715 {
716 $ref_id = (int)$_GET['calling_consumer'];
718 if($consumer instanceof ilQuestionEditingFormConsumer)
719 {
720 ilUtil::redirect($consumer->getQuestionEditingFormBackTarget($_GET['consumer_context']));
721 }
722 require_once 'Services/Link/classes/class.ilLink.php';
724 }
725 $_GET["ref_id"] = $_GET["calling_test"];
726
727 if($_REQUEST['test_express_mode'])
728 {
730 }
731 else
732 {
733 ilUtil::redirect("ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=".$_GET["calling_test"]);
734 }
735 }
736 }

References $_GET, $ref_id, 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 2205 of file class.assQuestionGUI.php.

2207 {
2208 return $formAction;
2209 }

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

467 {
468 include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
469 $this->question =& assQuestionGUI::_getQuestionGUI($question_type, $question_id);
470 }
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 136 of file class.assQuestionGUI.php.

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

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

+ Here is the call graph for this function:

◆ getAdditionalEditQuestionCommands()

assQuestionGUI::getAdditionalEditQuestionCommands ( )
protected

Reimplemented in assKprimChoiceGUI.

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

2041 {
2042 return array();
2043 }

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

1318 {
1319 return $this->getGenericFeedbackOutput($active_id, $pass);
1320 }
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 1093 of file class.assQuestionGUI.php.

1094 {
1095 $result = "";
1096 if (strlen($a_value))
1097 {
1098 $result = " value=\"$a_value\" ";
1099 }
1100 return $result;
1101 }
$result

References $result.

◆ getBasicEditQuestionTabCommands()

assQuestionGUI::getBasicEditQuestionTabCommands ( )
protected

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

2036 {
2037 return array('editQuestion', 'save', 'saveEdit', 'originalSyncForm');
2038 }

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

166 {
167 return $cmd;
168 }

References $cmd.

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

1930 {
1931 $reflectionClass = new ReflectionClass($guiClassName);
1932
1933 $commands = null;
1934
1935 if( $reflectionClass instanceof ReflectionClass )
1936 {
1937 $commands = array();
1938
1939 foreach($reflectionClass->getConstants() as $constName => $constValue)
1940 {
1941 if( substr($constName, 0, strlen($cmdConstantNameBegin)) == $cmdConstantNameBegin )
1942 {
1943 $commands[] = $constValue;
1944 }
1945 }
1946 }
1947
1948 return $commands;
1949 }

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

1015 {
1016 $path = "";
1017
1018 $tmpPath = $cont_obj->getLMTree()->getPathFull($a_endnode_id, $a_startnode_id);
1019
1020 // count -1, to exclude the learning module itself
1021 for ($i = 1; $i < (count($tmpPath) - 1); $i++)
1022 {
1023 if ($path != "")
1024 {
1025 $path .= " > ";
1026 }
1027
1028 $path .= $tmpPath[$i]["title"];
1029 }
1030
1031 return $path;
1032 }
$path
Definition: aliased.php:25

References $path.

Referenced by outPageSelector().

+ Here is the caller graph for this function:

◆ getEditContext()

assQuestionGUI::getEditContext ( )
Returns
string

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

259 {
260 return $this->editContext;
261 }

References $editContext.

Referenced by isAdjustmentEditContext(), and isAuthoringEditContext().

+ Here is the caller graph for this function:

◆ getEditQuestionTabCommands()

assQuestionGUI::getEditQuestionTabCommands ( )
final

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

2031 {
2032 return array_merge($this->getBasicEditQuestionTabCommands(), $this->getAdditionalEditQuestionCommands());
2033 }

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

1055 {
1056 return $this->errormessage;
1057 }

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

2225 {
2227 }

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

1332 {
1333 $output = "";
1334 include_once "./Modules/Test/classes/class.ilObjTest.php";
1335 $manual_feedback = ilObjTest::getManualFeedback($active_id, $this->object->getId(), $pass);
1336 if (strlen($manual_feedback))
1337 {
1338 return $manual_feedback;
1339 }
1340 $correct_feedback = $this->object->feedbackOBJ->getGenericFeedbackTestPresentation($this->object->getId(), true);
1341 $incorrect_feedback = $this->object->feedbackOBJ->getGenericFeedbackTestPresentation($this->object->getId(), false);
1342 if (strlen($correct_feedback.$incorrect_feedback))
1343 {
1344 $reached_points = $this->object->calculateReachedPoints($active_id, $pass);
1345 $max_points = $this->object->getMaximumPoints();
1346 if ($reached_points == $max_points)
1347 {
1348 $output = $correct_feedback;
1349 }
1350 else
1351 {
1352 $output = $incorrect_feedback;
1353 }
1354 }
1355 return $this->object->prepareTextareaOutput($output, TRUE);
1356 }
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 1358 of file class.assQuestionGUI.php.

1359 {
1360 return $this->object->prepareTextareaOutput(
1361 $this->object->feedbackOBJ->getGenericFeedbackTestPresentation($this->object->getId(), true), true
1362 );
1363 }

◆ getGenericFeedbackOutputForIncorrectSolution()

assQuestionGUI::getGenericFeedbackOutputForIncorrectSolution ( )

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

1366 {
1367 return $this->object->prepareTextareaOutput(
1368 $this->object->feedbackOBJ->getGenericFeedbackTestPresentation($this->object->getId(), false), true
1369 );
1370 }

◆ getILIASPage()

assQuestionGUI::getILIASPage (   $html = "")

Returns the ILIAS Page around a question.

Returns
string The ILIAS page content @access public

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

515 {
516 include_once("./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php");
517 $page_gui = new ilAssQuestionPageGUI($this->object->getId());
518 $page_gui->setQuestionHTML(array($this->object->getId() => $html));
519 $page_gui->setOutputMode("presentation");
520 $presentation = $page_gui->presentation();
521 $presentation = preg_replace("/src=\"\\.\\//ims", "src=\"" . ILIAS_HTTP_PATH . "/", $presentation);
522 return $presentation;
523 }
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 295 of file class.assQuestionGUI.php.

296 {
298 }

References $navigationGUI.

Referenced by outQuestionPage().

+ Here is the caller graph for this function:

◆ getPresentationContext()

assQuestionGUI::getPresentationContext ( )
Returns
string

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

182 {
184 }

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

595 {
596 $tpl = new ilTemplate('tpl.tst_question_additional_behaviour_checkbox.html', true, true, 'Modules/TestQuestionPool');
597 // hey: prevPassSolutions - use abtract template
598 $tpl->setVariable('TXT_FORCE_FORM_DIFF_LABEL', $this->lng->txt('use_previous_solution'));
599 // hey.
600 return $tpl->get();
601 }
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 589 of file class.assQuestionGUI.php.

590 {
591 return $this->lng->txt('use_previous_solution_advice');
592 }

Referenced by outQuestionPage().

+ Here is the caller graph for this function:

◆ getQuestionActionCmd()

◆ getQuestionCount()

assQuestionGUI::getQuestionCount ( )

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

1050 {
1051 return $this->question_count;
1052 }
$question_count
question count in test

References $question_count.

◆ getQuestionHeaderBlockBuilder()

assQuestionGUI::getQuestionHeaderBlockBuilder ( )
Returns
\ilQuestionHeaderBlockBuilder $questionHeaderBlockBuilder

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

481 {
482 // @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)
483 if(!$this->tpl->blockExists('content'))
484 {
485 $this->tpl->addBlockFile("CONTENT", "content", "tpl.il_as_qpl_content.html", "Modules/TestQuestionPool");
486 }
487 // @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)
488 if(!$this->tpl->blockExists('statusline'))
489 {
490 $this->tpl->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html");
491 }
492 // @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
493 if(!$this->tpl->blockExists('adm_content'))
494 {
495 $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_question.html", "Modules/TestQuestionPool");
496 }
497 }

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

1082 {
1083 return $this->object->getQuestionType();
1084 }

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

+ Here is the caller graph for this function:

◆ getRenderPurpose()

assQuestionGUI::getRenderPurpose ( )
Returns
string

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

203 {
205 }

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

1040 {
1041 return $this->sequence_no;
1042 }
$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 313 of file class.assQuestionGUI.php.

314 {
315 return $this->taxonomyIds;
316 }

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

174 {
175 return $this->getQuestionType();
176 }
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 ( )
private

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

579 {
580 // hey: prevPassSolutions - use abstracted template to share with other purposes of this kind
581 $tpl = new ilTemplate('tpl.tst_question_additional_behaviour_checkbox.html', true, true, 'Modules/TestQuestionPool');
582 $tpl->setVariable('TXT_FORCE_FORM_DIFF_LABEL', $this->object->getTestPresentationConfig()->getUseUnchangedAnswerLabel());
583 // hey.
584 return $tpl->get();
585 }

References $tpl.

Referenced by outQuestionPage().

+ Here is the caller graph for this function:

◆ hasCorrectSolution()

◆ isAdjustmentEditContext()

assQuestionGUI::isAdjustmentEditContext ( )
Parameters
bool$isAdjustmentEditContext

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

283 {
285 }

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

275 {
277 }

References EDIT_CONTEXT_AUTHORING, and getEditContext().

+ Here is the call graph for this function:

◆ isAutosaveable()

assQuestionGUI::isAutosaveable ( )

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

2144 {
2145 return $this->object->isAutosaveable();
2146 }

◆ isRenderPurposeDemoplay()

assQuestionGUI::isRenderPurposeDemoplay ( )

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

226 {
228 }

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

231 {
233 }

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

221 {
223 }

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

1858 {
1859 $this->ctrl->saveParameter($this, array("subquestion_index", "link_new_type", "search_link_type"));
1860 switch ($_GET["search_link_type"])
1861 {
1862 case "pg":
1863 return $this->outPageSelector();
1864 break;
1865 case "st":
1866 return $this->outChapterSelector();
1867 break;
1868 case "glo":
1869 return $this->outGlossarySelector();
1870 break;
1871 case "lm":
1872 $subquestion_index = ($_GET["subquestion_index"] > 0) ? $_GET["subquestion_index"] : 0;
1873 $this->object->saveSuggestedSolution("lm", "il__lm_" . $_GET["source_id"], $subquestion_index);
1874 ilUtil::sendSuccess($this->lng->txt("suggested_solution_added_successfully"), TRUE);
1875 $this->ctrl->redirect($this, "suggestedsolution");
1876 break;
1877 }
1878 }

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

2212 {
2213 return;
2214 }

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

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

Referenced by suggestedsolution().

+ Here is the caller graph for this function:

◆ outAdditionalOutput()

assQuestionGUI::outAdditionalOutput ( )

Reimplemented in assTextQuestionGUI.

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

1070 {
1071 }

◆ outChapterSelector()

assQuestionGUI::outChapterSelector ( )

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

1793 {
1794 require_once 'Modules/TestQuestionPool/classes/tables/class.ilQuestionInternalLinkSelectionTableGUI.php';
1795 require_once 'Modules/LearningModule/classes/class.ilObjContentObjectGUI.php';
1796
1797 $this->ctrl->setParameter($this, 'q_id', $this->object->getId());
1798
1799 $cont_obj_gui = new ilObjContentObjectGUI('', $_GET['source_id'], true);
1800 $cont_obj = $cont_obj_gui->object;
1801 $ctree = $cont_obj->getLMTree();
1802 $nodes = $ctree->getSubtree($ctree->getNodeData($ctree->getRootId()));
1803
1804 $rows = array();
1805
1806 foreach($nodes as $node)
1807 {
1808 if($node['type'] == $_GET['search_link_type'])
1809 {
1810 $this->ctrl->setParameter($this, $node['type'], $node['obj_id']);
1811 $rows[] = array(
1812 'title' => $node['title'],
1813 'description' => '',
1814 'text_add' => $this->lng->txt('add'),
1815 'href_add' => $this->ctrl->getLinkTarget($this, 'add' . strtoupper($node['type']))
1816 );
1817 }
1818 }
1819
1820 $table = new ilQuestionInternalLinkSelectionTableGUI($this, 'cancelExplorer', __METHOD__);
1821 $table->setTitle($this->lng->txt('obj_' . ilUtil::stripSlashes($_GET['search_link_type'])));
1822 $table->setData($rows);
1823
1824 $this->tpl->setContent($table->getHTML());
1825 }
Class ilObjContentObjectGUI.

References $_GET, 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 1827 of file class.assQuestionGUI.php.

1828 {
1829 require_once 'Modules/TestQuestionPool/classes/tables/class.ilQuestionInternalLinkSelectionTableGUI.php';
1830 require_once 'Modules/Glossary/classes/class.ilObjGlossary.php';
1831
1832 $this->ctrl->setParameter($this, 'q_id', $this->object->getId());
1833
1834 $glossary = new ilObjGlossary($_GET['source_id'], true);
1835 $terms = $glossary->getTermList();
1836
1837 $rows = array();
1838
1839 foreach($terms as $term)
1840 {
1841 $this->ctrl->setParameter($this, 'git', $term['id']);
1842 $rows[] = array(
1843 'title' => $term['term'],
1844 'description' => '',
1845 'text_add' => $this->lng->txt('add'),
1846 'href_add' => $this->ctrl->getLinkTarget($this, 'addGIT')
1847 );
1848 }
1849
1850 $table = new ilQuestionInternalLinkSelectionTableGUI($this, 'cancelExplorer', __METHOD__);
1851 $table->setTitle($this->lng->txt('glossary_term'));
1852 $table->setData($rows);
1853
1854 $this->tpl->setContent($table->getHTML());
1855 }
Class ilObjGlossary.

References $_GET.

Referenced by linkChilds().

+ Here is the caller graph for this function:

◆ outPageSelector()

assQuestionGUI::outPageSelector ( )

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

1726 {
1727 require_once 'Modules/TestQuestionPool/classes/tables/class.ilQuestionInternalLinkSelectionTableGUI.php';
1728 require_once 'Modules/LearningModule/classes/class.ilLMPageObject.php';
1729 require_once 'Modules/LearningModule/classes/class.ilObjContentObjectGUI.php';
1730
1731 $this->ctrl->setParameter($this, 'q_id', $this->object->getId());
1732
1733 $cont_obj_gui = new ilObjContentObjectGUI('', $_GET['source_id'], true);
1734 $cont_obj = $cont_obj_gui->object;
1735 $pages = ilLMPageObject::getPageList($cont_obj->getId());
1736 $shownpages = array();
1737 $tree = $cont_obj->getLMTree();
1738 $chapters = $tree->getSubtree($tree->getNodeData($tree->getRootId()));
1739
1740 $rows = array();
1741
1742 foreach($chapters as $chapter)
1743 {
1744 $chapterpages = $tree->getChildsByType($chapter['obj_id'], 'pg');
1745 foreach($chapterpages as $page)
1746 {
1747 if($page['type'] == $_GET['search_link_type'])
1748 {
1749 array_push($shownpages, $page['obj_id']);
1750
1751 if($tree->isInTree($page['obj_id']))
1752 {
1753 $path_str = $this->getContextPath($cont_obj, $page['obj_id']);
1754 }
1755 else
1756 {
1757 $path_str = '---';
1758 }
1759
1760 $this->ctrl->setParameter($this, $page['type'], $page['obj_id']);
1761 $rows[] = array(
1762 'title' => $page['title'],
1763 'description' => ilUtil::prepareFormOutput($path_str),
1764 'text_add' => $this->lng->txt('add'),
1765 'href_add' => $this->ctrl->getLinkTarget($this, 'add' . strtoupper($page['type']))
1766 );
1767 }
1768 }
1769 }
1770 foreach($pages as $page)
1771 {
1772 if(!in_array($page['obj_id'], $shownpages))
1773 {
1774 $this->ctrl->setParameter($this, $page['type'], $page['obj_id']);
1775 $rows[] = array(
1776 'title' => $page['title'],
1777 'description' => '---',
1778 'text_add' => $this->lng->txt('add'),
1779 'href_add' => $this->ctrl->getLinkTarget($this, 'add' . strtoupper($page['type']))
1780 );
1781 }
1782 }
1783
1784 require_once 'Modules/TestQuestionPool/classes/tables/class.ilQuestionInternalLinkSelectionTableGUI.php';
1785 $table = new ilQuestionInternalLinkSelectionTableGUI($this, 'cancelExplorer', __METHOD__);
1786 $table->setTitle($this->lng->txt('obj_' . ilUtil::stripSlashes($_GET['search_link_type'])));
1787 $table->setData($rows);
1788
1789 $this->tpl->setContent($table->getHTML());
1790 }
getContextPath($cont_obj, $a_endnode_id, $a_startnode_id=1)
get context path in content object tree
static getPageList($lm_id)
static

References $_GET, 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 2175 of file class.assQuestionGUI.php.

2185 {
2186 $formaction = $this->completeTestOutputFormAction($formaction, $active_id, $pass);
2187
2188 $test_output = $this->getTestOutput(
2189 $active_id,
2190 $pass,
2191 $is_question_postponed,
2192 $user_post_solutions,
2193 $show_specific_inline_feedback
2194 );
2195
2196 $this->magicAfterTestOutput();
2197
2198 $this->tpl->setVariable("QUESTION_OUTPUT", $test_output);
2199 $this->tpl->setVariable("FORMACTION", $formaction);
2200 $this->tpl->setVariable("ENCTYPE", 'enctype="'.$this->getFormEncodingType().'"');
2201 $this->tpl->setVariable("FORM_TIMESTAMP", time());
2202 }
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 528 of file class.assQuestionGUI.php.

529 {
530 // hey: prevPassSolutions - add the "use previous answer"
531 // hey: prevPassSolutions - refactored identifiers
532 if( $this->object->getTestPresentationConfig()->isSolutionInitiallyPrefilled() )
533 // hey
534 {
537 }
538 else /* if( ...->isUnchangedAnswerPossible() ) --> */
539 // hey.
540// fau: testNav - add the "use unchanged answer checkbox"
541 // hey: prevPassSolutions - refactored identifiers
542 if ($this->object->getTestPresentationConfig()->isUnchangedAnswerPossible())
543 // hey.
544 {
546 }
547// fau.
548
549 $this->lng->loadLanguageModule("content");
550
551// fau: testNav - add question buttons below question, add actions menu
552 include_once("./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php");
553 $page_gui = new ilAssQuestionPageGUI($this->object->getId());
554 $page_gui->setOutputMode("presentation");
555 $page_gui->setTemplateTargetVar($a_temp_var);
556
557 if( $this->getNavigationGUI() )
558 {
559 $html .= $this->getNavigationGUI()->getHTML();
560 $page_gui->setQuestionActionsHTML($this->getNavigationGUI()->getActionsHTML());
561 }
562// fau.
563
564 if( strlen($html) )
565 {
566 $page_gui->setQuestionHTML(array($this->object->getId() => $html));
567 }
568
569// fau: testNav - fill the header with subtitle blocks for question info an actions
570 $page_gui->setPresentationTitle($this->questionHeaderBlockBuilder->getPresentationTitle());
571 $page_gui->setQuestionInfoHTML($this->questionHeaderBlockBuilder->getQuestionInfoHTML());
572// fau.
573
574 return $page_gui->presentation();
575 }
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(), assMultipleChoiceGUI\getTestOutput(), assKprimChoiceGUI\getTestOutput(), assNumericGUI\getTestOutput(), assFileUploadGUI\getTestOutput(), assFlashQuestionGUI\getTestOutput(), assFormulaQuestionGUI\getTestOutput(), assImagemapQuestionGUI\getTestOutput(), assJavaAppletGUI\getTestOutput(), assLongMenuGUI\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 1385 of file class.assQuestionGUI.php.

1386 {
1387 $count = $this->object->isInUse();
1388
1389 if ($this->object->_questionExistsInPool($this->object->getId()) && $count)
1390 {
1391 global $rbacsystem;
1392 if ($rbacsystem->checkAccess("write", $_GET["ref_id"]))
1393 {
1394 ilUtil::sendInfo(sprintf($this->lng->txt("qpl_question_is_in_use"), $count));
1395 }
1396 }
1397
1398 return assQuestion::_getQuestionTypeName($this->object->getQuestionType());
1399 }
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 1644 of file class.assQuestionGUI.php.

1645 {
1646 global $tree;
1647
1648 include_once("./Modules/TestQuestionPool/classes/class.ilSolutionExplorer.php");
1649 $type = $_GET["link_new_type"];
1650 $search = $_GET["search_link_type"];
1651 $this->ctrl->setParameter($this, "link_new_type", $type);
1652 $this->ctrl->setParameter($this, "search_link_type", $search);
1653 $this->ctrl->saveParameter($this, array("subquestion_index", "link_new_type", "search_link_type"));
1654
1655 ilUtil::sendInfo($this->lng->txt("select_object_to_link"));
1656
1657 $parent_ref_id = $tree->getParentId($_GET["ref_id"]);
1658 $exp = new ilSolutionExplorer($this->ctrl->getLinkTarget($this, 'suggestedsolution'), get_class($this));
1659 $exp->setExpand($_GET['expand_sol'] ? $_GET['expand_sol'] : $parent_ref_id);
1660 $exp->setExpandTarget($this->ctrl->getLinkTarget($this, 'outSolutionExplorer'));
1661 $exp->setTargetGet("ref_id");
1662 $exp->setRefId($_GET["ref_id"]);
1663 $exp->addFilter($type);
1664 $exp->setSelectableType($type);
1665 if(isset($_GET['expandCurrentPath']) && $_GET['expandCurrentPath'])
1666 {
1667 $exp->expandPathByRefId($parent_ref_id);
1668 }
1669
1670 // build html-output
1671 $exp->setOutput(0);
1672
1673 $template = new ilTemplate("tpl.il_as_qpl_explorer.html", TRUE, TRUE, "Modules/TestQuestionPool");
1674 $template->setVariable("EXPLORER_TREE",$exp->getOutput());
1675 $template->setVariable("BUTTON_CANCEL",$this->lng->txt("cancel"));
1676 $template->setVariable("FORMACTION",$this->ctrl->getFormAction($this, "suggestedsolution"));
1677 $this->tpl->setVariable("ADM_CONTENT", $template->get());
1678 }

References $_GET, and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ populateJavascriptFilesRequiredForWorkForm()

assQuestionGUI::populateJavascriptFilesRequiredForWorkForm ( ilTemplate  $tpl)

Reimplemented in assMultipleChoiceGUI.

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

473 {
474 $tpl->addJavaScript('Modules/TestQuestionPool/js/ilAssMultipleChoice.js');
475 }

References $tpl.

◆ populateTaxonomyFormSection()

assQuestionGUI::populateTaxonomyFormSection ( ilPropertyFormGUI  $form)
protected

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

1278 {
1279 if( count($this->getTaxonomyIds()) )
1280 {
1281 $sectHeader = new ilFormSectionHeaderGUI();
1282 $sectHeader->setTitle($this->lng->txt('qpl_qst_edit_form_taxonomy_section'));
1283 $form->addItem($sectHeader);
1284
1285 require_once 'Services/Taxonomy/classes/class.ilTaxSelectInputGUI.php';
1286
1287 foreach($this->getTaxonomyIds() as $taxonomyId)
1288 {
1289 $taxonomy = new ilObjTaxonomy($taxonomyId);
1290 $label = sprintf($this->lng->txt('qpl_qst_edit_form_taxonomy'), $taxonomy->getTitle());
1291 $postvar = "tax_node_assign_$taxonomyId";
1292
1293 $taxSelect = new ilTaxSelectInputGUI($taxonomy->getId(), $postvar, true);
1294 $taxSelect->setTitle($label);
1295
1296 require_once 'Services/Taxonomy/classes/class.ilTaxNodeAssignment.php';
1297 $taxNodeAssignments = new ilTaxNodeAssignment(ilObject::_lookupType($this->object->getObjId()), $this->object->getObjId(), 'quest', $taxonomyId);
1298 $assignedNodes = $taxNodeAssignments->getAssignmentsOfItem($this->object->getId());
1299
1300 $taxSelect->setValue(array_map(function($assignedNode) {
1301 return $assignedNode['node_id'];
1302 }, $assignedNodes));
1303 $form->addItem($taxSelect);
1304 }
1305 }
1306 }
This class represents a section header in a property form.
static _lookupType($a_id, $a_reference=false)
lookup object type
addItem($a_item)
Add Item (Property, SectionHeader).
Taxonomy node <-> item assignment.
Select taxonomy nodes input GUI.

References ilObject\_lookupType(), ilPropertyFormGUI\addItem(), 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 502 of file class.assQuestionGUI.php.

503 {
504 $this->getQuestionTemplate();
505 $this->tpl->setVariable("QUESTION_DATA", $form->getHTML());
506 }
getQuestionTemplate()
get question template

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

241 {
242 if( $this->isRenderPurposePrintPdf() )
243 {
244 return false;
245 }
246
247 if( $this->isRenderPurposeInputValue() )
248 {
249 return false;
250 }
251
252 return true;
253 }

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

800 {
801 global $ilUser;
802 $old_id = $_GET["q_id"];
803 $result = $this->writePostData();
804
805 if($result == 0)
806 {
807 $ilUser->setPref("tst_lastquestiontype", $this->object->getQuestionType());
808 $ilUser->writePref("tst_lastquestiontype", $this->object->getQuestionType());
809 $this->object->saveToDb();
810 $originalexists = $this->object->_questionExistsInPool($this->object->original_id);
811
812
813 include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
814 if(($_GET["calling_test"] || (isset($_GET['calling_consumer']) && (int)$_GET['calling_consumer'])) && $originalexists && assQuestion::_isWriteable($this->object->original_id, $ilUser->getId()))
815 {
816 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
817 $this->ctrl->setParameter($this, 'return_to', 'editQuestion');
818 $this->ctrl->redirect($this, "originalSyncForm");
819 return;
820 }
821 elseif($_GET["calling_test"])
822 {
823 require_once 'Modules/Test/classes/class.ilObjTest.php';
824 $test = new ilObjTest($_GET["calling_test"]);
825 if(!assQuestion::_questionExistsInTest($this->object->getId(), $test->getTestId()))
826 {
827 global $tree, $ilDB, $ilPluginAdmin;
828
829 include_once("./Modules/Test/classes/class.ilObjTest.php");
830 $_GET["ref_id"] = $_GET["calling_test"];
831 $test = new ilObjTest($_GET["calling_test"], true);
832
833 require_once 'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
834 $testQuestionSetConfigFactory = new ilTestQuestionSetConfigFactory($tree, $ilDB, $ilPluginAdmin, $test);
835
836 $new_id = $test->insertQuestion(
837 $testQuestionSetConfigFactory->getQuestionSetConfig(), $this->object->getId()
838 );
839
840 if(isset($_REQUEST['prev_qid']))
841 {
842 $test->moveQuestionAfter($this->object->getId() + 1, $_REQUEST['prev_qid']);
843 }
844
845 $this->ctrl->setParameter($this, 'q_id', $new_id);
846 $this->ctrl->setParameter($this, 'calling_test', $_GET['calling_test']);
847 #$this->ctrl->setParameter($this, 'test_ref_id', false);
848 }
849 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
850 $this->ctrl->redirect($this, 'editQuestion');
851
852 }
853 else
854 {
855 $this->callNewIdListeners($this->object->getId());
856
857 if($this->object->getId() != $old_id)
858 {
859 // first save
860 $this->ctrl->setParameterByClass($_GET["cmdClass"], "q_id", $this->object->getId());
861 $this->ctrl->setParameterByClass($_GET["cmdClass"], "sel_question_types", $_GET["sel_question_types"]);
862 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
863
864 //global $___test_express_mode;
868 if($_REQUEST['prev_qid'])
869 {
870 // @todo: bheyser/mbecker wtf? ..... thx@jposselt ....
871 // mbecker: Possible fix: Just instantiate the obj?
872 include_once("./Modules/Test/classes/class.ilObjTest.php");
873 $test = new ilObjTest($_GET["ref_id"], true);
874 $test->moveQuestionAfter($_REQUEST['prev_qid'], $this->object->getId());
875 }
876 if( /*$___test_express_mode || */ $_REQUEST['express_mode'] )
877 {
878 global $tree, $ilDB, $ilPluginAdmin;
879
880 include_once("./Modules/Test/classes/class.ilObjTest.php");
881 $test = new ilObjTest($_GET["ref_id"], true);
882
883 require_once 'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
884 $testQuestionSetConfigFactory = new ilTestQuestionSetConfigFactory($tree, $ilDB, $ilPluginAdmin, $test);
885
886 $test->insertQuestion(
887 $testQuestionSetConfigFactory->getQuestionSetConfig(), $this->object->getId()
888 );
889
890 require_once 'Modules/Test/classes/class.ilTestExpressPage.php';
891 $_REQUEST['q_id'] = $this->object->getId();
893 }
894
895 $this->ctrl->redirectByClass($_GET["cmdClass"], "editQuestion");
896 }
897 if(strcmp($_SESSION["info"], "") != 0)
898 {
899 ilUtil::sendSuccess($_SESSION["info"] . "<br />" . $this->lng->txt("msg_obj_modified"), true);
900 }
901 else
902 {
903 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
904 }
905 $this->ctrl->redirect($this, 'editQuestion');
906 }
907 }
908 }
$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 741 of file class.assQuestionGUI.php.

742 {
743 global $ilUser;
744
745 $result = $this->writePostData();
746 if ($result == 0)
747 {
748 $ilUser->setPref("tst_lastquestiontype", $this->object->getQuestionType());
749 $ilUser->writePref("tst_lastquestiontype", $this->object->getQuestionType());
750 $this->object->saveToDb();
751 $originalexists = $this->object->_questionExists($this->object->original_id);
752 include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
753 if ($_GET["calling_test"] && $originalexists && assQuestion::_isWriteable($this->object->original_id, $ilUser->getId()))
754 {
755 $this->ctrl->redirect($this, "originalSyncForm");
756 }
757 elseif ($_GET["calling_test"])
758 {
759 $_GET["ref_id"] = $_GET["calling_test"];
760 ilUtil::redirect("ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=".$_GET["calling_test"]);
761 return;
762 }
763 elseif ($_GET["test_ref_id"])
764 {
765 global $tree, $ilDB, $ilPluginAdmin;
766
767 include_once ("./Modules/Test/classes/class.ilObjTest.php");
768 $_GET["ref_id"] = $_GET["test_ref_id"];
769 $test = new ilObjTest($_GET["test_ref_id"], true);
770
771 require_once 'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
772 $testQuestionSetConfigFactory = new ilTestQuestionSetConfigFactory($tree, $ilDB, $ilPluginAdmin, $test);
773
774 $test->insertQuestion( $testQuestionSetConfigFactory->getQuestionSetConfig(), $this->object->getId() );
775
776 ilUtil::redirect("ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=".$_GET["test_ref_id"]);
777 }
778 else
779 {
780 $this->ctrl->setParameter($this, "q_id", $this->object->getId());
781 $this->editQuestion();
782 if (strcmp($_SESSION["info"], "") != 0)
783 {
784 ilUtil::sendSuccess($_SESSION["info"] . "<br />" . $this->lng->txt("msg_obj_modified"), false);
785 }
786 else
787 {
788 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), false);
789 }
790 $this->ctrl->setParameterByClass("ilAssQuestionPageGUI", "q_id", $this->object->getId());
791 $this->ctrl->redirectByClass("ilAssQuestionPageGUI", "edit");
792 }
793 }
794 }

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

914 {
915 global $ilUser;
916 $old_id = $_GET["q_id"];
917 $result = $this->writePostData();
918 if($result == 0)
919 {
920 $ilUser->setPref("tst_lastquestiontype", $this->object->getQuestionType());
921 $ilUser->writePref("tst_lastquestiontype", $this->object->getQuestionType());
922 $this->object->saveToDb();
923 $originalexists = $this->object->_questionExistsInPool($this->object->original_id);
924 include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
925 if(($_GET["calling_test"] || (isset($_GET['calling_consumer']) && (int)$_GET['calling_consumer'])) && $originalexists && assQuestion::_isWriteable($this->object->original_id, $ilUser->getId()))
926 {
927 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
928 $this->ctrl->setParameter($this, 'test_express_mode', $_REQUEST['test_express_mode']);
929 $this->ctrl->redirect($this, "originalSyncForm");
930 return;
931 }
932 elseif($_GET["calling_test"])
933 {
934 require_once 'Modules/Test/classes/class.ilObjTest.php';
935 $test = new ilObjTest($_GET["calling_test"]);
936 #var_dump(assQuestion::_questionExistsInTest($this->object->getId(), $test->getTestId()));
937 $q_id = $this->object->getId();
938 if(!assQuestion::_questionExistsInTest($this->object->getId(), $test->getTestId()))
939 {
940 global $tree, $ilDB, $ilPluginAdmin;
941
942 include_once("./Modules/Test/classes/class.ilObjTest.php");
943 $_GET["ref_id"] = $_GET["calling_test"];
944 $test = new ilObjTest($_GET["calling_test"], true);
945
946 require_once 'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
947 $testQuestionSetConfigFactory = new ilTestQuestionSetConfigFactory($tree, $ilDB, $ilPluginAdmin, $test);
948
949 $new_id = $test->insertQuestion(
950 $testQuestionSetConfigFactory->getQuestionSetConfig(), $this->object->getId()
951 );
952
953 $q_id = $new_id;
954 if(isset($_REQUEST['prev_qid']))
955 {
956 $test->moveQuestionAfter($this->object->getId() + 1, $_REQUEST['prev_qid']);
957 }
958
959 $this->ctrl->setParameter($this, 'q_id', $new_id);
960 $this->ctrl->setParameter($this, 'calling_test', $_GET['calling_test']);
961 #$this->ctrl->setParameter($this, 'test_ref_id', false);
962
963 }
964 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
965 if( /*$___test_express_mode || */
966 $_REQUEST['test_express_mode']
967 )
968 {
970 }
971 else
972 {
973 ilUtil::redirect("ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=" . $_GET["calling_test"]);
974 }
975 }
976 else
977 {
978 if($this->object->getId() != $old_id)
979 {
980 $this->callNewIdListeners($this->object->getId());
981 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
982 $this->ctrl->redirectByClass("ilobjquestionpoolgui", "questions");
983 }
984 if(strcmp($_SESSION["info"], "") != 0)
985 {
986 ilUtil::sendSuccess($_SESSION["info"] . "<br />" . $this->lng->txt("msg_obj_modified"), true);
987 }
988 else
989 {
990 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
991 }
992 $this->ctrl->redirectByClass("ilobjquestionpoolgui", "questions");
993 }
994 }
995 }

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

1681 {
1682 global $tree;
1683
1684 include_once("./Modules/TestQuestionPool/classes/class.ilSolutionExplorer.php");
1685 switch ($_POST["solutiontype"])
1686 {
1687 case "lm":
1688 $type = "lm";
1689 $search = "lm";
1690 break;
1691 case "git":
1692 $type = "glo";
1693 $search = "glo";
1694 break;
1695 case "st":
1696 $type = "lm";
1697 $search = "st";
1698 break;
1699 case "pg":
1700 $type = "lm";
1701 $search = "pg";
1702 break;
1703 case "file":
1704 case "text":
1705 return $this->suggestedsolution();
1706 break;
1707 default:
1708 return $this->suggestedsolution();
1709 break;
1710 }
1711 if(isset($_POST['solutiontype']))
1712 {
1713 $this->ctrl->setParameter($this, 'expandCurrentPath', 1);
1714 }
1715 $this->ctrl->setParameter($this, "link_new_type", $type);
1716 $this->ctrl->setParameter($this, "search_link_type", $search);
1717 $this->ctrl->redirect($this, "outSolutionExplorer");
1718 }
$_POST["username"]
suggestedsolution()
Allows to add suggested solutions for questions.

References $_POST, and suggestedsolution().

+ Here is the call graph for this function:

◆ saveTaxonomyAssignments()

assQuestionGUI::saveTaxonomyAssignments ( )
protected

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

1261 {
1262 if( count($this->getTaxonomyIds()) )
1263 {
1264 require_once 'Services/Taxonomy/classes/class.ilTaxAssignInputGUI.php';
1265
1266 foreach($this->getTaxonomyIds() as $taxonomyId)
1267 {
1268 $postvar = "tax_node_assign_$taxonomyId";
1269
1270 $tax_node_assign = new ilTaxAssignInputGUI($taxonomyId, true, '', $postvar);
1271 // TODO: determine tst/qpl when tax assigns become maintainable within tests
1272 $tax_node_assign->saveInput("qpl", $this->object->getObjId(), "quest", $this->object->getId());
1273 }
1274 }
1275 }
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 287 of file class.assQuestionGUI.php.

288 {
289 return $this->setEditContext(self::EDIT_CONTEXT_ADJUSTMENT);
290 }
setEditContext($editContext)

References setEditContext().

+ Here is the call graph for this function:

◆ setEditContext()

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

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

267 {
268 $this->editContext = $editContext;
269 }

References $editContext.

Referenced by setAdjustmentEditContext().

+ Here is the caller graph for this function:

◆ setErrorMessage()

assQuestionGUI::setErrorMessage (   $errormessage)

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

1060 {
1061 $this->errormessage = $errormessage;
1062 }

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

304 {
305 $this->navigationGUI = $navigationGUI;
306 }

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

190 {
191 $this->presentationContext = $presentationContext;
192 }

References $presentationContext.

◆ setPreviewSession()

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

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

2278 {
2279 $this->previewSession = $previewSession;
2280 }

References $previewSession.

◆ setQuestionActionCmd()

assQuestionGUI::setQuestionActionCmd (   $questionActionCmd)

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

352 {
353 $this->questionActionCmd = $questionActionCmd;
354
355 if( is_object($this->object) )
356 {
357 $this->object->questionActionCmd = $questionActionCmd;
358 }
359 }

References $questionActionCmd.

◆ setQuestionCount()

assQuestionGUI::setQuestionCount (   $a_question_count)

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

1045 {
1046 $this->question_count = $a_question_count;
1047 }

◆ setQuestionHeaderBlockBuilder()

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

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

337 {
338 $this->questionHeaderBlockBuilder = $questionHeaderBlockBuilder;
339 }

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

1952 {
1953 global $rbacsystem, $ilTabs;
1954
1955 $ilTabs->clearTargets();
1956
1957 $this->ctrl->setParameterByClass("ilAssQuestionPageGUI", "q_id", $_GET["q_id"]);
1958 include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
1959 $q_type = $this->object->getQuestionType();
1960
1961 if (strlen($q_type))
1962 {
1963 $classname = $q_type . "GUI";
1964 $this->ctrl->setParameterByClass(strtolower($classname), "sel_question_types", $q_type);
1965 $this->ctrl->setParameterByClass(strtolower($classname), "q_id", $_GET["q_id"]);
1966 }
1967
1968 if ($_GET["q_id"])
1969 {
1970 if ($rbacsystem->checkAccess('write', $_GET["ref_id"]))
1971 {
1972 // edit page
1973 $ilTabs->addTarget("edit_page",
1974 $this->ctrl->getLinkTargetByClass("ilAssQuestionPageGUI", "edit"),
1975 array("edit", "insert", "exec_pg"),
1976 "", "", $force_active);
1977 }
1978
1979 $this->addTab_QuestionPreview($ilTabs);
1980 }
1981 $force_active = false;
1982 if ($rbacsystem->checkAccess('write', $_GET["ref_id"]))
1983 {
1984 $url = "";
1985 if ($classname) $url = $this->ctrl->getLinkTargetByClass($classname, "editQuestion");
1986 $force_active = false;
1987 // edit question properties
1988 $ilTabs->addTarget("edit_question",
1989 $url,
1991 $classname, "", $force_active);
1992 }
1993
1994 // add tab for question feedback within common class assQuestionGUI
1995 $this->addTab_QuestionFeedback($ilTabs);
1996
1997 // add tab for question hint within common class assQuestionGUI
1998 $this->addTab_QuestionHints($ilTabs);
1999
2000 // add tab for question's suggested solution within common class assQuestionGUI
2001 $this->addTab_SuggestedSolution($ilTabs, $classname);
2002
2003 // Assessment of questions sub menu entry
2004 if ($_GET["q_id"])
2005 {
2006 $ilTabs->addTarget("statistics",
2007 $this->ctrl->getLinkTargetByClass($classname, "assessment"),
2008 array("assessment"),
2009 $classname, "");
2010 }
2011
2012 $this->addBackTab($ilTabs);
2013 }
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
Definition: shib_logout.php:72

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

211 {
212 $this->renderPurpose = $renderPurpose;
213 }

References $renderPurpose.

Referenced by suggestedsolution().

+ Here is the caller graph for this function:

◆ setSequenceNumber()

assQuestionGUI::setSequenceNumber (   $nr)

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

1035 {
1036 $this->sequence_no = $nr;
1037 }

◆ setTargetGui()

assQuestionGUI::setTargetGui (   $linkTargetGui)

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

319 {
320 $this->setTargetGuiClass( get_class($linkTargetGui) );
321 }
setTargetGuiClass($targetGuiClass)

References setTargetGuiClass().

+ Here is the call graph for this function:

◆ setTargetGuiClass()

assQuestionGUI::setTargetGuiClass (   $targetGuiClass)

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

324 {
325 $this->targetGuiClass = $targetGuiClass;
326 }

References $targetGuiClass.

Referenced by setTargetGui().

+ Here is the caller graph for this function:

◆ setTaxonomyIds()

assQuestionGUI::setTaxonomyIds (   $taxonomyIds)

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

309 {
310 $this->taxonomyIds = $taxonomyIds;
311 }

References $taxonomyIds.

◆ showHints()

assQuestionGUI::showHints ( )

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

2311 {
2312 global $ilCtrl;
2313 $ilCtrl->redirectByClass('ilAssQuestionHintsGUI', ilAssQuestionHintsGUI::CMD_SHOW_LIST);
2314 }

References $ilCtrl, and ilAssQuestionHintsGUI\CMD_SHOW_LIST.

◆ showSuggestedSolution()

assQuestionGUI::showSuggestedSolution ( )

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

1402 {
1403 $this->suggestedsolution();
1404 }

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

1412 {
1413 global $ilUser;
1414 global $ilAccess;
1415
1416 $save = (is_array($_POST["cmd"]) && array_key_exists("suggestedsolution", $_POST["cmd"])) ? TRUE : FALSE;
1417
1418 if ($save && $_POST["deleteSuggestedSolution"] == 1)
1419 {
1420 $this->object->deleteSuggestedSolutions();
1421 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
1422 $this->ctrl->redirect($this, "suggestedsolution");
1423 }
1424
1425 $output = "";
1426 $solution_array = $this->object->getSuggestedSolution(0);
1427 $options = array(
1428 "lm" => $this->lng->txt("obj_lm"),
1429 "st" => $this->lng->txt("obj_st"),
1430 "pg" => $this->lng->txt("obj_pg"),
1431 "git" => $this->lng->txt("glossary_term"),
1432 "file" => $this->lng->txt("fileDownload"),
1433 "text" => $this->lng->txt("solutionText")
1434 );
1435
1436 if ((strcmp($_POST["solutiontype"], "file") == 0) && (strcmp($solution_array["type"], "file") != 0))
1437 {
1438 $solution_array = array(
1439 "type" => "file"
1440 );
1441 }
1442 elseif ((strcmp($_POST["solutiontype"], "text") == 0) && (strcmp($solution_array["type"], "text") != 0))
1443 {
1444 $oldOutputMode = $this->getRenderPurpose();
1445 $this->setRenderPurpose(self::RENDER_PURPOSE_INPUT_VALUE);
1446
1447 $solution_array = array(
1448 "type" => "text",
1449 "value" => $this->getSolutionOutput(0, NULL, FALSE, FALSE, TRUE, FALSE, TRUE)
1450 );
1451 $this->setRenderPurpose($oldsaveSuggestedSolutionOutputMode);
1452 }
1453 if ($save && strlen($_POST["filename"]))
1454 {
1455 $solution_array["value"]["filename"] = $_POST["filename"];
1456 }
1457 if ($save && strlen($_POST["solutiontext"]))
1458 {
1459 $solution_array["value"] = $_POST["solutiontext"];
1460 }
1461 include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
1462 if (count($solution_array))
1463 {
1464 $form = new ilPropertyFormGUI();
1465 $form->setFormAction($this->ctrl->getFormAction($this));
1466 $form->setTitle($this->lng->txt("solution_hint"));
1467 $form->setMultipart(TRUE);
1468 $form->setTableWidth("100%");
1469 $form->setId("suggestedsolutiondisplay");
1470
1471 // suggested solution output
1472 include_once "./Modules/TestQuestionPool/classes/class.ilSolutionTitleInputGUI.php";
1473 $title = new ilSolutionTitleInputGUI($this->lng->txt("showSuggestedSolution"), "solutiontype");
1474 $template = new ilTemplate("tpl.il_as_qpl_suggested_solution_input_presentation.html", TRUE, TRUE, "Modules/TestQuestionPool");
1475 if (strlen($solution_array["internal_link"]))
1476 {
1477 $href = assQuestion::_getInternalLinkHref($solution_array["internal_link"]);
1478 $template->setCurrentBlock("preview");
1479 $template->setVariable("TEXT_SOLUTION", $this->lng->txt("suggested_solution"));
1480 $template->setVariable("VALUE_SOLUTION", " <a href=\"$href\" target=\"content\">" . $this->lng->txt("view"). "</a> ");
1481 $template->parseCurrentBlock();
1482 }
1483 elseif ((strcmp($solution_array["type"], "file") == 0) && (is_array($solution_array["value"])))
1484 {
1485 $href = $this->object->getSuggestedSolutionPathWeb() . $solution_array["value"]["name"];
1486 $template->setCurrentBlock("preview");
1487 $template->setVariable("TEXT_SOLUTION", $this->lng->txt("suggested_solution"));
1488 $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> ");
1489 $template->parseCurrentBlock();
1490 }
1491 $template->setVariable("TEXT_TYPE", $this->lng->txt("type"));
1492 $template->setVariable("VALUE_TYPE", $options[$solution_array["type"]]);
1493 $title->setHtml($template->get());
1494 $deletesolution = new ilCheckboxInputGUI("", "deleteSuggestedSolution");
1495 $deletesolution->setOptionTitle($this->lng->txt("deleteSuggestedSolution"));
1496 $title->addSubItem($deletesolution);
1497 $form->addItem($title);
1498
1499 if (strcmp($solution_array["type"], "file") == 0)
1500 {
1501 // file
1502 $file = new ilFileInputGUI($this->lng->txt("fileDownload"), "file");
1503 $file->setRequired(TRUE);
1504 $file->enableFileNameSelection("filename");
1505 //$file->setSuffixes(array("doc","xls","png","jpg","gif","pdf"));
1506 if( $_FILES["file"]["tmp_name"] && $file->checkInput() )
1507 {
1508 if (!file_exists($this->object->getSuggestedSolutionPath())) ilUtil::makeDirParents($this->object->getSuggestedSolutionPath());
1509
1510 $res = ilUtil::moveUploadedFile($_FILES["file"]["tmp_name"], $_FILES["file"]["name"], $this->object->getSuggestedSolutionPath() . $_FILES["file"]["name"]);
1511 if ($res)
1512 {
1513 ilUtil::renameExecutables($this->object->getSuggestedSolutionPath());
1514
1515 // remove an old file download
1516 if (is_array($solution_array["value"])) @unlink($this->object->getSuggestedSolutionPath() . $solution_array["value"]["name"]);
1517 $file->setValue($_FILES["file"]["name"]);
1518 $this->object->saveSuggestedSolution("file", "", 0, array("name" => $_FILES["file"]["name"], "type" => $_FILES["file"]["type"], "size" => $_FILES["file"]["size"], "filename" => $_POST["filename"]));
1519 $originalexists = $this->object->_questionExistsInPool($this->object->original_id);
1520 if (($_GET["calling_test"] || (isset($_GET['calling_consumer']) && (int)$_GET['calling_consumer'])) && $originalexists && assQuestion::_isWriteable($this->object->original_id, $ilUser->getId()))
1521 {
1522 return $this->originalSyncForm("suggestedsolution");
1523 }
1524 else
1525 {
1526 ilUtil::sendSuccess($this->lng->txt("suggested_solution_added_successfully"), TRUE);
1527 $this->ctrl->redirect($this, "suggestedsolution");
1528 }
1529 }
1530 else
1531 {
1532 // BH: $res as info string? wtf? it holds a bool or something else!!?
1534 }
1535 }
1536 else
1537 {
1538 if (is_array($solution_array["value"]))
1539 {
1540 $file->setValue($solution_array["value"]["name"]);
1541 $file->setFilename((strlen($solution_array["value"]["filename"])) ? $solution_array["value"]["filename"] : $solution_array["value"]["name"]);
1542 }
1543 }
1544 $form->addItem($file);
1545 $hidden = new ilHiddenInputGUI("solutiontype");
1546 $hidden->setValue("file");
1547 $form->addItem($hidden);
1548 }
1549 else if (strcmp($solution_array["type"], "text") == 0)
1550 {
1551 $solutionContent = $solution_array['value'];
1552 $solutionContent = $this->object->fixSvgToPng($solutionContent);
1553 $solutionContent = $this->object->fixUnavailableSkinImageSources($solutionContent);
1554 $question = new ilTextAreaInputGUI($this->lng->txt("solutionText"), "solutiontext");
1555 $question->setValue($this->object->prepareTextareaOutput($solutionContent));
1556 $question->setRequired(TRUE);
1557 $question->setRows(10);
1558 $question->setCols(80);
1559 $question->setUseRte(TRUE);
1560 $question->addPlugin("latex");
1561 $question->addButton("latex");
1562 $question->setRTESupport($this->object->getId(), "qpl", "assessment");
1563 $hidden = new ilHiddenInputGUI("solutiontype");
1564 $hidden->setValue("text");
1565 $form->addItem($hidden);
1566 $form->addItem($question);
1567 }
1568 if ($ilAccess->checkAccess("write", "", $_GET['ref_id']))
1569 {
1570 $form->addCommandButton('showSuggestedSolution', $this->lng->txt('cancel'));
1571 $form->addCommandButton('suggestedsolution', $this->lng->txt('save'));
1572 }
1573
1574 if ($save)
1575 {
1576 if ($form->checkInput())
1577 {
1578 switch ($solution_array["type"])
1579 {
1580 case "file":
1581 $this->object->saveSuggestedSolution("file", "", 0, array(
1582 "name" => $solution_array["value"]["name"],
1583 "type" => $solution_array["value"]["type"],
1584 "size" => $solution_array["value"]["size"],
1585 "filename" => $_POST["filename"]
1586 ));
1587 break;
1588 case "text":
1589 $this->object->saveSuggestedSolution("text", "", 0, $solution_array["value"]);
1590 break;
1591 }
1592 $originalexists = $this->object->_questionExistsInPool($this->object->original_id);
1593 if (($_GET["calling_test"] || (isset($_GET['calling_consumer']) && (int)$_GET['calling_consumer'])) && $originalexists && assQuestion::_isWriteable($this->object->original_id, $ilUser->getId()))
1594 {
1595 return $this->originalSyncForm("suggestedsolution");
1596 }
1597 else
1598 {
1599 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
1600 $this->ctrl->redirect($this, "suggestedsolution");
1601 }
1602 }
1603 }
1604
1605 $output = $form->getHTML();
1606 }
1607
1608 $savechange = (strcmp($this->ctrl->getCmd(), "saveSuggestedSolution") == 0) ? TRUE : FALSE;
1609
1610 $changeoutput = "";
1611 if ($ilAccess->checkAccess("write", "", $_GET['ref_id']))
1612 {
1613 $formchange = new ilPropertyFormGUI();
1614 $formchange->setFormAction($this->ctrl->getFormAction($this));
1615 $formchange->setTitle((count($solution_array)) ? $this->lng->txt("changeSuggestedSolution") : $this->lng->txt("addSuggestedSolution"));
1616 $formchange->setMultipart(FALSE);
1617 $formchange->setTableWidth("100%");
1618 $formchange->setId("suggestedsolution");
1619
1620 $solutiontype = new ilRadioGroupInputGUI($this->lng->txt("suggestedSolutionType"), "solutiontype");
1621 foreach($options as $opt_value => $opt_caption)
1622 {
1623 $solutiontype->addOption(new ilRadioOption($opt_caption, $opt_value));
1624 }
1625 if (count($solution_array))
1626 {
1627 $solutiontype->setValue($solution_array["type"]);
1628 }
1629 $solutiontype->setRequired(TRUE);
1630 $formchange->addItem($solutiontype);
1631
1632 $formchange->addCommandButton("saveSuggestedSolution", $this->lng->txt("select"));
1633
1634 if ($savechange)
1635 {
1636 $formchange->checkInput();
1637 }
1638 $changeoutput = $formchange->getHTML();
1639 }
1640
1641 $this->tpl->setVariable("ADM_CONTENT", $changeoutput . $output);
1642 }
originalSyncForm($return_to="", $return_to_feedback='')
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)
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 moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
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
if(!is_array($argv)) $options

References $_GET, $_POST, $file, $ilUser, $options, $output, $res, $title, assQuestion\_getInternalLinkHref(), assQuestion\_isWriteable(), getRenderPurpose(), getSolutionOutput(), ilUtil\makeDirParents(), ilUtil\moveUploadedFile(), 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 661 of file class.assQuestionGUI.php.

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

References $_GET, $ref_id, 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 370 of file class.assQuestionGUI.php.

371 {
372 }

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

+ Here is the caller graph for this function:

◆ writeQuestionGenericPostData()

assQuestionGUI::writeQuestionGenericPostData ( )
protected

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

2149 {
2150 $this->object->setTitle( $_POST["title"] );
2151 $this->object->setAuthor( $_POST["author"] );
2152 $this->object->setComment( $_POST["comment"] );
2153 if ($this->object->getSelfAssessmentEditingMode())
2154 {
2155 $this->object->setNrOfTries( $_POST['nr_of_tries'] );
2156 }
2157 $this->object->setQuestion( ilUtil::stripOnlySlashes($_POST['question']) ); // ?
2158 $this->object->setEstimatedWorkingTime(
2159 $_POST["Estimated"]["hh"],
2160 $_POST["Estimated"]["mm"],
2161 $_POST["Estimated"]["ss"]
2162 );
2163 }
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 99 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 2272 of file class.assQuestionGUI.php.

Referenced by getPreviewSession(), and setPreviewSession().

◆ $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: