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

Text question GUI representation. More...

+ Inheritance diagram for assTextQuestionGUI:
+ Collaboration diagram for assTextQuestionGUI:

Public Member Functions

 __construct ($id=-1)
 assTextQuestionGUI constructor More...
 
 editQuestion ($checkonly=false)
 Creates an output of the edit form for the question. More...
 
 outAdditionalOutput ()
 
 magicAfterTestOutput ()
 
 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)
 Get the question solution output. More...
 
 getPreview ($show_question_only=false, $showInlineFeedback=false)
 
 getTestOutput ($active_id, $pass=null, $is_postponed=false, $use_post_solutions=false, $inlineFeedback=false)
 
 addSuggestedSolution ()
 
 setQuestionTabs ()
 Sets the ILIAS tabs for this question type. More...
 
 getSpecificFeedbackOutput ($active_id, $pass)
 Returns the answer specific feedback for the question. More...
 
 writeQuestionSpecificPostData (ilPropertyFormGUI $form)
 Extracts the question specific values from $_POST and applies them to the data object. More...
 
 writeAnswerSpecificPostData (ilPropertyFormGUI $form)
 Extracts the answer specific values from $_POST and applies them to the data object. More...
 
 populateQuestionSpecificFormPart (\ilPropertyFormGUI $form)
 
 populateAnswerSpecificFormPart (\ilPropertyFormGUI $form)
 
 getAfterParticipationSuppressionAnswerPostVars ()
 Returns a list of postvars which will be suppressed in the form output when used in scoring adjustment. More...
 
 getAfterParticipationSuppressionQuestionPostVars ()
 Returns a list of postvars which will be suppressed in the form output when used in scoring adjustment. More...
 
 getAggregatedAnswersView ($relevant_answers)
 Returns an html string containing a question specific representation of the answers so far given in the test for use in the right column in the scoring adjustment user interface. More...
 
- Public Member Functions inherited from assQuestionGUI
 __construct ()
 assQuestionGUI constructor More...
 
 executeCommand ()
 execute command More...
 
 getCommand ($cmd)
 
 getType ()
 needed for page editor compliance More...
 
 getPresentationContext ()
 
 setPresentationContext ($presentationContext)
 
 isTestPresentationContext ()
 
 isPreviousSolutionPrefilled ()
 
 setPreviousSolutionPrefilled ($previousSolutionPrefilled)
 
 getRenderPurpose ()
 
 setRenderPurpose ($renderPurpose)
 
 isRenderPurposePrintPdf ()
 
 isRenderPurposePreview ()
 
 isRenderPurposeInputValue ()
 
 isRenderPurposePlayback ()
 
 isRenderPurposeDemoplay ()
 
 renderPurposeSupportsFormHtml ()
 
 getEditContext ()
 
 setEditContext ($editContext)
 
 isAuthoringEditContext ()
 
 isAdjustmentEditContext ()
 
 setAdjustmentEditContext ()
 
 getNavigationGUI ()
 
 setNavigationGUI ($navigationGUI)
 
 setTaxonomyIds ($taxonomyIds)
 
 getTaxonomyIds ()
 
 setTargetGui ($linkTargetGui)
 
 setTargetGuiClass ($targetGuiClass)
 
 getTargetGuiClass ()
 
 setQuestionHeaderBlockBuilder ($questionHeaderBlockBuilder)
 
 getQuestionHeaderBlockBuilder ()
 
 setQuestionActionCmd ($questionActionCmd)
 
 getQuestionActionCmd ()
 
createQuestionGUI ($question_type, $question_id=-1)
 Creates a question gui representation. More...
 
 populateJavascriptFilesRequiredForWorkForm (ilTemplate $tpl)
 
 getQuestionTemplate ()
 get question template More...
 
 getILIASPage ($html="")
 Returns the ILIAS Page around a question. More...
 
 outQuestionPage ($a_temp_var, $a_postponed=false, $active_id="", $html="")
 output question page More...
 
 cancel ()
 cancel action More...
 
 originalSyncForm ($return_to="", $return_to_feedback='')
 
 sync ()
 
 cancelSync ()
 
 saveEdit ()
 save question More...
 
 save ()
 save question More...
 
 saveReturn ()
 save question More...
 
 apply ()
 apply changes More...
 
 getContextPath ($cont_obj, $a_endnode_id, $a_startnode_id=1)
 get context path in content object tree More...
 
 setSequenceNumber ($nr)
 
 getSequenceNumber ()
 
 setQuestionCount ($a_question_count)
 
 getQuestionCount ()
 
 getErrorMessage ()
 
 setErrorMessage ($errormessage)
 
 addErrorMessage ($errormessage)
 
 outAdditionalOutput ()
 
 getQuestionType ()
 Returns the question type string. More...
 
 getAsValueAttribute ($a_value)
 Returns a HTML value attribute. More...
 
 addNewIdListener (&$a_object, $a_method, $a_parameters="")
 Add a listener that is notified with the new question ID, when a new question is saved. More...
 
 callNewIdListeners ($a_new_id)
 Call the new id listeners. More...
 
 addQuestionFormCommandButtons ($form)
 Add the command buttons of a question properties form. More...
 
 addBasicQuestionFormProperties ($form)
 Add basic question form properties: assessment: title, author, description, question, working time. More...
 
 getAnswerFeedbackOutput ($active_id, $pass)
 Returns the answer generic feedback depending on the results of the question. More...
 
 getGenericFeedbackOutput ($active_id, $pass)
 Returns the answer specific feedback for the question. More...
 
 getGenericFeedbackOutputForCorrectSolution ()
 
 getGenericFeedbackOutputForIncorrectSolution ()
 
 getSpecificFeedbackOutput ($active_id, $pass)
 Returns the answer specific feedback for the question. More...
 
 outQuestionType ()
 
 showSuggestedSolution ()
 
 suggestedsolution ()
 Allows to add suggested solutions for questions. More...
 
 outSolutionExplorer ()
 
 saveSuggestedSolution ()
 
 cancelExplorer ()
 
 outPageSelector ()
 
 outChapterSelector ()
 
 outGlossarySelector ()
 
 linkChilds ()
 
 addPG ()
 
 addST ()
 
 addGIT ()
 
 isSaveCommand ()
 
 setQuestionTabs ()
 
 addTab_SuggestedSolution (ilTabsGUI $tabs, $classname)
 
 getEditQuestionTabCommands ()
 
 getSolutionOutput ( $active_id, $pass=null, $graphicalOutput=false, $result_output=false, $show_question_only=true, $show_feedback=false, $show_correct_solution=false, $show_manual_scoring=false, $show_question_text=true)
 
 isAutosaveable ()
 
 getPreview ($show_question_only=false, $showInlineFeedback=false)
 
 outQuestionForTest ( $formaction, $active_id, $pass, $is_question_postponed=false, $user_post_solutions=false, $show_specific_inline_feedback=false)
 
 magicAfterTestOutput ()
 
 getTestOutput ( $active_id, $pass, $is_question_postponed, $user_post_solutions, $show_specific_inline_feedback)
 
 getFormEncodingType ()
 
 setPreviewSession ($previewSession)
 
 getPreviewSession ()
 
 showHints ()
 
