ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
assQuestionGUI Class Reference

Basic GUI class for assessment questions. More...

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

Public Member Functions

 __construct ()
 assQuestionGUI constructor More...
 
executeCommand ()
 execute command More...
 
 getCommand ($cmd)
 
 getType ()
 needed for page editor compliance More...
 
 getPresentationContext ()
 
 setPresentationContext ($presentationContext)
 
 isTestPresentationContext ()
 
 isPreviousSolutionPrefilled ()
 
 setPreviousSolutionPrefilled ($previousSolutionPrefilled)
 
 getOutputMode ()
 
 setOutputMode ($outputMode)
 
 isPdfOutputMode ()
 
 isContentEditingOutputMode ()
 
 getNavigationGUI ()
 
 setNavigationGUI ($navigationGUI)
 
 setTaxonomyIds ($taxonomyIds)
 
 getTaxonomyIds ()
 
 setTargetGui ($linkTargetGui)
 
 setTargetGuiClass ($targetGuiClass)
 
 getTargetGuiClass ()
 
 setQuestionHeaderBlockBuilder ($questionHeaderBlockBuilder)
 
 setQuestionActionCmd ($questionActionCmd)
 
 getQuestionActionCmd ()
 
_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...
 
 _getGUIClassNameForId ($a_q_id)
 
 _getClassNameForQType ($q_type)
 
createQuestionGUI ($question_type, $question_id=-1)
 Creates a question gui representation. More...
 
 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 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 OUTPUT_MODE_SCREEN = 'outModeScreen'
 
const OUTPUT_MODE_PDF = 'outModePdf'
 
const OUTPUT_MODE_CONTENT_EDITING = 'outModeUsrSol'
 

Protected Member Functions

 writePostData ()
 Evaluates a posted edit form and writes the form data in the question object. More...
 
 getPreviousSolutionProvidedMessage ()
 
 saveTaxonomyAssignments ()
 
 populateTaxonomyFormSection (ilPropertyFormGUI $form)
 
 isLastSolutionSubmitAuthorized ($active_id, $pass)
 fetches solutions from database and prefers intermediate solutions, but falls back to authorized solutions. More...
 
 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)
 
 getTestOutputSolutions ($activeId, $pass)
 
 addBackTab (ilTabsGUI $ilTabs)
 
 buildBasicEditFormObject ()
 

Private Attributes

 $taxonomyIds = array()
 
 $targetGuiClass = null
 
 $questionActionCmd = 'handleQuestionAction'
 
 $questionHeaderBlockBuilder
 
 $navigationGUI
 
 $presentationContext = null
 
 $outputMode = self::OUTPUT_MODE_SCREEN
 
 $previousSolutionPrefilled = false
 
 $previewSession
 

Detailed Description

Basic GUI class for assessment questions.

The assQuestionGUI class encapsulates basic GUI functions for assessment questions.

@ilCtrl_Calls assQuestionGUI: ilAssQuestionPageGUI

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

Constructor & Destructor Documentation

◆ __construct()

assQuestionGUI::__construct ( )

assQuestionGUI constructor

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

96 {
97 global $lng, $tpl, $ilCtrl;
98
99 $this->lng =& $lng;
100 $this->tpl =& $tpl;
101 $this->ctrl =& $ilCtrl;
102 $this->ctrl->saveParameter($this, "q_id");
103 $this->ctrl->saveParameter($this, "prev_qid");
104 $this->ctrl->saveParameter($this, "calling_test");
105 $this->ctrl->saveParameter($this, "calling_consumer");
106 $this->ctrl->saveParameter($this, "consumer_context");
107 $this->ctrl->saveParameterByClass('ilAssQuestionPageGUI', 'test_express_mode');
108 $this->ctrl->saveParameterByClass('ilAssQuestionPageGUI', 'calling_consumer');
109 $this->ctrl->saveParameterByClass('ilAssQuestionPageGUI', 'consumer_context');
110 $this->ctrl->saveParameterByClass('ilobjquestionpoolgui', 'test_express_mode');
111 $this->ctrl->saveParameterByClass('ilobjquestionpoolgui', 'calling_consumer');
112 $this->ctrl->saveParameterByClass('ilobjquestionpoolgui', 'consumer_context');
113
114 include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
115 $this->errormessage = $this->lng->txt("fill_out_all_required_fields");
116
117 $this->selfassessmenteditingmode = false;
118 $this->new_id_listeners = array();
119 $this->new_id_listener_cnt = 0;
120
121 $this->navigationGUI = null;
122 }
global $ilCtrl
Definition: ilias.php:18

References $ilCtrl, $lng, and $tpl.

Member Function Documentation

◆ _getClassNameForQType()

assQuestionGUI::_getClassNameForQType (   $q_type)
Deprecated:

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

371 {
372 return $q_type . "GUI";
373 }

Referenced by _getGUIClassNameForId().

+ Here is the caller graph for this function:

◆ _getGUIClassNameForId()

assQuestionGUI::_getGUIClassNameForId (   $a_q_id)
Deprecated:

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

359 {
360 include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
361 include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
362 $q_type = assQuestion::getQuestionTypeFromDb($a_q_id);
363 $class_name = assQuestionGUI::_getClassNameForQType($q_type);
364 return $class_name;
365 }
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()

& assQuestionGUI::_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.

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

327 {
328 global $ilCtrl, $ilDB, $lng;
329
330 include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
331
332 if ((!$question_type) and ($question_id > 0))
333 {
334 $question_type = assQuestion::getQuestionTypeFromDb($question_id);
335 }
336
337 if (strlen($question_type) == 0) return NULL;
338
339 assQuestion::_includeClass($question_type, 1);
340
341 $question_type_gui = assQuestion::getGuiClassNameByQuestionType($question_type);
342 $question =& new $question_type_gui();
343
344 $feedbackObjectClassname = assQuestion::getFeedbackClassNameByQuestionType($question_type);
345 $question->object->feedbackOBJ = new $feedbackObjectClassname($question->object, $ilCtrl, $ilDB, $lng);
346
347 if ($question_id > 0)
348 {
349 $question->object->loadFromDb($question_id);
350 }
351
352 return $question;
353 }
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 2120 of file class.assQuestionGUI.php.

2121 {
2122 if(($_GET["calling_test"] > 0) || ($_GET["test_ref_id"] > 0))
2123 {
2124 $ref_id = $_GET["calling_test"];
2125 if(strlen($ref_id) == 0) $ref_id = $_GET["test_ref_id"];
2126
2127 if(!$_GET['test_express_mode'] && !$GLOBALS['___test_express_mode'])
2128 {
2129 $ilTabs->setBackTarget($this->lng->txt("backtocallingtest"), "ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=$ref_id");
2130 }
2131 else
2132 {
2134 $ilTabs->setBackTarget($this->lng->txt("backtocallingtest"), $link);
2135 }
2136 }
2137 else if(isset($_GET['calling_consumer']) && (int)$_GET['calling_consumer'])
2138 {
2139 $ref_id = (int)$_GET['calling_consumer'];
2141 if($consumer instanceof ilQuestionEditingFormConsumer)
2142 {
2143 $ilTabs->setBackTarget($consumer->getQuestionEditingFormBackTargetLabel(), $consumer->getQuestionEditingFormBackTarget($_GET['consumer_context']));
2144 }
2145 else
2146 {
2147 require_once 'Services/Link/classes/class.ilLink.php';
2148 $ilTabs->setBackTarget($this->lng->txt("qpl"), ilLink::_getLink($ref_id));
2149 }
2150 }
2151 else
2152 {
2153 $ilTabs->setBackTarget($this->lng->txt("qpl"), $this->ctrl->getLinkTargetByClass("ilobjquestionpoolgui", "questions"));
2154 }
2155 }
$_GET["client_id"]
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['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.
Definition: CAS.php:276
$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 1019 of file class.assQuestionGUI.php.

1020 {
1021 // title
1022 $title = new ilTextInputGUI($this->lng->txt("title"), "title");
1023 $title->setMaxLength(100);
1024 $title->setValue($this->object->getTitle());
1025 $title->setRequired(TRUE);
1026 $form->addItem($title);
1027
1028 if (!$this->object->getSelfAssessmentEditingMode())
1029 {
1030 // author
1031 $author = new ilTextInputGUI($this->lng->txt("author"), "author");
1032 $author->setValue($this->object->getAuthor());
1033 $author->setRequired(TRUE);
1034 $form->addItem($author);
1035
1036 // description
1037 $description = new ilTextInputGUI($this->lng->txt("description"), "comment");
1038 $description->setValue($this->object->getComment());
1039 $description->setRequired(FALSE);
1040 $form->addItem($description);
1041 }
1042 else
1043 {
1044 // author as hidden field
1045 $hi = new ilHiddenInputGUI("author");
1046 $author = ilUtil::prepareFormOutput($this->object->getAuthor());
1047 if (trim($author) == "")
1048 {
1049 $author = "-";
1050 }
1051 $hi->setValue($author);
1052 $form->addItem($hi);
1053
1054 }
1055
1056 // questiontext
1057 $question = new ilTextAreaInputGUI($this->lng->txt("question"), "question");
1058 $question->setValue($this->object->getQuestion());
1059 $question->setRequired(TRUE);
1060 $question->setRows(10);
1061 $question->setCols(80);
1062
1063 if (!$this->object->getSelfAssessmentEditingMode())
1064 {
1065 if( $this->object->getAdditionalContentEditingMode() != assQuestion::ADDITIONAL_CONTENT_EDITING_MODE_PAGE_OBJECT )
1066 {
1067 $question->setUseRte(TRUE);
1068 include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
1069 $question->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("assessment"));
1070 $question->addPlugin("latex");
1071 $question->addButton("latex");
1072 $question->addButton("pastelatex");
1073 $question->setRTESupport($this->object->getId(), "qpl", "assessment");
1074 }
1075 }
1076 else
1077 {
1078 require_once 'Modules/TestQuestionPool/classes/questions/class.ilAssSelfAssessmentQuestionFormatter.php';
1080 $question->setUseTagsForRteOnly(false);
1081 }
1082 $form->addItem($question);
1083
1084 if (!$this->object->getSelfAssessmentEditingMode())
1085 {
1086 // duration
1087 $duration = new ilDurationInputGUI($this->lng->txt("working_time"), "Estimated");
1088 $duration->setShowHours(TRUE);
1089 $duration->setShowMinutes(TRUE);
1090 $duration->setShowSeconds(TRUE);
1091 $ewt = $this->object->getEstimatedWorkingTime();
1092 $duration->setHours($ewt["h"]);
1093 $duration->setMinutes($ewt["m"]);
1094 $duration->setSeconds($ewt["s"]);
1095 $duration->setRequired(FALSE);
1096 $form->addItem($duration);
1097 }
1098 else
1099 {
1100 // number of tries
1101 if (strlen($this->object->getNrOfTries()))
1102 {
1103 $nr_tries = $this->object->getNrOfTries();
1104 }
1105 else
1106 {
1107 $nr_tries = $this->object->getDefaultNrOfTries();
1108 }
1109 if ($nr_tries < 1)
1110 {
1111 $nr_tries = "";
1112 }
1113
1114 $ni = new ilNumberInputGUI($this->lng->txt("qst_nr_of_tries"), "nr_of_tries");
1115 $ni->setValue($nr_tries);
1116 $ni->setMinValue(0);
1117 $ni->setSize(5);
1118 $ni->setMaxLength(5);
1119 $form->addItem($ni);
1120 }
1121 }
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.
& _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 ilObjAdvancedEditing\_getUsedHTMLTags(), assQuestion\ADDITIONAL_CONTENT_EDITING_MODE_PAGE_OBJECT, ilAssSelfAssessmentQuestionFormatter\getSelfAssessmentTags(), and ilUtil\prepareFormOutput().

Referenced by assKprimChoiceGUI\buildEditForm(), assLongMenuGUI\buildEditForm(), assErrorTextGUI\editQuestion(), assFileUploadGUI\editQuestion(), assFlashQuestionGUI\editQuestion(), assImagemapQuestionGUI\editQuestion(), assJavaAppletGUI\editQuestion(), assMatchingQuestionGUI\editQuestion(), assNumericGUI\editQuestion(), assOrderingHorizontalGUI\editQuestion(), assOrderingQuestionGUI\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 927 of file class.assQuestionGUI.php.

928 {
929 $this->errormessage .= ((strlen($this->errormessage)) ? "<br />" : "") . $errormessage;
930 }

References $errormessage.

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

+ Here is the caller graph for this function:

◆ addGIT()

assQuestionGUI::addGIT ( )

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

1781 {
1782 $subquestion_index = 0;
1783 if (strlen($_GET["subquestion_index"]) && $_GET["subquestion_index"] >= 0)
1784 {
1785 $subquestion_index = $_GET["subquestion_index"];
1786 }
1787 $this->object->saveSuggestedSolution("git", "il__git_" . $_GET["git"], $subquestion_index);
1788 ilUtil::sendSuccess($this->lng->txt("suggested_solution_added_successfully"), TRUE);
1789 $this->ctrl->redirect($this, "suggestedsolution");
1790 }
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 971 of file class.assQuestionGUI.php.

972 {
973 $cnt = $this->new_id_listener_cnt;
974 $this->new_id_listeners[$cnt]["object"] =& $a_object;
975 $this->new_id_listeners[$cnt]["method"] = $a_method;
976 $this->new_id_listeners[$cnt]["parameters"] = $a_parameters;
977 $this->new_id_listener_cnt++;
978 }

◆ addPG()

assQuestionGUI::addPG ( )

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

1757 {
1758 $subquestion_index = 0;
1759 if (strlen($_GET["subquestion_index"]) && $_GET["subquestion_index"] >= 0)
1760 {
1761 $subquestion_index = $_GET["subquestion_index"];
1762 }
1763 $this->object->saveSuggestedSolution("pg", "il__pg_" . $_GET["pg"], $subquestion_index);
1764 ilUtil::sendSuccess($this->lng->txt("suggested_solution_added_successfully"), TRUE);
1765 $this->ctrl->redirect($this, "suggestedsolution");
1766 }

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

1004 {
1005 //if (!$this->object->getSelfAssessmentEditingMode() && !$_GET["calling_test"]) $form->addCommandButton("saveEdit", $this->lng->txt("save_edit"));
1006 if(!$this->object->getSelfAssessmentEditingMode())
1007 {
1008 $form->addCommandButton("saveReturn", $this->lng->txt("save_return"));
1009 }
1010 $form->addCommandButton("save", $this->lng->txt("save"));
1011 }

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

+ Here is the caller graph for this function:

◆ addST()

assQuestionGUI::addST ( )

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

1769 {
1770 $subquestion_index = 0;
1771 if (strlen($_GET["subquestion_index"]) && $_GET["subquestion_index"] >= 0)
1772 {
1773 $subquestion_index = $_GET["subquestion_index"];
1774 }
1775 $this->object->saveSuggestedSolution("st", "il__st_" . $_GET["st"], $subquestion_index);
1776 ilUtil::sendSuccess($this->lng->txt("suggested_solution_added_successfully"), TRUE);
1777 $this->ctrl->redirect($this, "suggestedsolution");
1778 }

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

1928 {
1929 global $ilCtrl;
1930
1931 require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionFeedbackEditingGUI.php';
1932 $tabCommands = self::getCommandsFromClassConstants('ilAssQuestionFeedbackEditingGUI');
1933
1934 $tabLink = $ilCtrl->getLinkTargetByClass('ilAssQuestionFeedbackEditingGUI', ilAssQuestionFeedbackEditingGUI::CMD_SHOW);
1935
1936 $tabs->addTarget('tst_feedback', $tabLink, $tabCommands, $ilCtrl->getCmdClass(), '');
1937 }
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)
DEPRECATED.

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

1959 {
1960 global $ilCtrl;
1961
1962 require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintsGUI.php';
1963
1964 switch( $ilCtrl->getCmdClass() )
1965 {
1966 case 'ilassquestionhintsgui':
1967
1968 $tabCommands = self::getCommandsFromClassConstants('ilAssQuestionHintsGUI');
1969 break;
1970
1971 case 'ilassquestionhintgui':
1972
1973 require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintGUI.php';
1974 $tabCommands = self::getCommandsFromClassConstants('ilAssQuestionHintGUI');
1975 break;
1976
1977 default:
1978
1979 $tabCommands = array();
1980 }
1981
1982 $tabLink = $ilCtrl->getLinkTargetByClass('ilAssQuestionHintsGUI', ilAssQuestionHintsGUI::CMD_SHOW_LIST);
1983
1984 $tabs->addTarget('tst_question_hints_tab', $tabLink, $tabCommands, $ilCtrl->getCmdClass(), '');
1985 }
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 1891 of file class.assQuestionGUI.php.

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

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

864 {
865 $this->writePostData();
866 $this->object->saveToDb();
867 $this->ctrl->setParameter($this, "q_id", $this->object->getId());
868 $this->editQuestion();
869 }
writePostData()
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 2181 of file class.assQuestionGUI.php.

2182 {
2183 require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
2184 $form = new ilPropertyFormGUI();
2185
2186 $form->setFormAction($this->ctrl->getFormAction($this));
2187
2188 $form->setId($this->getType());
2189 $form->setTitle($this->outQuestionType());
2190
2191 $form->setTableWidth('100%');
2192
2193 $form->setMultipart(true);
2194
2195 return $form;
2196 }
getType()
needed for page editor compliance
This class represents a property form user interface.

References getType(), and outQuestionType().

Referenced by assKprimChoiceGUI\buildEditForm(), and assLongMenuGUI\buildEditForm().

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

◆ callNewIdListeners()