- Public Member Functions inherited from ilGuiQuestionScoringAdjustable
 populateQuestionSpecificFormPart (ilPropertyFormGUI $form)
 Adds the question specific forms parts to a question property form gui. More...
 
 writeQuestionSpecificPostData (ilPropertyFormGUI $form)
 Extracts the question specific values from $_POST and applies them to the data object. More...
 
 getAfterParticipationSuppressionQuestionPostVars ()
 Returns a list of postvars which will be suppressed in the form output when used in scoring adjustment. More...
 
 getAggregatedAnswersView ($relevant_answers)
 Returns an html string containing a question specific representation of the answers so far given in the test for use in the right column in the scoring adjustment user interface. More...
 
- Public Member Functions inherited from ilGuiAnswerScoringAdjustable
 populateAnswerSpecificFormPart (ilPropertyFormGUI $form)
 Adds the answer specific form parts to a question property form gui. More...
 
 writeAnswerSpecificPostData (ilPropertyFormGUI $form)
 Extracts the answer specific values from $_POST and applies them to the data object. More...
 
 getAfterParticipationSuppressionAnswerPostVars ()
 Returns a list of postvars which will be suppressed in the form output when used in scoring adjustment. More...
 

Protected Member Functions

 writePostData ($always=false)
 {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
} More...
 
 getJsCode ()
 
- Protected Member Functions inherited from assQuestionGUI
 writePostData ($always=false)
 Evaluates a posted edit form and writes the form data in the question object. More...
 
 renderEditForm ($form)
 
 getUseUnchangedAnswerCheckboxHtml ()
 
 getPreviousSolutionProvidedMessage ()
 
 getPreviousSolutionConfirmationCheckboxHtml ()
 
 saveTaxonomyAssignments ()
 
 populateTaxonomyFormSection (ilPropertyFormGUI $form)
 
 getBasicEditQuestionTabCommands ()
 
 getAdditionalEditQuestionCommands ()
 
 addTab_QuestionFeedback (ilTabsGUI $tabs)
 adds the feedback tab to ilTabsGUI More...
 
 addTab_QuestionHints (ilTabsGUI $tabs)
 adds the hints tab to ilTabsGUI More...
 
 addTab_QuestionPreview (ilTabsGUI $tabsGUI)
 
 hasCorrectSolution ($activeId, $passIndex)
 
 writeQuestionGenericPostData ()
 
 completeTestOutputFormAction ($formAction, $active_id, $pass)
 
 addBackTab (ilTabsGUI $ilTabs)
 
 buildBasicEditFormObject ()
 
 buildEditForm ()
 

Private Member Functions

 getBestAnswer ($asHtml)
 
 getUserAnswer ($active_id, $pass)
 

Static Private Member Functions

static buildAnswerTextOnlyArray ($answers)
 

Additional Inherited Members

- Static Public Member Functions inherited from assQuestionGUI
static _getQuestionGUI ($question_type, $question_id=-1)
 Creates a question gui representation and returns the alias to the question gui note: please do not use $this inside this method to allow static calls. More...
 
static _getGUIClassNameForId ($a_q_id)
 
static _getClassNameForQType ($q_type)
 
static getCommandsFromClassConstants ($guiClassName, $cmdConstantNameBegin='CMD_')
 extracts values of all constants of given class with given prefix as array can be used to get all possible commands in case of these commands are defined as constants More...
 
- Data Fields inherited from assQuestionGUI
const FORM_MODE_EDIT = 'edit'
 
const FORM_MODE_ADJUST = 'adjust'
 
const FORM_ENCODING_URLENCODE = 'application/x-www-form-urlencoded'
 
const FORM_ENCODING_MULTIPART = 'multipart/form-data'
 
const SESSION_PREVIEW_DATA_BASE_INDEX = 'ilAssQuestionPreviewAnswers'
 
 $object
 
 $tpl
 
 $lng
 
 $error
 
 $errormessage
 
 $sequence_no
 sequence number in test More...
 
 $question_count
 question count in test More...
 
const PRESENTATION_CONTEXT_TEST = 'pContextTest'
 
const PRESENTATION_CONTEXT_RESULTS = 'pContextResults'
 
const RENDER_PURPOSE_PLAYBACK = 'renderPurposePlayback'
 
const RENDER_PURPOSE_DEMOPLAY = 'renderPurposeDemoplay'
 
const RENDER_PURPOSE_PREVIEW = 'renderPurposePreview'
 
const RENDER_PURPOSE_PRINT_PDF = 'renderPurposePrintPdf'
 
const RENDER_PURPOSE_INPUT_VALUE = 'renderPurposeInputValue'
 
const EDIT_CONTEXT_AUTHORING = 'authoring'
 
const EDIT_CONTEXT_ADJUSTMENT = 'adjustment'
 
- Protected Attributes inherited from assQuestionGUI
 $editForm
 

Detailed Description

Text question GUI representation.

The assTextQuestionGUI class encapsulates the GUI representation for text questions.

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

@ilCtrl_Calls assTextQuestionGUI: ilFormPropertyDispatchGUI

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

Constructor & Destructor Documentation

◆ __construct()

assTextQuestionGUI::__construct (   $id = -1)

assTextQuestionGUI constructor

The constructor takes possible arguments an creates an instance of the assTextQuestionGUI object.