assQuestionGUI::callNewIdListeners (   $a_new_id)

Call the new id listeners.

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

984 {
985
986 for ($i=0; $i<$this->new_id_listener_cnt; $i++)
987 {
988 $this->new_id_listeners[$i]["parameters"]["new_id"] = $a_new_id;
989 $object =& $this->new_id_listeners[$i]["object"];
990 $method = $this->new_id_listeners[$i]["method"];
991 $parameters = $this->new_id_listeners[$i]["parameters"];
992//var_dump($object);
993//var_dump($method);
994//var_dump($parameters);
995
996 $object->$method($parameters);
997 }
998 }

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

471 {
472 if ($_GET["calling_test"])
473 {
474 $_GET["ref_id"] = $_GET["calling_test"];
475 ilUtil::redirect("ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=".$_GET["calling_test"]);
476 }
477 elseif ($_GET["test_ref_id"])
478 {
479 $_GET["ref_id"] = $_GET["test_ref_id"];
480 ilUtil::redirect("ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=".$_GET["test_ref_id"]);
481 }
482 else
483 {
484 if ($_GET["q_id"] > 0)
485 {
486 $this->ctrl->setParameterByClass("ilAssQuestionPageGUI", "q_id", $_GET["q_id"]);
487 $this->ctrl->redirectByClass("ilAssQuestionPageGUI", "edit");
488 }
489 else
490 {
491 $this->ctrl->redirectByClass("ilobjquestionpoolgui", "questions");
492 }
493 }
494 }
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 1596 of file class.assQuestionGUI.php.

1597 {
1598 $this->ctrl->redirect($this, "suggestedsolution");
1599 }

◆ cancelSync()

assQuestionGUI::cancelSync ( )

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

566 {
567 if (strlen($_GET["return_to"]))
568 {
569 $this->ctrl->redirect($this, $_GET["return_to"]);
570 }
571 if(strlen($_REQUEST['return_to_fb']))
572 {
573 $this->ctrl->redirectByClass('ilAssQuestionFeedbackEditingGUI', 'showFeedbackForm');
574 }
575 else
576 {
577 if(isset($_GET['calling_consumer']) && (int)$_GET['calling_consumer'])
578 {
579 $ref_id = (int)$_GET['calling_consumer'];
581 if($consumer instanceof ilQuestionEditingFormConsumer)
582 {
583 ilUtil::redirect($consumer->getQuestionEditingFormBackTarget($_GET['consumer_context']));
584 }
585 require_once 'Services/Link/classes/class.ilLink.php';
587 }
588 $_GET["ref_id"] = $_GET["calling_test"];
589
590 if($_REQUEST['test_express_mode'])
591 {
593 }
594 else
595 {
596 ilUtil::redirect("ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=".$_GET["calling_test"]);
597 }
598 }
599 }
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7

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

2083 {
2084 return $formAction;
2085 }

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

388 {
389 include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
390 $this->question =& assQuestionGUI::_getQuestionGUI($question_type, $question_id);
391 }
& _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 127 of file class.assQuestionGUI.php.

128 {
129 $cmd = $this->ctrl->getCmd("editQuestion");
130 $next_class = $this->ctrl->getNextClass($this);
131
132 $cmd = $this->getCommand($cmd);
133
134 switch($next_class)
135 {
136 default:
137 $ret =& $this->$cmd();
138 break;
139 }
140 return $ret;
141 }
$cmd
Definition: sahs_server.php:35

References $cmd, $ret, and getCommand().

+ Here is the call graph for this function:

◆ getAdditionalEditQuestionCommands()

assQuestionGUI::getAdditionalEditQuestionCommands ( )
protected

Reimplemented in assKprimChoiceGUI.

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

1917 {
1918 return array();
1919 }

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

1193 {
1194 return $this->getGenericFeedbackOutput($active_id, $pass);
1195 }
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(), assOrderingQuestionGUI\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 956 of file class.assQuestionGUI.php.

957 {
958 $result = "";
959 if (strlen($a_value))
960 {
961 $result = " value=\"$a_value\" ";
962 }
963 return $result;
964 }
$result

References $result.

◆ getBasicEditQuestionTabCommands()

assQuestionGUI::getBasicEditQuestionTabCommands ( )
protected

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

1912 {
1913 return array('editQuestion', 'save', 'saveEdit', 'originalSyncForm');
1914 }

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

144 {
145 return $cmd;
146 }

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

1806 {
1807 $reflectionClass = new ReflectionClass($guiClassName);
1808
1809 $commands = null;
1810
1811 if( $reflectionClass instanceof ReflectionClass )
1812 {
1813 $commands = array();
1814
1815 foreach($reflectionClass->getConstants() as $constName => $constValue)
1816 {
1817 if( substr($constName, 0, strlen($cmdConstantNameBegin)) == $cmdConstantNameBegin )
1818 {
1819 $commands[] = $constValue;
1820 }
1821 }
1822 }
1823
1824 return $commands;
1825 }

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

878 {
879 $path = "";
880
881 $tmpPath = $cont_obj->getLMTree()->getPathFull($a_endnode_id, $a_startnode_id);
882
883 // count -1, to exclude the learning module itself
884 for ($i = 1; $i < (count($tmpPath) - 1); $i++)
885 {
886 if ($path != "")
887 {
888 $path .= " > ";
889 }
890
891 $path .= $tmpPath[$i]["title"];
892 }
893
894 return $path;
895 }
$path
Definition: index.php:22

References $path.

Referenced by outPageSelector().

+ Here is the caller graph for this function:

◆ getEditQuestionTabCommands()

assQuestionGUI::getEditQuestionTabCommands ( )
final

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

1907 {
1908 return array_merge($this->getBasicEditQuestionTabCommands(), $this->getAdditionalEditQuestionCommands());
1909 }

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

918 {
919 return $this->errormessage;
920 }

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

2113 {
2115 }

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

1207 {
1208 $output = "";
1209 include_once "./Modules/Test/classes/class.ilObjTest.php";
1210 $manual_feedback = ilObjTest::getManualFeedback($active_id, $this->object->getId(), $pass);
1211 if (strlen($manual_feedback))
1212 {
1213 return $manual_feedback;
1214 }
1215 $correct_feedback = $this->object->feedbackOBJ->getGenericFeedbackTestPresentation($this->object->getId(), true);
1216 $incorrect_feedback = $this->object->feedbackOBJ->getGenericFeedbackTestPresentation($this->object->getId(), false);
1217 if (strlen($correct_feedback.$incorrect_feedback))
1218 {
1219 $useAuthorizedSolution = $this->isLastSolutionSubmitAuthorized($active_id, $pass);
1220 $reached_points = $this->object->calculateReachedPoints($active_id, $pass, (bool)$useAuthorizedSolution);
1221 $max_points = $this->object->getMaximumPoints();
1222 if ($reached_points == $max_points)
1223 {
1224 $output = $correct_feedback;
1225 }
1226 else
1227 {
1228 $output = $incorrect_feedback;
1229 }
1230 }
1231 return $this->object->prepareTextareaOutput($output, TRUE);
1232 }
isLastSolutionSubmitAuthorized($active_id, $pass)
fetches solutions from database and prefers intermediate solutions, but falls back to authorized solu...
static getManualFeedback($active_id, $question_id, $pass)
Retrieves the manual feedback for a question in a test.

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

Referenced by getAnswerFeedbackOutput(), assClozeTestGUI\getSolutionOutput(), assErrorTextGUI\getSolutionOutput(), assFormulaQuestionGUI\getSolutionOutput(), assKprimChoiceGUI\getSolutionOutput(), assLongMenuGUI\getSolutionOutput(), assMatchingQuestionGUI\getSolutionOutput(), assNumericGUI\getSolutionOutput(), assOrderingHorizontalGUI\getSolutionOutput(), assOrderingQuestionGUI\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 1234 of file class.assQuestionGUI.php.

1235 {
1236 return $this->object->prepareTextareaOutput(
1237 $this->object->feedbackOBJ->getGenericFeedbackTestPresentation($this->object->getId(), true), true
1238 );
1239 }

◆ getGenericFeedbackOutputForIncorrectSolution()

assQuestionGUI::getGenericFeedbackOutputForIncorrectSolution ( )

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

1242 {
1243 return $this->object->prepareTextareaOutput(
1244 $this->object->feedbackOBJ->getGenericFeedbackTestPresentation($this->object->getId(), false), true
1245 );
1246 }

◆ getILIASPage()

assQuestionGUI::getILIASPage (   $html = "")

Returns the ILIAS Page around a question.

Returns
string The ILIAS page content @access public

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

410 {
411 include_once("./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php");
412 $page_gui = new ilAssQuestionPageGUI($this->object->getId());
413 $page_gui->setQuestionHTML(array($this->object->getId() => $html));
414 $page_gui->setOutputMode("presentation");
415 $presentation = $page_gui->presentation();
416 $presentation = preg_replace("/src=\"\\.\\//ims", "src=\"" . ILIAS_HTTP_PATH . "/", $presentation);
417 return $presentation;
418 }
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(), 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(), assOrderingQuestionGUI\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 224 of file class.assQuestionGUI.php.

225 {
227 }

References $navigationGUI.

Referenced by outQuestionPage().

+ Here is the caller graph for this function:

◆ getOutputMode()

assQuestionGUI::getOutputMode ( )
Returns
string

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

199 {
200 return $this->outputMode;
201 }

References $outputMode.

Referenced by isContentEditingOutputMode(), isPdfOutputMode(), and suggestedsolution().

+ Here is the caller graph for this function:

◆ getPresentationContext()

assQuestionGUI::getPresentationContext ( )
Returns
string

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

160 {
162 }

References $presentationContext.

Referenced by isTestPresentationContext().

+ Here is the caller graph for this function:

◆ getPreview()

◆ getPreviewSession()

◆ getPreviousSolutionProvidedMessage()

assQuestionGUI::getPreviousSolutionProvidedMessage ( )
protected

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

462 {
463 return $this->lng->txt('use_previous_solution_advice');
464 }

Referenced by outQuestionPage().

+ Here is the caller graph for this function:

◆ getQuestionActionCmd()

assQuestionGUI::getQuestionActionCmd ( )

◆ getQuestionCount()

assQuestionGUI::getQuestionCount ( )

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

913 {
915 }
$question_count
question count in test

References $question_count.

◆ getQuestionTemplate()

assQuestionGUI::getQuestionTemplate ( )

get question template

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

397 {
398 $this->tpl->addBlockFile("CONTENT", "content", "tpl.il_as_qpl_content.html", "Modules/TestQuestionPool");
399 $this->tpl->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html");
400 $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_question.html", "Modules/TestQuestionPool");
401 }

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

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

945 {
946 return $this->object->getQuestionType();
947 }

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

+ Here is the caller graph for this function:

◆ getSequenceNumber()

assQuestionGUI::getSequenceNumber ( )

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

903 {
904 return $this->sequence_no;
905 }
$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 242 of file class.assQuestionGUI.php.

243 {
244 return $this->taxonomyIds;
245 }

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

◆ getTestOutputSolutions()

assQuestionGUI::getTestOutputSolutions (   $activeId,
  $pass 
)
protected

◆ getType()

assQuestionGUI::getType ( )

needed for page editor compliance

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

152 {
153 return $this->getQuestionType();
154 }
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:

◆ hasCorrectSolution()

◆ isAutosaveable()

assQuestionGUI::isAutosaveable ( )

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

2020 {
2021 return $this->object->isAutosaveable();
2022 }

Referenced by ilTestPlayerAbstractGUI\populateIntermediateSolutionSaver().

+ Here is the caller graph for this function:

◆ isContentEditingOutputMode()

assQuestionGUI::isContentEditingOutputMode ( )

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

References getOutputMode(), and OUTPUT_MODE_CONTENT_EDITING.

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

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

◆ isLastSolutionSubmitAuthorized()

assQuestionGUI::isLastSolutionSubmitAuthorized (   $active_id,
  $pass 
)
protected

fetches solutions from database and prefers intermediate solutions, but falls back to authorized solutions.

without any solution null is returned.

Returns
bool|null

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

1171 {
1172 $userSolution = $this->object->getUserSolutionPreferingIntermediate($active_id, $pass);
1173
1174 if( count($userSolution) )
1175 {
1176 $solutionRow = current($userSolution);
1177 return (bool)$solutionRow['authorized'];
1178 }
1179
1180 return null;
1181 }

References $pass.

Referenced by assClozeTestGUI\getAnswerFeedbackOutput(), and getGenericFeedbackOutput().

+ Here is the caller graph for this function:

◆ isPdfOutputMode()

assQuestionGUI::isPdfOutputMode ( )

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

212 {
213 return $this->getOutputMode() == self::OUTPUT_MODE_PDF;
214 }

References getOutputMode(), and OUTPUT_MODE_PDF.

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

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

◆ isPreviousSolutionPrefilled()

assQuestionGUI::isPreviousSolutionPrefilled ( )
Returns
boolean

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

References $previousSolutionPrefilled.

Referenced by assFormulaQuestionGUI\getTestOutput(), getTestOutputSolutions(), and outQuestionPage().

+ Here is the caller graph for this function:

◆ isSaveCommand()

◆ isTestPresentationContext()

◆ linkChilds()

assQuestionGUI::linkChilds ( )

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

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

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

2088 {
2089 return;
2090 }

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

501 {
502 if (strlen($return_to))
503 {
504 $this->ctrl->setParameter($this, "return_to", $return_to);
505 }
506 else if ($_REQUEST['return_to']) {
507 $this->ctrl->setParameter($this, "return_to", $_REQUEST['return_to']);
508 }
509 if(strlen($return_to_feedback))
510 {
511 $this->ctrl->setParameter($this, 'return_to_fb', 'true');
512 }
513
514 $this->ctrl->saveParameter($this, 'test_express_mode');
515
516 $template = new ilTemplate("tpl.il_as_qpl_sync_original.html",TRUE, TRUE, "Modules/TestQuestionPool");
517 $template->setVariable("BUTTON_YES", $this->lng->txt("yes"));
518 $template->setVariable("BUTTON_NO", $this->lng->txt("no"));
519 $template->setVariable("FORM_ACTION", $this->ctrl->getFormAction($this));
520 $template->setVariable("TEXT_SYNC", $this->lng->txt("confirm_sync_questions"));
521 $this->tpl->setVariable("ADM_CONTENT", $template->get());
522 }
special template class to simplify handling of ITX/PEAR

References $_REQUEST.

Referenced by suggestedsolution().

+ Here is the caller graph for this function:

◆ outAdditionalOutput()

assQuestionGUI::outAdditionalOutput ( )

Reimplemented in assTextQuestionGUI.

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

933 {
934 }

◆ outChapterSelector()

assQuestionGUI::outChapterSelector ( )

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

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

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

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

References $_GET.

Referenced by linkChilds().

+ Here is the caller graph for this function:

◆ outPageSelector()

assQuestionGUI::outPageSelector ( )

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

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

2061 {
2062 $formaction = $this->completeTestOutputFormAction($formaction, $active_id, $pass);
2063
2064 $test_output = $this->getTestOutput(
2065 $active_id,
2066 $pass,
2067 $is_question_postponed,
2068 $user_post_solutions,
2069 $show_specific_inline_feedback
2070 );
2071
2072 $this->magicAfterTestOutput();
2073
2074 $this->tpl->setVariable("QUESTION_OUTPUT", $test_output);
2075 $this->tpl->setVariable("FORMACTION", $formaction);
2076 $this->tpl->setVariable("ENCTYPE", 'enctype="'.$this->getFormEncodingType().'"');
2077 $this->tpl->setVariable("FORM_TIMESTAMP", time());
2078 }
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 423 of file class.assQuestionGUI.php.

424 {
425 // hey: prevPassSolutions - send the "use previous answer" message
426 if ($this->isPreviousSolutionPrefilled())
427 {
429 }
430 // hey.
431
432 $this->lng->loadLanguageModule("content");
433
434 if( $this->getNavigationGUI() )
435 {
436 $html = $this->getNavigationGUI()->getHTML().$html;
437 }
438
439 $postponed = "";
440 if ($a_postponed)
441 {
442 $postponed = " (" . $this->lng->txt("postponed") . ")";
443 }
444
445 include_once("./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php");
446 $page_gui = new ilAssQuestionPageGUI($this->object->getId());
447 $page_gui->setOutputMode("presentation");
448 $page_gui->setTemplateTargetVar($a_temp_var);
449
450 if( strlen($html) )
451 {
452 $page_gui->setQuestionHTML(array($this->object->getId() => $html));
453 }
454
455 $page_gui->setPresentationTitle($this->questionHeaderBlockBuilder->getHTML());
456
457 return $page_gui->presentation();
458 }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.

References $html, getNavigationGUI(), getPreviousSolutionProvidedMessage(), isPreviousSolutionPrefilled(), 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(), assOrderingQuestionGUI\getTestOutput(), assTextQuestionGUI\getTestOutput(), assTextSubsetGUI\getTestOutput(), 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 1261 of file class.assQuestionGUI.php.

1262 {
1263 $count = $this->object->isInUse();
1264
1265 if (assQuestion::_questionExistsInPool($this->object->getId()) && $count)
1266 {
1267 global $rbacsystem;
1268 if ($rbacsystem->checkAccess("write", $_GET["ref_id"]))
1269 {
1270 ilUtil::sendInfo(sprintf($this->lng->txt("qpl_question_is_in_use"), $count));
1271 }
1272 }
1273
1274 return assQuestion::_getQuestionTypeName($this->object->getQuestionType());
1275 }
static _getQuestionTypeName($type_tag)
Return the translation for a given question type tag.
_questionExistsInPool($question_id)
Returns true if the question already exists in the database and is assigned to a question pool.

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