Parameters
integer$idThe database id of a text question object

Definition at line 32 of file class.assTextQuestionGUI.php.

33 {
34 parent::__construct();
35 include_once "./Modules/TestQuestionPool/classes/class.assTextQuestion.php";
36 $this->object = new assTextQuestion();
37 if ($id >= 0) {
38 $this->object->loadFromDb($id);
39 }
40 }
Class for text questions.
if(!array_key_exists('StateId', $_REQUEST)) $id

References $id.

Member Function Documentation

◆ addSuggestedSolution()

assTextQuestionGUI::addSuggestedSolution ( )

Definition at line 421 of file class.assTextQuestionGUI.php.

422 {
423 $_SESSION["subquestion_index"] = 0;
424 if ($_POST["cmd"]["addSuggestedSolution"]) {
425 if ($this->writePostData()) {
427 $this->editQuestion();
428 return;
429 }
430 if (!$this->checkInput()) {
431 ilUtil::sendInfo($this->lng->txt("fill_out_all_required_fields_add_answer"));
432 $this->editQuestion();
433 return;
434 }
435 }
436 $this->object->saveToDb();
437 $this->ctrl->setParameter($this, "q_id", $this->object->getId());
438 $this->tpl->setVariable("HEADER", $this->object->getTitle());
439 $this->getQuestionTemplate();
440 parent::addSuggestedSolution();
441 }
$_POST["username"]
$_SESSION["AccountId"]
getQuestionTemplate()
get question template
writePostData($always=false)
{Evaluates a posted edit form and writes the form data in the question object.integer A positive valu...
editQuestion($checkonly=false)
Creates an output of the edit form for the question.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.

References $_POST, $_SESSION, editQuestion(), assQuestionGUI\getErrorMessage(), assQuestionGUI\getQuestionTemplate(), ilUtil\sendInfo(), and writePostData().

+ Here is the call graph for this function:

◆ buildAnswerTextOnlyArray()

static assTextQuestionGUI::buildAnswerTextOnlyArray (   $answers)
staticprivate

Definition at line 105 of file class.assTextQuestionGUI.php.

106 {
107 $answerTexts = array();
108
109 foreach ($answers as $answer) {
110 $answerTexts[] = $answer->getAnswertext();
111 }
112
113 return $answerTexts;
114 }

◆ editQuestion()

assTextQuestionGUI::editQuestion (   $checkonly = false)

Creates an output of the edit form for the question.

@access public

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

65 {
66 $save = $this->isSaveCommand();
67 $this->getQuestionTemplate();
68
69 include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
71 $this->editForm = $form;
72
73 $form->setFormAction($this->ctrl->getFormAction($this));
74 $form->setTitle($this->outQuestionType());
75 $form->setMultipart(true);
76 $form->setTableWidth("100%");
77 $form->setId("asstextquestion");
78
82
83
85
87
88 $errors = false;
89
90 if ($save) {
91 $form->setValuesByPost();
92 $errors = !$form->checkInput();
93 $form->setValuesByPost(); // again, because checkInput now performs the whole stripSlashes handling and we need this if we don't want to have duplication of backslashes
94 if ($errors) {
95 $checkonly = false;
96 }
97 }
98
99 if (!$checkonly) {
100 $this->tpl->setVariable("QUESTION_DATA", $form->getHTML());
101 }
102 return $errors;
103 }
populateTaxonomyFormSection(ilPropertyFormGUI $form)
addQuestionFormCommandButtons($form)
Add the command buttons of a question properties form.
addBasicQuestionFormProperties($form)
Add basic question form properties: assessment: title, author, description, question,...
populateQuestionSpecificFormPart(\ilPropertyFormGUI $form)
populateAnswerSpecificFormPart(\ilPropertyFormGUI $form)
This class represents a property form user interface.
$errors
Definition: index.php:6
if(isset($_POST['submit'])) $form

References $errors, $form, assQuestionGUI\addBasicQuestionFormProperties(), assQuestionGUI\addQuestionFormCommandButtons(), assQuestionGUI\getQuestionTemplate(), assQuestionGUI\isSaveCommand(), assQuestionGUI\outQuestionType(), populateAnswerSpecificFormPart(), populateQuestionSpecificFormPart(), and assQuestionGUI\populateTaxonomyFormSection().

Referenced by addSuggestedSolution(), and writePostData().

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

◆ getAfterParticipationSuppressionAnswerPostVars()

assTextQuestionGUI::getAfterParticipationSuppressionAnswerPostVars ( )

Returns a list of postvars which will be suppressed in the form output when used in scoring adjustment.

The form elements will be shown disabled, so the users see the usual form but can only edit the settings, which make sense in the given context.

E.g. array('cloze_type', 'image_filename')

Returns
string[]

Implements ilGuiAnswerScoringAdjustable.

Definition at line 714 of file class.assTextQuestionGUI.php.

715 {
716 return array();
717 }

◆ getAfterParticipationSuppressionQuestionPostVars()

assTextQuestionGUI::getAfterParticipationSuppressionQuestionPostVars ( )

Returns a list of postvars which will be suppressed in the form output when used in scoring adjustment.

The form elements will be shown disabled, so the users see the usual form but can only edit the settings, which make sense in the given context.

E.g. array('cloze_type', 'image_filename')

Returns
string[]

Implements ilGuiQuestionScoringAdjustable.

Definition at line 728 of file class.assTextQuestionGUI.php.

729 {
730 return array();
731 }

◆ getAggregatedAnswersView()

assTextQuestionGUI::getAggregatedAnswersView (   $relevant_answers)

Returns an html string containing a question specific representation of the answers so far given in the test for use in the right column in the scoring adjustment user interface.

Parameters
array$relevant_answers
Returns
string

Implements ilGuiQuestionScoringAdjustable.

Definition at line 741 of file class.assTextQuestionGUI.php.

742 {
743 return ''; //print_r($relevant_answers,true);
744 }

◆ getBestAnswer()

assTextQuestionGUI::getBestAnswer (   $asHtml)
private

Definition at line 256 of file class.assTextQuestionGUI.php.

257 {
258 $answers = $this->object->getAnswers();
259 if (!count($answers)) {
260 return '';
261 }
262
263 if ($asHtml) {
264 $tplFile = 'tpl.il_as_qpl_text_question_best_solution_html.html';
265 } else {
266 $tplFile = 'tpl.il_as_qpl_text_question_best_solution_ta.html';
267 }
268
269 $tpl = new ilTemplate($tplFile, true, true, 'Modules/TestQuestionPool');
270
271 foreach ($answers as $answer) {
272 $keywordString = $answer->getAnswertext();
273
274 if (in_array($this->object->getKeywordRelation(), assTextQuestion::getScoringModesWithPointsByKeyword())) {
275 $keywordString .= ' ' . $this->lng->txt('for') . ' ';
276 $keywordString .= $answer->getPoints() . ' ' . $this->lng->txt('points');
277 }
278
279 $tpl->setCurrentBlock('keyword');
280 $tpl->setVariable('KEYWORD', $keywordString);
281 $tpl->parseCurrentBlock();
282 }
283
284 $tpl->setVariable('KEYWORD_HEADER', $this->lng->txt('solution_contain_keywords'));
285 $tpl->setVariable('SCORING_LABEL', $this->lng->txt('essay_scoring_mode') . ': ');
286
287 switch ($this->object->getKeywordRelation()) {
288 case 'any':
289 $tpl->setVariable('SCORING_MODE', $this->lng->txt('essay_scoring_mode_keyword_relation_any'));
290 break;
291 case 'all':
292 $tpl->setVariable('SCORING_MODE', $this->lng->txt('essay_scoring_mode_keyword_relation_all'));
293 break;
294 case 'one':
295 $tpl->setVariable('SCORING_MODE', $this->lng->txt('essay_scoring_mode_keyword_relation_one'));
296 break;
297 }
298
299 return $tpl->get();
300 }
static getScoringModesWithPointsByKeyword()
special template class to simplify handling of ITX/PEAR

References assQuestionGUI\$tpl, and assTextQuestion\getScoringModesWithPointsByKeyword().

Referenced by getSolutionOutput().

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

◆ getJsCode()

assTextQuestionGUI::getJsCode ( )
protected

Definition at line 403 of file class.assTextQuestionGUI.php.

404 {
405 $tpl = new ilTemplate('tpl.charcounter.html', true, true, 'Modules/TestQuestionPool');
406
407 $tpl->setCurrentBlock('tinymce_handler');
408 $tpl->touchBlock('tinymce_handler');
409 $tpl->parseCurrentBlock();
410
411 if ($this->object->getMaxNumOfChars() > 0) {
412 $tpl->setCurrentBlock('letter_counter_js');
413 $tpl->setVariable("QID", $this->object->getId());
414 $tpl->setVariable("MAXCHARS", $this->object->getMaxNumOfChars());
415 $tpl->parseCurrentBlock();
416 }
417
418 return $tpl->get();
419 }

References assQuestionGUI\$tpl.

Referenced by getPreview(), and getTestOutput().

+ Here is the caller graph for this function:

◆ getPreview()

assTextQuestionGUI::getPreview (   $show_question_only = false,
  $showInlineFeedback = false 
)

Reimplemented from assQuestionGUI.

Definition at line 312 of file class.assTextQuestionGUI.php.

313 {
314 // generate the question output
315 include_once "./Services/UICore/classes/class.ilTemplate.php";
316 $template = new ilTemplate("tpl.il_as_qpl_text_question_output.html", true, true, "Modules/TestQuestionPool");
317 if ($this->object->getMaxNumOfChars()) {
318 $template->setCurrentBlock("maximum_char_hint");
319 $template->setVariable("MAXIMUM_CHAR_HINT", sprintf($this->lng->txt("text_maximum_chars_allowed"), $this->object->getMaxNumOfChars()));
320 $template->parseCurrentBlock();
321 #mbecker: No such block. $template->setCurrentBlock("has_maxchars");
322 $template->setVariable("MAXCHARS", $this->object->getMaxNumOfChars());
323 $template->parseCurrentBlock();
324 $template->setCurrentBlock("maxchars_counter");
325 $template->setVariable("QID", $this->object->getId());
326 $template->setVariable("MAXCHARS", $this->object->getMaxNumOfChars());
327 $template->setVariable("TEXTBOXSIZE", strlen($this->object->getMaxNumOfChars()));
328 $template->setVariable("CHARACTERS", $this->lng->txt("characters"));
329 $template->parseCurrentBlock();
330 }
331
332 if (is_object($this->getPreviewSession())) {
333 $template->setVariable("ESSAY", ilUtil::prepareFormOutput(
334 $this->getPreviewSession()->getParticipantsSolution()
335 ));
336 }
337
338 $questiontext = $this->object->getQuestion();
339 $template->setVariable("QUESTIONTEXT", $this->object->prepareTextareaOutput($questiontext, true));
340 $template->setVariable("QID", $this->object->getId());
341
342 $questionoutput = $template->get();
343
344 $questionoutput .= $this->getJsCode();
345
346 if (!$show_question_only) {
347 // get page object output
348 $questionoutput = $this->getILIASPage($questionoutput);
349 }
350 return $questionoutput;
351 }
sprintf('%.4f', $callTime)
getILIASPage($html="")
Returns the ILIAS Page around a question.
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms @access public
$template

References $template, assQuestionGUI\getILIASPage(), getJsCode(), assQuestionGUI\getPreviewSession(), ilUtil\prepareFormOutput(), and sprintf.

+ Here is the call graph for this function:

◆ getSolutionOutput()

assTextQuestionGUI::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 
)