Referenced by buildBasicEditFormObject(), assClozeTestGUI\editQuestion(), assErrorTextGUI\editQuestion(), assFileUploadGUI\editQuestion(), assFlashQuestionGUI\editQuestion(), assImagemapQuestionGUI\editQuestion(), assJavaAppletGUI\editQuestion(), assMatchingQuestionGUI\editQuestion(), assMultipleChoiceGUI\editQuestion(), assNumericGUI\editQuestion(), assOrderingHorizontalGUI\editQuestion(), assOrderingQuestionGUI\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 1520 of file class.assQuestionGUI.php.

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

References $_GET, and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ populateTaxonomyFormSection()

assQuestionGUI::populateTaxonomyFormSection ( ilPropertyFormGUI  $form)
protected

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

1141 {
1142 if( count($this->getTaxonomyIds()) )
1143 {
1144 $sectHeader = new ilFormSectionHeaderGUI();
1145 $sectHeader->setTitle($this->lng->txt('qpl_qst_edit_form_taxonomy_section'));
1146 $form->addItem($sectHeader);
1147
1148 require_once 'Services/Taxonomy/classes/class.ilTaxAssignInputGUI.php';
1149
1150 foreach($this->getTaxonomyIds() as $taxonomyId)
1151 {
1152 $taxonomy = new ilObjTaxonomy($taxonomyId);
1153 $label = sprintf($this->lng->txt('qpl_qst_edit_form_taxonomy'), $taxonomy->getTitle());
1154 $postvar = "tax_node_assign_$taxonomyId";
1155
1156 $taxNodeAssign = new ilTaxAssignInputGUI($taxonomy->getId(), true, $label, $postvar);
1157 // TODO: determine tst/qpl when tax assigns become maintainable within tests
1158 $taxNodeAssign->setCurrentValues('qpl', $this->object->getObjId(), 'quest', $this->object->getId());
1159 $form->addItem($taxNodeAssign);
1160 }
1161 }
1162 }
This class represents a section header in a property form.
addItem($a_item)
Add Item (Property, SectionHeader).
Input GUI class for taxonomy assignments.

References ilPropertyFormGUI\addItem(), and getTaxonomyIds().

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

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

663 {
664 global $ilUser;
665 $old_id = $_GET["q_id"];
666 $result = $this->writePostData();
667
668 if($result == 0)
669 {
670 $ilUser->setPref("tst_lastquestiontype", $this->object->getQuestionType());
671 $ilUser->writePref("tst_lastquestiontype", $this->object->getQuestionType());
672 $this->object->saveToDb();
673 $originalexists = $this->object->_questionExistsInPool($this->object->original_id);
674
675
676 include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
677 if(($_GET["calling_test"] || (isset($_GET['calling_consumer']) && (int)$_GET['calling_consumer'])) && $originalexists && assQuestion::_isWriteable($this->object->original_id, $ilUser->getId()))
678 {
679 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
680 $this->ctrl->setParameter($this, 'return_to', 'editQuestion');
681 $this->ctrl->redirect($this, "originalSyncForm");
682 return;
683 }
684 elseif($_GET["calling_test"])
685 {
686 require_once 'Modules/Test/classes/class.ilObjTest.php';
687 $test = new ilObjTest($_GET["calling_test"]);
688 if(!assQuestion::_questionExistsInTest($this->object->getId(), $test->getTestId()))
689 {
690 global $tree, $ilDB, $ilPluginAdmin;
691
692 include_once("./Modules/Test/classes/class.ilObjTest.php");
693 $_GET["ref_id"] = $_GET["calling_test"];
694 $test = new ilObjTest($_GET["calling_test"], true);
695
696 require_once 'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
697 $testQuestionSetConfigFactory = new ilTestQuestionSetConfigFactory($tree, $ilDB, $ilPluginAdmin, $test);
698
699 $new_id = $test->insertQuestion(
700 $testQuestionSetConfigFactory->getQuestionSetConfig(), $this->object->getId()
701 );
702
703 if(isset($_REQUEST['prev_qid']))
704 {
705 $test->moveQuestionAfter($this->object->getId() + 1, $_REQUEST['prev_qid']);
706 }
707
708 $this->ctrl->setParameter($this, 'q_id', $new_id);
709 $this->ctrl->setParameter($this, 'calling_test', $_GET['calling_test']);
710 #$this->ctrl->setParameter($this, 'test_ref_id', false);
711 }
712 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
713 $this->ctrl->redirect($this, 'editQuestion');
714
715 }
716 else
717 {
718 $this->callNewIdListeners($this->object->getId());
719
720 if($this->object->getId() != $old_id)
721 {
722 // first save
723 $this->ctrl->setParameterByClass($_GET["cmdClass"], "q_id", $this->object->getId());
724 $this->ctrl->setParameterByClass($_GET["cmdClass"], "sel_question_types", $_GET["sel_question_types"]);
725 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
726
727 //global $___test_express_mode;
731 if($_REQUEST['prev_qid'])
732 {
733 // @todo: bheyser/mbecker wtf? ..... thx@jposselt ....
734 // mbecker: Possible fix: Just instantiate the obj?
735 include_once("./Modules/Test/classes/class.ilObjTest.php");
736 $test =& new ilObjTest($_GET["ref_id"], true);
737 $test->moveQuestionAfter($_REQUEST['prev_qid'], $this->object->getId());
738 }
739 if( /*$___test_express_mode || */ $_REQUEST['express_mode'] )
740 {
741 global $tree, $ilDB, $ilPluginAdmin;
742
743 include_once("./Modules/Test/classes/class.ilObjTest.php");
744 $test = new ilObjTest($_GET["ref_id"], true);
745
746 require_once 'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
747 $testQuestionSetConfigFactory = new ilTestQuestionSetConfigFactory($tree, $ilDB, $ilPluginAdmin, $test);
748
749 $test->insertQuestion(
750 $testQuestionSetConfigFactory->getQuestionSetConfig(), $this->object->getId()
751 );
752
753 require_once 'Modules/Test/classes/class.ilTestExpressPage.php';
754 $_REQUEST['q_id'] = $this->object->getId();
756 }
757
758 $this->ctrl->redirectByClass($_GET["cmdClass"], "editQuestion");
759 }
760 if(strcmp($_SESSION["info"], "") != 0)
761 {
762 ilUtil::sendSuccess($_SESSION["info"] . "<br />" . $this->lng->txt("msg_obj_modified"), true);
763 }
764 else
765 {
766 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
767 }
768 $this->ctrl->redirect($this, 'editQuestion');
769 }
770 }
771 }
$test
Definition: Utf8Test.php:85
$_SESSION["AccountId"]
callNewIdListeners($a_new_id)
Call the new id listeners.
_questionExistsInTest($question_id, $test_id)
_isWriteable($question_id, $user_id)
Returns true if the question is writeable by a certain user.
global $ilUser
Definition: imgupload.php:15

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

605 {
606 global $ilUser;
607
608 $result = $this->writePostData();
609 if ($result == 0)
610 {
611 $ilUser->setPref("tst_lastquestiontype", $this->object->getQuestionType());
612 $ilUser->writePref("tst_lastquestiontype", $this->object->getQuestionType());
613 $this->object->saveToDb();
614 $originalexists = $this->object->_questionExists($this->object->original_id);
615 include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
616 if ($_GET["calling_test"] && $originalexists && assQuestion::_isWriteable($this->object->original_id, $ilUser->getId()))
617 {
618 $this->ctrl->redirect($this, "originalSyncForm");
619 }
620 elseif ($_GET["calling_test"])
621 {
622 $_GET["ref_id"] = $_GET["calling_test"];
623 ilUtil::redirect("ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=".$_GET["calling_test"]);
624 return;
625 }
626 elseif ($_GET["test_ref_id"])
627 {
628 global $tree, $ilDB, $ilPluginAdmin;
629
630 include_once ("./Modules/Test/classes/class.ilObjTest.php");
631 $_GET["ref_id"] = $_GET["test_ref_id"];
632 $test =& new ilObjTest($_GET["test_ref_id"], true);
633
634 require_once 'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
635 $testQuestionSetConfigFactory = new ilTestQuestionSetConfigFactory($tree, $ilDB, $ilPluginAdmin, $test);
636
637 $test->insertQuestion( $testQuestionSetConfigFactory->getQuestionSetConfig(), $this->object->getId() );
638
639 ilUtil::redirect("ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=".$_GET["test_ref_id"]);
640 }
641 else
642 {
643 $this->ctrl->setParameter($this, "q_id", $this->object->getId());
644 $this->editQuestion();
645 if (strcmp($_SESSION["info"], "") != 0)
646 {
647 ilUtil::sendSuccess($_SESSION["info"] . "<br />" . $this->lng->txt("msg_obj_modified"), false);
648 }
649 else
650 {
651 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), false);
652 }
653 $this->ctrl->setParameterByClass("ilAssQuestionPageGUI", "q_id", $this->object->getId());
654 $this->ctrl->redirectByClass("ilAssQuestionPageGUI", "edit");
655 }
656 }
657 }

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

777 {
778 global $ilUser;
779 $old_id = $_GET["q_id"];
780 $result = $this->writePostData();
781 if($result == 0)
782 {
783 $ilUser->setPref("tst_lastquestiontype", $this->object->getQuestionType());
784 $ilUser->writePref("tst_lastquestiontype", $this->object->getQuestionType());
785 $this->object->saveToDb();
786 $originalexists = $this->object->_questionExistsInPool($this->object->original_id);
787 include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
788 if(($_GET["calling_test"] || (isset($_GET['calling_consumer']) && (int)$_GET['calling_consumer'])) && $originalexists && assQuestion::_isWriteable($this->object->original_id, $ilUser->getId()))
789 {
790 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
791 $this->ctrl->setParameter($this, 'test_express_mode', $_REQUEST['test_express_mode']);
792 $this->ctrl->redirect($this, "originalSyncForm");
793 return;
794 }
795 elseif($_GET["calling_test"])
796 {
797 require_once 'Modules/Test/classes/class.ilObjTest.php';
798 $test = new ilObjTest($_GET["calling_test"]);
799 #var_dump(assQuestion::_questionExistsInTest($this->object->getId(), $test->getTestId()));
800 $q_id = $this->object->getId();
801 if(!assQuestion::_questionExistsInTest($this->object->getId(), $test->getTestId()))
802 {
803 global $tree, $ilDB, $ilPluginAdmin;
804
805 include_once("./Modules/Test/classes/class.ilObjTest.php");
806 $_GET["ref_id"] = $_GET["calling_test"];
807 $test = new ilObjTest($_GET["calling_test"], true);
808
809 require_once 'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
810 $testQuestionSetConfigFactory = new ilTestQuestionSetConfigFactory($tree, $ilDB, $ilPluginAdmin, $test);
811
812 $new_id = $test->insertQuestion(
813 $testQuestionSetConfigFactory->getQuestionSetConfig(), $this->object->getId()
814 );
815
816 $q_id = $new_id;
817 if(isset($_REQUEST['prev_qid']))
818 {
819 $test->moveQuestionAfter($this->object->getId() + 1, $_REQUEST['prev_qid']);
820 }
821
822 $this->ctrl->setParameter($this, 'q_id', $new_id);
823 $this->ctrl->setParameter($this, 'calling_test', $_GET['calling_test']);
824 #$this->ctrl->setParameter($this, 'test_ref_id', false);
825
826 }
827 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
828 if( /*$___test_express_mode || */
829 $_REQUEST['test_express_mode']
830 )
831 {
833 }
834 else
835 {
836 ilUtil::redirect("ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=" . $_GET["calling_test"]);
837 }
838 }
839 else
840 {
841 if($this->object->getId() != $old_id)
842 {
843 $this->callNewIdListeners($this->object->getId());
844 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
845 $this->ctrl->redirectByClass("ilobjquestionpoolgui", "questions");
846 }
847 if(strcmp($_SESSION["info"], "") != 0)
848 {
849 ilUtil::sendSuccess($_SESSION["info"] . "<br />" . $this->lng->txt("msg_obj_modified"), true);
850 }
851 else
852 {
853 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
854 }
855 $this->ctrl->redirectByClass("ilobjquestionpoolgui", "questions");
856 }
857 }
858 }

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

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

References $_POST, and suggestedsolution().

+ Here is the call graph for this function:

◆ saveTaxonomyAssignments()

assQuestionGUI::saveTaxonomyAssignments ( )
protected

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

1124 {
1125 if( count($this->getTaxonomyIds()) )
1126 {
1127 require_once 'Services/Taxonomy/classes/class.ilTaxAssignInputGUI.php';
1128
1129 foreach($this->getTaxonomyIds() as $taxonomyId)
1130 {
1131 $postvar = "tax_node_assign_$taxonomyId";
1132
1133 $tax_node_assign = new ilTaxAssignInputGUI($taxonomyId, true, '', $postvar);
1134 // TODO: determine tst/qpl when tax assigns become maintainable within tests
1135 $tax_node_assign->saveInput("qpl", $this->object->getObjId(), "quest", $this->object->getId());
1136 }
1137 }
1138 }

References getTaxonomyIds().

Referenced by 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(), assOrderingQuestionGUI\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:

◆ setErrorMessage()

assQuestionGUI::setErrorMessage (   $errormessage)

◆ setNavigationGUI()

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

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

233 {
234 $this->navigationGUI = $navigationGUI;
235 }

References $navigationGUI.

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

+ Here is the caller graph for this function:

◆ setOutputMode()

assQuestionGUI::setOutputMode (   $outputMode)
Parameters
string$outputMode

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

207 {
208 $this->outputMode = $outputMode;
209 }

References $outputMode.

Referenced by suggestedsolution().

+ Here is the caller graph for this function:

◆ setPresentationContext()

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

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

168 {
169 $this->presentationContext = $presentationContext;
170 }

References $presentationContext.

◆ setPreviewSession()

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

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

2166 {
2167 $this->previewSession = $previewSession;
2168 }

References $previewSession.

◆ setPreviousSolutionPrefilled()

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

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

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

References $previousSolutionPrefilled.

Referenced by ilTestPlayerAbstractGUI\showQuestionEditable().

+ Here is the caller graph for this function:

◆ setQuestionActionCmd()

assQuestionGUI::setQuestionActionCmd (   $questionActionCmd)

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

271 {
272 $this->questionActionCmd = $questionActionCmd;
273
274 if( is_object($this->object) )
275 {
276 $this->object->questionActionCmd = $questionActionCmd;
277 }
278 }

References $questionActionCmd.

◆ setQuestionCount()

assQuestionGUI::setQuestionCount (   $a_question_count)

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

908 {
909 $this->question_count = $a_question_count;
910 }

◆ setQuestionHeaderBlockBuilder()

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

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

266 {
267 $this->questionHeaderBlockBuilder = $questionHeaderBlockBuilder;
268 }

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

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

◆ setSequenceNumber()

assQuestionGUI::setSequenceNumber (   $nr)

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

898 {
899 $this->sequence_no = $nr;
900 }

◆ setTargetGui()

assQuestionGUI::setTargetGui (   $linkTargetGui)

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

248 {
249 $this->setTargetGuiClass( get_class($linkTargetGui) );
250 }
setTargetGuiClass($targetGuiClass)

References setTargetGuiClass().

+ Here is the call graph for this function:

◆ setTargetGuiClass()

assQuestionGUI::setTargetGuiClass (   $targetGuiClass)

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

253 {
254 $this->targetGuiClass = $targetGuiClass;
255 }

References $targetGuiClass.

Referenced by setTargetGui().

+ Here is the caller graph for this function:

◆ setTaxonomyIds()

assQuestionGUI::setTaxonomyIds (   $taxonomyIds)

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

238 {
239 $this->taxonomyIds = $taxonomyIds;
240 }

References $taxonomyIds.

◆ showHints()

assQuestionGUI::showHints ( )

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

2199 {
2200 global $ilCtrl;
2201 $ilCtrl->redirectByClass('ilAssQuestionHintsGUI', ilAssQuestionHintsGUI::CMD_SHOW_LIST);
2202 }

References $ilCtrl, and ilAssQuestionHintsGUI\CMD_SHOW_LIST.

◆ showSuggestedSolution()

assQuestionGUI::showSuggestedSolution ( )

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

1278 {
1279 $this->suggestedsolution();
1280 }

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