Get the question solution output.

Parameters
integer$active_idThe active user id
integer$passThe test pass
boolean$graphicalOutputShow visual feedback for right/wrong answers
boolean$result_outputShow the reached points for parts of the question
boolean$show_question_onlyShow the question without the ILIAS content around
boolean$show_feedbackShow the question feedback
boolean$show_correct_solutionShow the correct solution instead of the user solution
boolean$show_manual_scoringShow specific information for the manual scoring output
Returns
The solution output of the question as HTML code

Reimplemented from assQuestionGUI.

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

160 {
161 // get the solution of the user for the active pass or from the last pass if allowed
162
163 $user_solution = $this->getUserAnswer($active_id, $pass);
164
165 if (($active_id > 0) && (!$show_correct_solution)) {
166 $solution = $user_solution;
167 } else {
168 $solution = $this->getBestAnswer($this->renderPurposeSupportsFormHtml());
169 }
170
171 // generate the question output
172 include_once "./Services/UICore/classes/class.ilTemplate.php";
173 $template = new ilTemplate("tpl.il_as_qpl_text_question_output_solution.html", true, true, "Modules/TestQuestionPool");
174 $solutiontemplate = new ilTemplate("tpl.il_as_tst_solution_output.html", true, true, "Modules/TestQuestionPool");
175
176 $solution = $this->object->getHtmlUserSolutionPurifier()->purify($solution);
177 if ($this->renderPurposeSupportsFormHtml()) {
178 $template->setCurrentBlock('essay_div');
179 $template->setVariable("DIV_ESSAY", $this->object->prepareTextareaOutput($solution, true));
180 } else {
181 $template->setCurrentBlock('essay_textarea');
182 $template->setVariable("TA_ESSAY", $this->object->prepareTextareaOutput($solution, true, true));
183 }
184 $template->parseCurrentBlock();
185
186 $questiontext = $this->object->getQuestion();
187
188 if (!$show_correct_solution) {
189 $max_no_of_chars = $this->object->getMaxNumOfChars();
190
191 if ($max_no_of_chars == 0) {
192 $max_no_of_chars = ucfirst($this->lng->txt('unlimited'));
193 }
194
195 $act_no_of_chars = $this->object->countLetters($user_solution);
196 $template->setVariable("CHARACTER_INFO", '<b>' . $max_no_of_chars . '</b>' .
197 $this->lng->txt('answer_characters') . ' <b>' . $act_no_of_chars . '</b>');
198 }
199 if (($active_id > 0) && (!$show_correct_solution)) {
200 if ($graphicalOutput) {
201 // output of ok/not ok icons for user entered solutions
202 $reached_points = $this->object->getReachedPoints($active_id, $pass);
203 if ($reached_points == $this->object->getMaximumPoints()) {
204 $template->setCurrentBlock("icon_ok");
205 $template->setVariable("ICON_OK", ilUtil::getImagePath("icon_ok.svg"));
206 $template->setVariable("TEXT_OK", $this->lng->txt("answer_is_right"));
207 $template->parseCurrentBlock();
208 } else {
209 $template->setCurrentBlock("icon_ok");
210 if ($reached_points > 0) {
211 $template->setVariable("ICON_NOT_OK", ilUtil::getImagePath("icon_mostly_ok.svg"));
212 $template->setVariable("TEXT_NOT_OK", $this->lng->txt("answer_is_not_correct_but_positive"));
213 } else {
214 $template->setVariable("ICON_NOT_OK", ilUtil::getImagePath("icon_not_ok.svg"));
215 $template->setVariable("TEXT_NOT_OK", $this->lng->txt("answer_is_wrong"));
216 }
217 $template->parseCurrentBlock();
218 }
219 }
220 }
221 if ($show_question_text==true) {
222 $template->setVariable("QUESTIONTEXT", $this->object->prepareTextareaOutput($questiontext, true));
223 }
224 $questionoutput = $template->get();
225
226 $feedback = '';
227 if ($show_feedback) {
228 if (!$this->isTestPresentationContext()) {
229 $fb = $this->getGenericFeedbackOutput($active_id, $pass);
230 $feedback .= strlen($fb) ? $fb : '';
231 }
232
233 $fb = $this->getSpecificFeedbackOutput($active_id, $pass);
234 $feedback .= strlen($fb) ? $fb : '';
235 }
236 if (strlen($feedback)) {
237 $cssClass = (
238 $this->hasCorrectSolution($active_id, $pass) ?
240 );
241
242 $solutiontemplate->setVariable("ILC_FB_CSS_CLASS", $cssClass);
243 $solutiontemplate->setVariable("FEEDBACK", $this->object->prepareTextareaOutput($feedback, true));
244 }
245
246 $solutiontemplate->setVariable("SOLUTION_OUTPUT", $questionoutput);
247
248 $solutionoutput = $solutiontemplate->get();
249 if (!$show_question_only) {
250 // get page object output
251 $solutionoutput = $this->getILIASPage($solutionoutput);
252 }
253 return $solutionoutput;
254 }
hasCorrectSolution($activeId, $passIndex)
getGenericFeedbackOutput($active_id, $pass)
Returns the answer specific feedback for the question.
getSpecificFeedbackOutput($active_id, $pass)
Returns the answer specific feedback for the question.
getUserAnswer($active_id, $pass)
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)

References $pass, $template, ilAssQuestionFeedback\CSS_CLASS_FEEDBACK_CORRECT, ilAssQuestionFeedback\CSS_CLASS_FEEDBACK_WRONG, getBestAnswer(), assQuestionGUI\getGenericFeedbackOutput(), assQuestionGUI\getILIASPage(), ilUtil\getImagePath(), getSpecificFeedbackOutput(), getUserAnswer(), assQuestionGUI\hasCorrectSolution(), assQuestionGUI\isTestPresentationContext(), and assQuestionGUI\renderPurposeSupportsFormHtml().

+ Here is the call graph for this function:

◆ getSpecificFeedbackOutput()

assTextQuestionGUI::getSpecificFeedbackOutput (   $active_id,
  $pass 
)

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 from assQuestionGUI.

Definition at line 522 of file class.assTextQuestionGUI.php.

523 {
524 $feedback = '<table><tbody>';
525 $user_answers = $this->object->getSolutionValues($active_id);
526 $user_answer = ' ' . $user_answers[0]['value1'];
527
528 foreach ($this->object->getAnswers() as $idx => $ans) {
529 if ($this->object->isKeywordMatching($user_answer, $ans->getAnswertext())) {
530 $fb = $this->object->feedbackOBJ->getSpecificAnswerFeedbackTestPresentation(
531 $this->object->getId(),
532 $idx
533 );
534 $feedback .= '<tr><td><b><i>' . $ans->getAnswertext() . '</i></b></td><td>';
535 $feedback .= $fb . '</td> </tr>';
536 }
537 }
538
539 $feedback .= '</tbody></table>';
540 return $this->object->prepareTextareaOutput($feedback, true);
541 }