1288 {
1289 global $ilUser;
1290 global $ilAccess;
1291
1292 $save = (is_array($_POST["cmd"]) && array_key_exists("suggestedsolution", $_POST["cmd"])) ? TRUE : FALSE;
1293
1294 if ($save && $_POST["deleteSuggestedSolution"] == 1)
1295 {
1296 $this->object->deleteSuggestedSolutions();
1297 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
1298 $this->ctrl->redirect($this, "suggestedsolution");
1299 }
1300
1301 $output = "";
1302 $solution_array = $this->object->getSuggestedSolution(0);
1303 $options = array(
1304 "lm" => $this->lng->txt("obj_lm"),
1305 "st" => $this->lng->txt("obj_st"),
1306 "pg" => $this->lng->txt("obj_pg"),
1307 "git" => $this->lng->txt("glossary_term"),
1308 "file" => $this->lng->txt("fileDownload"),
1309 "text" => $this->lng->txt("solutionText")
1310 );
1311
1312 if ((strcmp($_POST["solutiontype"], "file") == 0) && (strcmp($solution_array["type"], "file") != 0))
1313 {
1314 $solution_array = array(
1315 "type" => "file"
1316 );
1317 }
1318 elseif ((strcmp($_POST["solutiontype"], "text") == 0) && (strcmp($solution_array["type"], "text") != 0))
1319 {
1320 $oldOutputMode = $this->getOutputMode();
1321 $this->setOutputMode(self::OUTPUT_MODE_CONTENT_EDITING);
1322
1323 $solution_array = array(
1324 "type" => "text",
1325 "value" => $this->getSolutionOutput(0, NULL, FALSE, FALSE, TRUE, FALSE, TRUE)
1326 );
1327 $this->setOutputMode($oldsaveSuggestedSolutionOutputMode);
1328 }
1329 if ($save && strlen($_POST["filename"]))
1330 {
1331 $solution_array["value"]["filename"] = $_POST["filename"];
1332 }
1333 if ($save && strlen($_POST["solutiontext"]))
1334 {
1335 $solution_array["value"] = $_POST["solutiontext"];
1336 }
1337 include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
1338 if (count($solution_array))
1339 {
1340 $form = new ilPropertyFormGUI();
1341 $form->setFormAction($this->ctrl->getFormAction($this));
1342 $form->setTitle($this->lng->txt("solution_hint"));
1343 $form->setMultipart(TRUE);
1344 $form->setTableWidth("100%");
1345 $form->setId("suggestedsolutiondisplay");
1346
1347 // suggested solution output
1348 include_once "./Modules/TestQuestionPool/classes/class.ilSolutionTitleInputGUI.php";
1349 $title = new ilSolutionTitleInputGUI($this->lng->txt("showSuggestedSolution"), "solutiontype");
1350 $template = new ilTemplate("tpl.il_as_qpl_suggested_solution_input_presentation.html", TRUE, TRUE, "Modules/TestQuestionPool");
1351 if (strlen($solution_array["internal_link"]))
1352 {
1353 $href = assQuestion::_getInternalLinkHref($solution_array["internal_link"]);
1354 $template->setCurrentBlock("preview");
1355 $template->setVariable("TEXT_SOLUTION", $this->lng->txt("suggested_solution"));
1356 $template->setVariable("VALUE_SOLUTION", " <a href=\"$href\" target=\"content\">" . $this->lng->txt("view"). "</a> ");
1357 $template->parseCurrentBlock();
1358 }
1359 elseif ((strcmp($solution_array["type"], "file") == 0) && (is_array($solution_array["value"])))
1360 {
1361 $href = $this->object->getSuggestedSolutionPathWeb() . $solution_array["value"]["name"];
1362 $template->setCurrentBlock("preview");
1363 $template->setVariable("TEXT_SOLUTION", $this->lng->txt("suggested_solution"));
1364 $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> ");
1365 $template->parseCurrentBlock();
1366 }
1367 $template->setVariable("TEXT_TYPE", $this->lng->txt("type"));
1368 $template->setVariable("VALUE_TYPE", $options[$solution_array["type"]]);
1369 $title->setHtml($template->get());
1370 $deletesolution = new ilCheckboxInputGUI("", "deleteSuggestedSolution");
1371 $deletesolution->setOptionTitle($this->lng->txt("deleteSuggestedSolution"));
1372 $title->addSubItem($deletesolution);
1373 $form->addItem($title);
1374
1375 if (strcmp($solution_array["type"], "file") == 0)
1376 {
1377 // file
1378 $file = new ilFileInputGUI($this->lng->txt("fileDownload"), "file");
1379 $file->setRequired(TRUE);
1380 $file->enableFileNameSelection("filename");
1381 //$file->setSuffixes(array("doc","xls","png","jpg","gif","pdf"));
1382 if( $_FILES["file"]["tmp_name"] && $file->checkInput() )
1383 {
1384 if (!file_exists($this->object->getSuggestedSolutionPath())) ilUtil::makeDirParents($this->object->getSuggestedSolutionPath());
1385
1386 $res = ilUtil::moveUploadedFile($_FILES["file"]["tmp_name"], $_FILES["file"]["name"], $this->object->getSuggestedSolutionPath() . $_FILES["file"]["name"]);
1387 if ($res)
1388 {
1389 ilUtil::renameExecutables($this->object->getSuggestedSolutionPath());
1390
1391 // remove an old file download
1392 if (is_array($solution_array["value"])) @unlink($this->object->getSuggestedSolutionPath() . $solution_array["value"]["name"]);
1393 $file->setValue($_FILES["file"]["name"]);
1394 $this->object->saveSuggestedSolution("file", "", 0, array("name" => $_FILES["file"]["name"], "type" => $_FILES["file"]["type"], "size" => $_FILES["file"]["size"], "filename" => $_POST["filename"]));
1395 $originalexists = $this->object->_questionExistsInPool($this->object->original_id);
1396 if (($_GET["calling_test"] || (isset($_GET['calling_consumer']) && (int)$_GET['calling_consumer'])) && $originalexists && assQuestion::_isWriteable($this->object->original_id, $ilUser->getId()))
1397 {
1398 return $this->originalSyncForm("suggestedsolution");
1399 }
1400 else
1401 {
1402 ilUtil::sendSuccess($this->lng->txt("suggested_solution_added_successfully"), TRUE);
1403 $this->ctrl->redirect($this, "suggestedsolution");
1404 }
1405 }
1406 else
1407 {
1408 // BH: $res as info string? wtf? it holds a bool or something else!!?
1410 }
1411 }
1412 else
1413 {
1414 if (is_array($solution_array["value"]))
1415 {
1416 $file->setValue($solution_array["value"]["name"]);
1417 $file->setFilename((strlen($solution_array["value"]["filename"])) ? $solution_array["value"]["filename"] : $solution_array["value"]["name"]);
1418 }
1419 }
1420 $form->addItem($file);
1421 $hidden = new ilHiddenInputGUI("solutiontype");
1422 $hidden->setValue("file");
1423 $form->addItem($hidden);
1424 }
1425 else if (strcmp($solution_array["type"], "text") == 0)
1426 {
1427 $solutionContent = $solution_array['value'];
1428 $solutionContent = $this->object->fixSvgToPng($solutionContent);
1429 $solutionContent = $this->object->fixUnavailableSkinImageSources($solutionContent);
1430 $question = new ilTextAreaInputGUI($this->lng->txt("solutionText"), "solutiontext");
1431 $question->setValue($this->object->prepareTextareaOutput($solutionContent));
1432 $question->setRequired(TRUE);
1433 $question->setRows(10);
1434 $question->setCols(80);
1435 $question->setUseRte(TRUE);
1436 $question->addPlugin("latex");
1437 $question->addButton("latex");
1438 $question->setRTESupport($this->object->getId(), "qpl", "assessment");
1439 $hidden = new ilHiddenInputGUI("solutiontype");
1440 $hidden->setValue("text");
1441 $form->addItem($hidden);
1442 $form->addItem($question);
1443 }
1444 if ($ilAccess->checkAccess("write", "", $_GET['ref_id']))
1445 {
1446 $form->addCommandButton('showSuggestedSolution', $this->lng->txt('cancel'));
1447 $form->addCommandButton('suggestedsolution', $this->lng->txt('save'));
1448 }
1449
1450 if ($save)
1451 {
1452 if ($form->checkInput())
1453 {
1454 switch ($solution_array["type"])
1455 {
1456 case "file":
1457 $this->object->saveSuggestedSolution("file", "", 0, array(
1458 "name" => $solution_array["value"]["name"],
1459 "type" => $solution_array["value"]["type"],
1460 "size" => $solution_array["value"]["size"],
1461 "filename" => $_POST["filename"]
1462 ));
1463 break;
1464 case "text":
1465 $this->object->saveSuggestedSolution("text", "", 0, $solution_array["value"]);
1466 break;
1467 }
1468 $originalexists = $this->object->_questionExistsInPool($this->object->original_id);
1469 if (($_GET["calling_test"] || (isset($_GET['calling_consumer']) && (int)$_GET['calling_consumer'])) && $originalexists && assQuestion::_isWriteable($this->object->original_id, $ilUser->getId()))
1470 {
1471 return $this->originalSyncForm("suggestedsolution");
1472 }
1473 else
1474 {
1475 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
1476 $this->ctrl->redirect($this, "suggestedsolution");
1477 }
1478 }
1479 }
1480
1481 $output = $form->getHTML();
1482 }
1483
1484 $savechange = (strcmp($this->ctrl->getCmd(), "saveSuggestedSolution") == 0) ? TRUE : FALSE;
1485
1486 $changeoutput = "";
1487 if ($ilAccess->checkAccess("write", "", $_GET['ref_id']))
1488 {
1489 $formchange = new ilPropertyFormGUI();
1490 $formchange->setFormAction($this->ctrl->getFormAction($this));
1491 $formchange->setTitle((count($solution_array)) ? $this->lng->txt("changeSuggestedSolution") : $this->lng->txt("addSuggestedSolution"));
1492 $formchange->setMultipart(FALSE);
1493 $formchange->setTableWidth("100%");
1494 $formchange->setId("suggestedsolution");
1495
1496 $solutiontype = new ilRadioGroupInputGUI($this->lng->txt("suggestedSolutionType"), "solutiontype");
1497 foreach($options as $opt_value => $opt_caption)
1498 {
1499 $solutiontype->addOption(new ilRadioOption($opt_caption, $opt_value));
1500 }
1501 if (count($solution_array))
1502 {
1503 $solutiontype->setValue($solution_array["type"]);
1504 }
1505 $solutiontype->setRequired(TRUE);
1506 $formchange->addItem($solutiontype);
1507
1508 $formchange->addCommandButton("saveSuggestedSolution", $this->lng->txt("select"));
1509
1510 if ($savechange)
1511 {
1512 $formchange->checkInput();
1513 }
1514 $changeoutput = $formchange->getHTML();
1515 }
1516
1517 $this->tpl->setVariable("ADM_CONTENT", $changeoutput . $output);
1518 }
print $file
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)
setOutputMode($outputMode)
_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(!is_array($argv)) $options