Referenced by getSolutionOutput().

+ Here is the caller graph for this function:

◆ getTestOutput()

assTextQuestionGUI::getTestOutput (   $active_id,
  $pass = null,
  $is_postponed = false,
  $use_post_solutions = false,
  $inlineFeedback = false 
)

Reimplemented from assQuestionGUI.

Definition at line 353 of file class.assTextQuestionGUI.php.

354 {
355 // get the solution of the user for the active pass or from the last pass if allowed
356 $user_solution = "";
357 if ($active_id) {
358 $solutions = null;
359 // hey: prevPassSolutions - obsolete due to central check
360 #include_once "./Modules/Test/classes/class.ilObjTest.php";
361 #if (!ilObjTest::_getUsePreviousAnswers($active_id, true))
362 #{
363 # if (is_null($pass)) $pass = ilObjTest::_getPass($active_id);
364 #}
365 // hey.
366 $solutions = $this->object->getUserSolutionPreferingIntermediate($active_id, $pass);
367 foreach ($solutions as $idx => $solution_value) {
368 $user_solution = $solution_value["value1"];
369 }
370 }
371
372 // generate the question output
373 include_once "./Services/UICore/classes/class.ilTemplate.php";
374 $template = new ilTemplate("tpl.il_as_qpl_text_question_output.html", true, true, "Modules/TestQuestionPool");
375 if ($this->object->getMaxNumOfChars()) {
376 $template->setCurrentBlock("maximum_char_hint");
377 $template->setVariable("MAXIMUM_CHAR_HINT", sprintf($this->lng->txt("text_maximum_chars_allowed"), $this->object->getMaxNumOfChars()));
378 $template->parseCurrentBlock();
379 #mbecker: No such block. $template->setCurrentBlock("has_maxchars");
380 $template->setVariable("MAXCHARS", $this->object->getMaxNumOfChars());
381 $template->parseCurrentBlock();
382 $template->setCurrentBlock("maxchars_counter");
383 $template->setVariable("MAXCHARS", $this->object->getMaxNumOfChars());
384 $template->setVariable("QID", $this->object->getId());
385 $template->setVariable("TEXTBOXSIZE", strlen($this->object->getMaxNumOfChars()));
386 $template->setVariable("CHARACTERS", $this->lng->txt("characters"));
387 $template->parseCurrentBlock();
388 }
389 $template->setVariable("QID", $this->object->getId());
390 $template->setVariable("ESSAY", ilUtil::prepareFormOutput($user_solution));
391 $questiontext = $this->object->getQuestion();
392 $template->setVariable("QUESTIONTEXT", $this->object->prepareTextareaOutput($questiontext, true));
393 $questionoutput = $template->get();
394
395 $questionoutput .= $this->getJsCode();
396
397 $pageoutput = $this->outQuestionPage("", $is_postponed, $active_id, $questionoutput);
398 include_once "./Services/YUI/classes/class.ilYuiUtil.php";
400 return $pageoutput;
401 }
outQuestionPage($a_temp_var, $a_postponed=false, $active_id="", $html="")
output question page
static initDomEvent()
Init YUI DomEvent.

References $pass, $template, getJsCode(), ilYuiUtil\initDomEvent(), assQuestionGUI\outQuestionPage(), ilUtil\prepareFormOutput(), and sprintf.

+ Here is the call graph for this function:

◆ getUserAnswer()

assTextQuestionGUI::getUserAnswer (   $active_id,
  $pass 
)
private

Definition at line 302 of file class.assTextQuestionGUI.php.

303 {
304 $user_solution = "";
305 $solutions = $this->object->getSolutionValues($active_id, $pass);
306 foreach ($solutions as $idx => $solution_value) {
307 $user_solution = $solution_value["value1"];
308 }
309 return $user_solution;
310 }

References $pass.

Referenced by getSolutionOutput().

+ Here is the caller graph for this function:

◆ magicAfterTestOutput()

assTextQuestionGUI::magicAfterTestOutput ( )

Reimplemented from assQuestionGUI.

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

121 {
122 // TODO - BEGIN: what exactly is done here? cant we use the parent method?
123
124 include_once "./Services/RTE/classes/class.ilRTE.php";
125 $rtestring = ilRTE::_getRTEClassname();
126 include_once "./Services/RTE/classes/class.$rtestring.php";
127 $rte = new $rtestring();
128 include_once "./Services/Object/classes/class.ilObject.php";
129 $obj_id = ilObject::_lookupObjectId($_GET["ref_id"]);
130 $obj_type = ilObject::_lookupType($_GET["ref_id"], true);
131 $rte->addUserTextEditor("textinput");
132 $this->outAdditionalOutput();
133
134 // TODO - END: what exactly is done here? cant we use the parent method?
135 }
$_GET["client_id"]
static _lookupObjectId($a_ref_id)
lookup object id
static _lookupType($a_id, $a_reference=false)
lookup object type
static _getRTEClassname()

References $_GET, ilRTE\_getRTEClassname(), ilObject\_lookupObjectId(), ilObject\_lookupType(), and outAdditionalOutput().

+ Here is the call graph for this function:

◆ outAdditionalOutput()

assTextQuestionGUI::outAdditionalOutput ( )

Reimplemented from assQuestionGUI.

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

117 {
118 }

Referenced by magicAfterTestOutput().

+ Here is the caller graph for this function:

◆ populateAnswerSpecificFormPart()

assTextQuestionGUI::populateAnswerSpecificFormPart ( \ilPropertyFormGUI  $form)

Definition at line 601 of file class.assTextQuestionGUI.php.

602 {
603 $scoringMode = new ilRadioGroupInputGUI(
604 $this->lng->txt('essay_scoring_mode'),
605 'scoring_mode'
606 );
607
608 $scoringOptionNone = new ilRadioOption(
609 $this->lng->txt('essay_scoring_mode_without_keywords'),
610 'non',
611 $this->lng->txt(
612 'essay_scoring_mode_without_keywords_desc'
613 )
614 );
615 $scoringOptionAnyKeyword = new ilRadioOption(
616 $this->lng->txt('essay_scoring_mode_keyword_relation_any'),
617 'any',
618 $this->lng->txt(
619 'essay_scoring_mode_keyword_relation_any_desc'
620 )
621 );
622 $scoringOptionAllKeyword = new ilRadioOption(
623 $this->lng->txt('essay_scoring_mode_keyword_relation_all'),
624 'all',
625 $this->lng->txt(
626 'essay_scoring_mode_keyword_relation_all_desc'
627 )
628 );
629 $scoringOptionOneKeyword = new ilRadioOption(
630 $this->lng->txt('essay_scoring_mode_keyword_relation_one'),
631 'one',
632 $this->lng->txt(
633 'essay_scoring_mode_keyword_relation_one_desc'
634 )
635 );
636
637 $scoringMode->addOption($scoringOptionNone);
638 $scoringMode->addOption($scoringOptionAnyKeyword);
639 $scoringMode->addOption($scoringOptionAllKeyword);
640 $scoringMode->addOption($scoringOptionOneKeyword);
641 $scoringMode->setRequired(true);
642 $scoringMode->setValue(
643 strlen($this->object->getKeywordRelation()) ? $this->object->getKeywordRelation(
644 ) : 'non'
645 );
646
647 if ($this->object->getAnswerCount() == 0) {
648 $this->object->addAnswer("", 1, 0, 0);
649 }
650 require_once "./Modules/TestQuestionPool/classes/class.ilEssayKeywordWizardInputGUI.php";
651
652 // Without Keywords
653 $nonKeywordPoints = new ilNumberInputGUI($this->lng->txt("points"), "non_keyword_points");
654 $nonKeywordPoints->allowDecimals(true);
655 $nonKeywordPoints->setValue($this->object->getPoints());
656 $nonKeywordPoints->setRequired(true);
657 $nonKeywordPoints->setSize(3);
658 $nonKeywordPoints->setMinValue(0.0);
659 $nonKeywordPoints->setMinvalueShouldBeGreater(true);
660 $scoringOptionNone->addSubItem($nonKeywordPoints);
661
662 // Any Keyword
663 $anyKeyword = new ilEssayKeywordWizardInputGUI($this->lng->txt("answers"), "any_keyword");
664 $anyKeyword->setRequired(true);
665 $anyKeyword->setQuestionObject($this->object);
666 $anyKeyword->setSingleline(true);
667 $anyKeyword->setValues($this->object->getAnswers());
668 $scoringOptionAnyKeyword->addSubItem($anyKeyword);
669
670 // All Keywords
671 $allKeyword = new ilTextWizardInputGUI($this->lng->txt("answers"), "all_keyword");
672 $allKeyword->setRequired(true);
673 //$allKeyword->setQuestionObject($this->object);
674 //$allKeyword->setSingleline(TRUE);
675 $allKeyword->setValues(self::buildAnswerTextOnlyArray($this->object->getAnswers()));
676 $scoringOptionAllKeyword->addSubItem($allKeyword);
677 $allKeywordPoints = new ilNumberInputGUI($this->lng->txt("points"), "all_keyword_points");
678 $allKeywordPoints->allowDecimals(true);
679 $allKeywordPoints->setValue($this->object->getPoints());
680 $allKeywordPoints->setRequired(true);
681 $allKeywordPoints->setSize(3);
682 $allKeywordPoints->setMinValue(0.0);
683 $allKeywordPoints->setMinvalueShouldBeGreater(true);
684 $scoringOptionAllKeyword->addSubItem($allKeywordPoints);
685
686 // One Keywords
687 $oneKeyword = new ilTextWizardInputGUI($this->lng->txt("answers"), "one_keyword");
688 $oneKeyword->setRequired(true);
689 //$oneKeyword->setQuestionObject($this->object);
690 //$oneKeyword->setSingleline(TRUE);
691 $oneKeyword->setValues(self::buildAnswerTextOnlyArray($this->object->getAnswers()));
692 $scoringOptionOneKeyword->addSubItem($oneKeyword);
693 $oneKeywordPoints = new ilNumberInputGUI($this->lng->txt("points"), "one_keyword_points");
694 $oneKeywordPoints->allowDecimals(true);
695 $oneKeywordPoints->setValue($this->object->getPoints());
696 $oneKeywordPoints->setRequired(true);
697 $oneKeywordPoints->setSize(3);
698 $oneKeywordPoints->setMinValue(0.0);
699 $oneKeywordPoints->setMinvalueShouldBeGreater(true);
700 $scoringOptionOneKeyword->addSubItem($oneKeywordPoints);
701
702 $form->addItem($scoringMode);
703 }
This class represents a number 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 text wizard property in a property form.

References $form.

Referenced by editQuestion().

+ Here is the caller graph for this function:

◆ populateQuestionSpecificFormPart()

assTextQuestionGUI::populateQuestionSpecificFormPart ( \ilPropertyFormGUI  $form)

Definition at line 572 of file class.assTextQuestionGUI.php.

573 {
574 // maxchars
575 $maxchars = new ilNumberInputGUI($this->lng->txt("maxchars"), "maxchars");
576 $maxchars->setSize(5);
577 if ($this->object->getMaxNumOfChars() > 0) {
578 $maxchars->setValue($this->object->getMaxNumOfChars());
579 }
580 $maxchars->setInfo($this->lng->txt("description_maxchars"));
581 $form->addItem($maxchars);
582
583 // text rating
584 $textrating = new ilSelectInputGUI($this->lng->txt("text_rating"), "text_rating");
585 $text_options = array(
586 "ci" => $this->lng->txt("cloze_textgap_case_insensitive"),
587 "cs" => $this->lng->txt("cloze_textgap_case_sensitive"),
588 "l1" => sprintf($this->lng->txt("cloze_textgap_levenshtein_of"), "1"),
589 "l2" => sprintf($this->lng->txt("cloze_textgap_levenshtein_of"), "2"),
590 "l3" => sprintf($this->lng->txt("cloze_textgap_levenshtein_of"), "3"),
591 "l4" => sprintf($this->lng->txt("cloze_textgap_levenshtein_of"), "4"),
592 "l5" => sprintf($this->lng->txt("cloze_textgap_levenshtein_of"), "5")
593 );
594 $textrating->setOptions($text_options);
595 $textrating->setValue($this->object->getTextRating());
596 $form->addItem($textrating);
597
598 return $form;
599 }
This class represents a selection list property in a property form.