References $_GET, $_POST, $file, $ilUser, $options, $res, assQuestion\_getInternalLinkHref(), assQuestion\_isWriteable(), getOutputMode(), getSolutionOutput(), ilUtil\makeDirParents(), ilUtil\moveUploadedFile(), originalSyncForm(), ilUtil\prepareFormOutput(), ilUtil\renameExecutables(), ilUtil\sendInfo(), ilUtil\sendSuccess(), and setOutputMode().

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

525 {
526 $original_id = $this->object->original_id;
527 if ($original_id)
528 {
529 $this->object->syncWithOriginal();
530 }
531 if (strlen($_GET["return_to"]))
532 {
533 $this->ctrl->redirect($this, $_GET["return_to"]);
534 }
535 if (strlen($_REQUEST["return_to_fb"]))
536 {
537 $this->ctrl->redirectByClass('ilAssQuestionFeedbackEditingGUI', 'showFeedbackForm');
538 }
539 else
540 {
541 if(isset($_GET['calling_consumer']) && (int)$_GET['calling_consumer'])
542 {
543 $ref_id = (int)$_GET['calling_consumer'];
545 if($consumer instanceof ilQuestionEditingFormConsumer)
546 {
547 ilUtil::redirect($consumer->getQuestionEditingFormBackTarget($_GET['consumer_context']));
548 }
549 require_once 'Services/Link/classes/class.ilLink.php';
551 }
552 $_GET["ref_id"] = $_GET["calling_test"];
553
554 if($_REQUEST['test_express_mode'])
555 {
557 }
558 else
559 {
560 ilUtil::redirect("ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=".$_GET["calling_test"]);
561 }
562 }
563 }

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

+ Here is the call graph for this function:

◆ writePostData()

assQuestionGUI::writePostData ( )
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 @access protected

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

292 {
293 }

Referenced by assOrderingQuestionGUI\addanswers(), assTextSubsetGUI\addanswers(), assMultipleChoiceGUI\addchoice(), assSingleChoiceGUI\addchoice(), assMatchingQuestionGUI\adddefinitions(), assClozeTestGUI\addgap(), assJavaAppletGUI\addkvp(), assMatchingQuestionGUI\addpairs(), assTextQuestionGUI\addSuggestedSolution(), assMatchingQuestionGUI\addterms(), assErrorTextGUI\analyze(), apply(), assOrderingQuestionGUI\changeToPictures(), assOrderingQuestionGUI\changeToText(), assClozeTestGUI\createGaps(), assImagemapQuestionGUI\deleteImage(), assOrderingQuestionGUI\downanswers(), assFlashQuestionGUI\flashAddParam(), assOrderingQuestionGUI\orderNestedPictures(), assOrderingQuestionGUI\orderNestedTerms(), assFormulaQuestionGUI\parseQuestion(), assOrderingQuestionGUI\removeanswers(), assTextSubsetGUI\removeanswers(), assImagemapQuestionGUI\removeArea(), assMultipleChoiceGUI\removechoice(), assSingleChoiceGUI\removechoice(), assMatchingQuestionGUI\removedefinitions(), assClozeTestGUI\removegap(), assOrderingQuestionGUI\removeimageanswers(), assMultipleChoiceGUI\removeimagechoice(), assSingleChoiceGUI\removeimagechoice(), assMatchingQuestionGUI\removeimagedefinitions(), assMatchingQuestionGUI\removeimageterms(), assJavaAppletGUI\removekvp(), assMatchingQuestionGUI\removepairs(), assMatchingQuestionGUI\removeterms(), save(), saveEdit(), assFormulaQuestionGUI\saveFQ(), saveReturn(), assFormulaQuestionGUI\saveReturnFQ(), assFlashQuestionGUI\suggestRange(), assFormulaQuestionGUI\suggestRange(), assOrderingQuestionGUI\upanswers(), assOrderingQuestionGUI\uploadanswers(), assMultipleChoiceGUI\uploadchoice(), assSingleChoiceGUI\uploadchoice(), assMatchingQuestionGUI\uploaddefinitions(), assKprimChoiceGUI\uploadImage(), and assMatchingQuestionGUI\uploadterms().

+ Here is the caller graph for this function:

◆ writeQuestionGenericPostData()

assQuestionGUI::writeQuestionGenericPostData ( )
protected

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

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

References $_POST, and ilUtil\stripOnlySlashes().

Referenced by assClozeTestGUI\writePostData(), assErrorTextGUI\writePostData(), assFileUploadGUI\writePostData(), assFlashQuestionGUI\writePostData(), assImagemapQuestionGUI\writePostData(), assJavaAppletGUI\writePostData(), assLongMenuGUI\writePostData(), assMatchingQuestionGUI\writePostData(), assMultipleChoiceGUI\writePostData(), assNumericGUI\writePostData(), assOrderingHorizontalGUI\writePostData(), assOrderingQuestionGUI\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

◆ $error

assQuestionGUI::$error

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

◆ $errormessage

assQuestionGUI::$errormessage

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

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

◆ $lng

assQuestionGUI::$lng

◆ $navigationGUI

assQuestionGUI::$navigationGUI
private

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

Referenced by getNavigationGUI(), and setNavigationGUI().

◆ $object

assQuestionGUI::$object

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

Referenced by callNewIdListeners().

◆ $outputMode

assQuestionGUI::$outputMode = self::OUTPUT_MODE_SCREEN
private

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

Referenced by getOutputMode(), and setOutputMode().

◆ $presentationContext

assQuestionGUI::$presentationContext = null
private

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

Referenced by getPresentationContext(), and setPresentationContext().

◆ $previewSession

assQuestionGUI::$previewSession
private

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

Referenced by getPreviewSession(), and setPreviewSession().

◆ $previousSolutionPrefilled

assQuestionGUI::$previousSolutionPrefilled = false
private

◆ $question_count

assQuestionGUI::$question_count

question count in test

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

Referenced by getQuestionCount().

◆ $questionActionCmd

assQuestionGUI::$questionActionCmd = 'handleQuestionAction'
private

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

Referenced by getQuestionActionCmd(), and setQuestionActionCmd().

◆ $questionHeaderBlockBuilder

assQuestionGUI::$questionHeaderBlockBuilder
private

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

Referenced by setQuestionHeaderBlockBuilder().

◆ $sequence_no

assQuestionGUI::$sequence_no

sequence number in test

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

Referenced by getSequenceNumber().

◆ $targetGuiClass

assQuestionGUI::$targetGuiClass = null
private

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

Referenced by getTargetGuiClass(), and setTargetGuiClass().

◆ $taxonomyIds

assQuestionGUI::$taxonomyIds = array()
private

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

Referenced by getTaxonomyIds(), and setTaxonomyIds().

◆ $tpl

◆ FORM_ENCODING_MULTIPART

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

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

Referenced by getFormEncodingType().

◆ FORM_MODE_ADJUST

const assQuestionGUI::FORM_MODE_ADJUST = 'adjust'

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

◆ FORM_MODE_EDIT

const assQuestionGUI::FORM_MODE_EDIT = 'edit'

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

◆ OUTPUT_MODE_CONTENT_EDITING

const assQuestionGUI::OUTPUT_MODE_CONTENT_EDITING = 'outModeUsrSol'

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

Referenced by isContentEditingOutputMode().

◆ OUTPUT_MODE_PDF

◆ OUTPUT_MODE_SCREEN

const assQuestionGUI::OUTPUT_MODE_SCREEN = 'outModeScreen'

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

◆ PRESENTATION_CONTEXT_RESULTS

const assQuestionGUI::PRESENTATION_CONTEXT_RESULTS = 'pContextResults'

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

◆ PRESENTATION_CONTEXT_TEST

const assQuestionGUI::PRESENTATION_CONTEXT_TEST = 'pContextTest'

◆ SESSION_PREVIEW_DATA_BASE_INDEX

const assQuestionGUI::SESSION_PREVIEW_DATA_BASE_INDEX = 'ilAssQuestionPreviewAnswers'

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


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