References $form, and sprintf.

Referenced by editQuestion().

+ Here is the caller graph for this function:

◆ setQuestionTabs()

assTextQuestionGUI::setQuestionTabs ( )

Sets the ILIAS tabs for this question type.

@access public

Todo:
: MOVE THIS STEPS TO COMMON QUESTION CLASS assQuestionGUI

Reimplemented from assQuestionGUI.

Definition at line 450 of file class.assTextQuestionGUI.php.

451 {
452 global $rbacsystem, $ilTabs;
453
454 $ilTabs->clearTargets();
455
456 $this->ctrl->setParameterByClass("ilAssQuestionPageGUI", "q_id", $_GET["q_id"]);
457 include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
458 $q_type = $this->object->getQuestionType();
459
460 if (strlen($q_type)) {
461 $classname = $q_type . "GUI";
462 $this->ctrl->setParameterByClass(strtolower($classname), "sel_question_types", $q_type);
463 $this->ctrl->setParameterByClass(strtolower($classname), "q_id", $_GET["q_id"]);
464 }
465
466 if ($_GET["q_id"]) {
467 if ($rbacsystem->checkAccess('write', $_GET["ref_id"])) {
468 // edit page
469 $ilTabs->addTarget(
470 "edit_page",
471 $this->ctrl->getLinkTargetByClass("ilAssQuestionPageGUI", "edit"),
472 array("edit", "insert", "exec_pg"),
473 "",
474 "",
475 $force_active
476 );
477 }
478
479 $this->addTab_QuestionPreview($ilTabs);
480 }
481
482 $force_active = false;
483 if ($rbacsystem->checkAccess('write', $_GET["ref_id"])) {
484 $url = "";
485 if ($classname) {
486 $url = $this->ctrl->getLinkTargetByClass($classname, "editQuestion");
487 }
488 // edit question properties
489 $ilTabs->addTarget(
490 "edit_question",
491 $url,
492 array("editQuestion", "save", "saveEdit", "originalSyncForm"),
493 $classname,
494 "",
495 $force_active
496 );
497 }
498
499 // add tab for question feedback within common class assQuestionGUI
500 $this->addTab_QuestionFeedback($ilTabs);
501
502 // add tab for question hint within common class assQuestionGUI
503 $this->addTab_QuestionHints($ilTabs);
504
505 // add tab for question's suggested solution within common class assQuestionGUI
506 $this->addTab_SuggestedSolution($ilTabs, $classname);
507
508 // Assessment of questions sub menu entry
509 if ($_GET["q_id"]) {
510 $ilTabs->addTarget(
511 "statistics",
512 $this->ctrl->getLinkTargetByClass($classname, "assessment"),
513 array("assessment"),
514 $classname,
515 ""
516 );
517 }
518
519 $this->addBackTab($ilTabs);
520 }
addTab_QuestionHints(ilTabsGUI $tabs)
adds the hints tab to ilTabsGUI
addTab_SuggestedSolution(ilTabsGUI $tabs, $classname)
addBackTab(ilTabsGUI $ilTabs)
addTab_QuestionFeedback(ilTabsGUI $tabs)
adds the feedback tab to ilTabsGUI
addTab_QuestionPreview(ilTabsGUI $tabsGUI)
$url

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

+ Here is the call graph for this function:

◆ writeAnswerSpecificPostData()

assTextQuestionGUI::writeAnswerSpecificPostData ( ilPropertyFormGUI  $form)

Extracts the answer specific values from $_POST and applies them to the data object.

Parameters
bool$alwaysIf true, a check for form validity is omitted.
Returns
void

Implements ilGuiAnswerScoringAdjustable.

Definition at line 550 of file class.assTextQuestionGUI.php.

551 {
552 switch ($this->object->getKeywordRelation()) {
553 case 'non':
554 $this->object->setAnswers(array());
555 $this->object->setPoints($_POST['non_keyword_points']);
556 break;
557 case 'any':
558 $this->object->setAnswers($_POST['any_keyword']);
559 $this->object->setPoints($this->object->getMaximumPoints());
560 break;
561 case 'all':
562 $this->object->setAnswers($_POST['all_keyword']);
563 $this->object->setPoints($_POST['all_keyword_points']);
564 break;
565 case 'one':
566 $this->object->setAnswers($_POST['one_keyword']);
567 $this->object->setPoints($_POST['one_keyword_points']);
568 break;
569 }
570 }

References $_POST.

Referenced by writePostData().

+ Here is the caller graph for this function:

◆ writePostData()

assTextQuestionGUI::writePostData (   $always = false)
protected

{Evaluates a posted edit form and writes the form data in the question object.

Returns
integer A positive value, if one of the required fields wasn't set, else 0
}

Reimplemented from assQuestionGUI.

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

46 {
47 $hasErrors = (!$always) ? $this->editQuestion(true) : false;
48 if (!$hasErrors) {
49 require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
54 return 0;
55 }
56 return 1;
57 }
writeQuestionSpecificPostData(ilPropertyFormGUI $form)
Extracts the question specific values from $_POST and applies them to the data object.
writeAnswerSpecificPostData(ilPropertyFormGUI $form)
Extracts the answer specific values from $_POST and applies them to the data object.

References editQuestion(), assQuestionGUI\saveTaxonomyAssignments(), writeAnswerSpecificPostData(), assQuestionGUI\writeQuestionGenericPostData(), and writeQuestionSpecificPostData().

Referenced by addSuggestedSolution().

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

◆ writeQuestionSpecificPostData()

assTextQuestionGUI::writeQuestionSpecificPostData ( ilPropertyFormGUI  $form)

Extracts the question specific values from $_POST and applies them to the data object.

Parameters
bool$alwaysIf true, a check for form validity is omitted.
Returns
void

Implements ilGuiQuestionScoringAdjustable.

Definition at line 543 of file class.assTextQuestionGUI.php.

544 {
545 $this->object->setMaxNumOfChars($_POST["maxchars"]);
546 $this->object->setTextRating($_POST["text_rating"]);
547 $this->object->setKeywordRelation($_POST['scoring_mode']);
548 }

References $_POST.

Referenced by writePostData().

+ Here is the caller graph for this function:

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