ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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...
 
 writePostData ($always=false)
 Evaluates a posted edit form and writes the form data in the question object. 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)
 
 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)
 
 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 ()
 
- Public Member Functions inherited from ilGuiQuestionScoringAdjustable
 populateQuestionSpecificFormPart (ilPropertyFormGUI $form)
 Adds the question specific forms parts to a question property form gui. More...
 
- Public Member Functions inherited from ilGuiAnswerScoringAdjustable
 populateAnswerSpecificFormPart (ilPropertyFormGUI $form)
 Adds the answer specific form parts to a question property form gui. More...
 

Protected Member Functions

 getJsCode ()
 
- Protected Member Functions inherited from assQuestionGUI
 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 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 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 OUTPUT_MODE_SCREEN = 'outModeScreen'
 
const OUTPUT_MODE_PDF = 'outModePdf'
 
const OUTPUT_MODE_CONTENT_EDITING = 'outModeUsrSol'
 

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$

Definition at line 22 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 31 of file class.assTextQuestionGUI.php.

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

Member Function Documentation

◆ addSuggestedSolution()

assTextQuestionGUI::addSuggestedSolution ( )

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

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

459  {
460  $_SESSION["subquestion_index"] = 0;
461  if ($_POST["cmd"]["addSuggestedSolution"])
462  {
463  if ($this->writePostData())
464  {
466  $this->editQuestion();
467  return;
468  }
469  if (!$this->checkInput())
470  {
471  ilUtil::sendInfo($this->lng->txt("fill_out_all_required_fields_add_answer"));
472  $this->editQuestion();
473  return;
474  }
475  }
476  $this->object->saveToDb();
477  $this->ctrl->setParameter($this, "q_id", $this->object->getId());
478  $this->tpl->setVariable("HEADER", $this->object->getTitle());
479  $this->getQuestionTemplate();
480  parent::addSuggestedSolution();
481  }
writePostData()
Evaluates a posted edit form and writes the form data in the question object.
$_POST['username']
Definition: cron.php:12
$_SESSION["AccountId"]
editQuestion($checkonly=FALSE)
Creates an output of the edit form for the question.
getQuestionTemplate()
get question template
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ 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  {
111  $answerTexts[] = $answer->getAnswertext();
112  }
113 
114  return $answerTexts;
115  }

◆ editQuestion()

assTextQuestionGUI::editQuestion (   $checkonly = FALSE)

Creates an output of the edit form for the question.

public

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

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

Referenced by addSuggestedSolution(), and writePostData().

70  {
71  $save = $this->isSaveCommand();
72  $this->getQuestionTemplate();
73 
74  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
75  $form = new ilPropertyFormGUI();
76  $form->setFormAction($this->ctrl->getFormAction($this));
77  $form->setTitle($this->outQuestionType());
78  $form->setMultipart(TRUE);
79  $form->setTableWidth("100%");
80  $form->setId("asstextquestion");
81 
82  $this->addBasicQuestionFormProperties( $form );
83  $this->populateQuestionSpecificFormPart( $form );
84  $this->populateAnswerSpecificFormPart( $form );
85 
86 
87  $this->populateTaxonomyFormSection($form);
88 
89  $this->addQuestionFormCommandButtons($form);
90 
91  $errors = false;
92 
93  if ($save)
94  {
95  $form->setValuesByPost();
96  $errors = !$form->checkInput();
97  $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
98  if ($errors) $checkonly = false;
99  }
100 
101  if (!$checkonly) $this->tpl->setVariable("QUESTION_DATA", $form->getHTML());
102  return $errors;
103  }
addBasicQuestionFormProperties($form)
Add basic question form properties: assessment: title, author, description, question, working time.
This class represents a property form user interface.
getQuestionTemplate()
get question template
populateTaxonomyFormSection(ilPropertyFormGUI $form)
$errors
populateQuestionSpecificFormPart(\ilPropertyFormGUI $form)
populateAnswerSpecificFormPart(\ilPropertyFormGUI $form)
addQuestionFormCommandButtons($form)
Add the command buttons of a question properties form.
+ 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 734 of file class.assTextQuestionGUI.php.

735  {
736  return array();
737  }

◆ 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 748 of file class.assTextQuestionGUI.php.

749  {
750  return array();
751  }

◆ 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 761 of file class.assTextQuestionGUI.php.

762  {
763  return ''; //print_r($relevant_answers,true);
764  }

◆ getBestAnswer()

assTextQuestionGUI::getBestAnswer (   $asHtml)
private

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

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

Referenced by getSolutionOutput().

279  {
280  $answers = $this->object->getAnswers();
281  if( !count($answers) )
282  {
283  return '';
284  }
285 
286  if($asHtml)
287  {
288  $tplFile = 'tpl.il_as_qpl_text_question_best_solution_html.html';
289  }
290  else
291  {
292  $tplFile = 'tpl.il_as_qpl_text_question_best_solution_ta.html';
293  }
294 
295  $tpl = new ilTemplate($tplFile, true, true, 'Modules/TestQuestionPool');
296 
297  foreach ($answers as $answer)
298  {
299  $keywordString = $answer->getAnswertext();
300 
301  if( in_array($this->object->getKeywordRelation(), assTextQuestion::getScoringModesWithPointsByKeyword()) )
302  {
303  $keywordString .= ' ' . $this->lng->txt('for') . ' ';
304  $keywordString .= $answer->getPoints() . ' ' . $this->lng->txt('points');
305  }
306 
307  $tpl->setCurrentBlock('keyword');
308  $tpl->setVariable('KEYWORD', $keywordString);
309  $tpl->parseCurrentBlock();
310  }
311 
312  $tpl->setVariable('KEYWORD_HEADER', $this->lng->txt('solution_contain_keywords'));
313  $tpl->setVariable('SCORING_LABEL', $this->lng->txt('essay_scoring_mode').': ');
314 
315  switch( $this->object->getKeywordRelation() )
316  {
317  case 'any':
318  $tpl->setVariable('SCORING_MODE', $this->lng->txt('essay_scoring_mode_keyword_relation_any'));
319  break;
320  case 'all':
321  $tpl->setVariable('SCORING_MODE', $this->lng->txt('essay_scoring_mode_keyword_relation_all'));
322  break;
323  case 'one':
324  $tpl->setVariable('SCORING_MODE', $this->lng->txt('essay_scoring_mode_keyword_relation_one'));
325  break;
326  }
327 
328  return $tpl->get();
329  }
static getScoringModesWithPointsByKeyword()
special template class to simplify handling of ITX/PEAR
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getJsCode()

assTextQuestionGUI::getJsCode ( )
protected

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

References assQuestionGUI\$tpl.

Referenced by getPreview(), and getTestOutput().

440  {
441  $tpl = new ilTemplate('tpl.charcounter.html', true, true, 'Modules/TestQuestionPool');
442 
443  $tpl->setCurrentBlock('tinymce_handler');
444  $tpl->touchBlock('tinymce_handler');
445  $tpl->parseCurrentBlock();
446 
447  if ($this->object->getMaxNumOfChars() > 0)
448  {
449  $tpl->setCurrentBlock('letter_counter_js');
450  $tpl->setVariable("QID", $this->object->getId());
451  $tpl->setVariable("MAXCHARS", $this->object->getMaxNumOfChars());
452  $tpl->parseCurrentBlock();
453  }
454 
455  return $tpl->get();
456  }
special template class to simplify handling of ITX/PEAR
+ Here is the caller graph for this function:

◆ getPreview()

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

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

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

343  {
344  // generate the question output
345  include_once "./Services/UICore/classes/class.ilTemplate.php";
346  $template = new ilTemplate("tpl.il_as_qpl_text_question_output.html", TRUE, TRUE, "Modules/TestQuestionPool");
347  if ($this->object->getMaxNumOfChars())
348  {
349  $template->setCurrentBlock("maximum_char_hint");
350  $template->setVariable("MAXIMUM_CHAR_HINT", sprintf($this->lng->txt("text_maximum_chars_allowed"), $this->object->getMaxNumOfChars()));
351  $template->parseCurrentBlock();
352  #mbecker: No such block. $template->setCurrentBlock("has_maxchars");
353  $template->setVariable("MAXCHARS", $this->object->getMaxNumOfChars());
354  $template->parseCurrentBlock();
355  $template->setCurrentBlock("maxchars_counter");
356  $template->setVariable("QID", $this->object->getId());
357  $template->setVariable("MAXCHARS", $this->object->getMaxNumOfChars());
358  $template->setVariable("TEXTBOXSIZE", strlen($this->object->getMaxNumOfChars()));
359  $template->setVariable("CHARACTERS", $this->lng->txt("characters"));
360  $template->parseCurrentBlock();
361  }
362 
363  if( is_object($this->getPreviewSession()) )
364  {
365  $template->setVariable("ESSAY", ilUtil::prepareFormOutput(
366  $this->getPreviewSession()->getParticipantsSolution()
367  ));
368  }
369 
370  $questiontext = $this->object->getQuestion();
371  $template->setVariable("QUESTIONTEXT", $this->object->prepareTextareaOutput($questiontext, TRUE));
372  $template->setVariable("QID", $this->object->getId());
373 
374  $questionoutput = $template->get();
375 
376  $questionoutput .= $this->getJsCode();
377 
378  if (!$show_question_only)
379  {
380  // get page object output
381  $questionoutput = $this->getILIASPage($questionoutput);
382  }
383  return $questionoutput;
384  }
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
getILIASPage($html="")
Returns the ILIAS Page around a question.
special template class to simplify handling of ITX/PEAR
+ 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

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

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

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

◆ getSpecificFeedbackOutput()

assTextQuestionGUI::getSpecificFeedbackOutput (   $active_id,
  $pass 
)

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

Referenced by getSolutionOutput().

555  {
556  $feedback = '<table><tbody>';
557  $user_answers = $this->object->getSolutionValues($active_id);
558  $user_answer = ' '. $user_answers[0]['value1'];
559 
560  foreach ($this->object->getAnswers() as $idx => $ans)
561  {
562  if ($this->object->isKeywordMatching($user_answer, $ans->getAnswertext() ))
563  {
564  $fb = $this->object->feedbackOBJ->getSpecificAnswerFeedbackTestPresentation(
565  $this->object->getId(), $idx
566  );
567  $feedback .= '<tr><td><b><i>' . $ans->getAnswertext() . '</i></b></td><td>';
568  $feedback .= $fb . '</td> </tr>';
569  }
570  }
571 
572  $feedback .= '</tbody></table>';
573  return $this->object->prepareTextareaOutput($feedback, TRUE);
574  }
+ Here is the caller graph for this function:

◆ getTestOutput()

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

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

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

387  {
388  // get the solution of the user for the active pass or from the last pass if allowed
389  $user_solution = "";
390  if ($active_id)
391  {
392  $solutions = NULL;
393  // hey: prevPassSolutions - obsolete due to central check
394  #include_once "./Modules/Test/classes/class.ilObjTest.php";
395  #if (!ilObjTest::_getUsePreviousAnswers($active_id, true))
396  #{
397  # if (is_null($pass)) $pass = ilObjTest::_getPass($active_id);
398  #}
399  // hey.
400  $solutions = $this->object->getUserSolutionPreferingIntermediate($active_id, $pass);
401  foreach ($solutions as $idx => $solution_value)
402  {
403  $user_solution = $solution_value["value1"];
404  }
405  }
406 
407  // generate the question output
408  include_once "./Services/UICore/classes/class.ilTemplate.php";
409  $template = new ilTemplate("tpl.il_as_qpl_text_question_output.html", TRUE, TRUE, "Modules/TestQuestionPool");
410  if ($this->object->getMaxNumOfChars())
411  {
412  $template->setCurrentBlock("maximum_char_hint");
413  $template->setVariable("MAXIMUM_CHAR_HINT", sprintf($this->lng->txt("text_maximum_chars_allowed"), $this->object->getMaxNumOfChars()));
414  $template->parseCurrentBlock();
415  #mbecker: No such block. $template->setCurrentBlock("has_maxchars");
416  $template->setVariable("MAXCHARS", $this->object->getMaxNumOfChars());
417  $template->parseCurrentBlock();
418  $template->setCurrentBlock("maxchars_counter");
419  $template->setVariable("MAXCHARS", $this->object->getMaxNumOfChars());
420  $template->setVariable("QID", $this->object->getId());
421  $template->setVariable("TEXTBOXSIZE", strlen($this->object->getMaxNumOfChars()));
422  $template->setVariable("CHARACTERS", $this->lng->txt("characters"));
423  $template->parseCurrentBlock();
424  }
425  $template->setVariable("QID", $this->object->getId());
426  $template->setVariable("ESSAY", ilUtil::prepareFormOutput($user_solution));
427  $questiontext = $this->object->getQuestion();
428  $template->setVariable("QUESTIONTEXT", $this->object->prepareTextareaOutput($questiontext, TRUE));
429  $questionoutput = $template->get();
430 
431  $questionoutput .= $this->getJsCode();
432 
433  $pageoutput = $this->outQuestionPage("", $is_postponed, $active_id, $questionoutput);
434  include_once "./Services/YUI/classes/class.ilYuiUtil.php";
436  return $pageoutput;
437  }
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
special template class to simplify handling of ITX/PEAR
static initDomEvent()
Init YUI DomEvent.
outQuestionPage($a_temp_var, $a_postponed=false, $active_id="", $html="")
output question page
+ Here is the call graph for this function:

◆ getUserAnswer()

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

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

References $pass.

Referenced by getSolutionOutput().

332  {
333  $user_solution = "";
334  $solutions = $this->object->getSolutionValues( $active_id, $pass );
335  foreach ($solutions as $idx => $solution_value)
336  {
337  $user_solution = $solution_value["value1"];
338  }
339  return $user_solution;
340  }
+ Here is the caller graph for this function:

◆ magicAfterTestOutput()

assTextQuestionGUI::magicAfterTestOutput ( )

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

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

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

◆ outAdditionalOutput()

assTextQuestionGUI::outAdditionalOutput ( )

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

Referenced by magicAfterTestOutput().

118  {
119  }
+ Here is the caller graph for this function:

◆ populateAnswerSpecificFormPart()

assTextQuestionGUI::populateAnswerSpecificFormPart ( \ilPropertyFormGUI  $form)

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

References ilPropertyFormGUI\addItem(), ilSubEnabledFormPropertyGUI\addSubItem(), ilRadioOption\addSubItem(), ilNumberInputGUI\allowDecimals(), ilFormPropertyGUI\setRequired(), and ilRadioOption\setValue().

Referenced by editQuestion().

635  {
636  $scoringMode = new ilRadioGroupInputGUI(
637  $this->lng->txt( 'essay_scoring_mode' ), 'scoring_mode'
638  );
639 
640  $scoringOptionNone = new ilRadioOption($this->lng->txt( 'essay_scoring_mode_without_keywords' ),
641  'non', $this->lng->txt( 'essay_scoring_mode_without_keywords_desc'
642  )
643  );
644  $scoringOptionAnyKeyword = new ilRadioOption($this->lng->txt( 'essay_scoring_mode_keyword_relation_any' ),
645  'any', $this->lng->txt( 'essay_scoring_mode_keyword_relation_any_desc'
646  )
647  );
648  $scoringOptionAllKeyword = new ilRadioOption($this->lng->txt( 'essay_scoring_mode_keyword_relation_all' ),
649  'all', $this->lng->txt( 'essay_scoring_mode_keyword_relation_all_desc'
650  )
651  );
652  $scoringOptionOneKeyword = new ilRadioOption($this->lng->txt( 'essay_scoring_mode_keyword_relation_one' ),
653  'one', $this->lng->txt( 'essay_scoring_mode_keyword_relation_one_desc'
654  )
655  );
656 
657  $scoringMode->addOption( $scoringOptionNone );
658  $scoringMode->addOption( $scoringOptionAnyKeyword );
659  $scoringMode->addOption( $scoringOptionAllKeyword );
660  $scoringMode->addOption( $scoringOptionOneKeyword );
661  $scoringMode->setRequired( true );
662  $scoringMode->setValue( strlen( $this->object->getKeywordRelation() ) ? $this->object->getKeywordRelation(
663  ) : 'non'
664  );
665 
666  if ($this->object->getAnswerCount() == 0)
667  {
668  $this->object->addAnswer( "", 1, 0, 0 );
669  }
670  require_once "./Modules/TestQuestionPool/classes/class.ilEssayKeywordWizardInputGUI.php";
671 
672  // Without Keywords
673  $nonKeywordPoints = new ilNumberInputGUI($this->lng->txt( "points" ), "non_keyword_points");
674  $nonKeywordPoints->allowDecimals(true);
675  $nonKeywordPoints->setValue( $this->object->getPoints() );
676  $nonKeywordPoints->setRequired( TRUE );
677  $nonKeywordPoints->setSize( 3 );
678  $nonKeywordPoints->setMinValue( 0.0 );
679  $nonKeywordPoints->setMinvalueShouldBeGreater( true );
680  $scoringOptionNone->addSubItem( $nonKeywordPoints );
681 
682  // Any Keyword
683  $anyKeyword = new ilEssayKeywordWizardInputGUI($this->lng->txt( "answers" ), "any_keyword");
684  $anyKeyword->setRequired( TRUE );
685  $anyKeyword->setQuestionObject( $this->object );
686  $anyKeyword->setSingleline( TRUE );
687  $anyKeyword->setValues( $this->object->getAnswers() );
688  $scoringOptionAnyKeyword->addSubItem( $anyKeyword );
689 
690  // All Keywords
691  $allKeyword = new ilTextWizardInputGUI($this->lng->txt( "answers" ), "all_keyword");
692  $allKeyword->setRequired( TRUE );
693  //$allKeyword->setQuestionObject($this->object);
694  //$allKeyword->setSingleline(TRUE);
695  $allKeyword->setValues( self::buildAnswerTextOnlyArray( $this->object->getAnswers() ) );
696  $scoringOptionAllKeyword->addSubItem( $allKeyword );
697  $allKeywordPoints = new ilNumberInputGUI($this->lng->txt( "points" ), "all_keyword_points");
698  $allKeywordPoints->allowDecimals(true);
699  $allKeywordPoints->setValue( $this->object->getPoints() );
700  $allKeywordPoints->setRequired( TRUE );
701  $allKeywordPoints->setSize( 3 );
702  $allKeywordPoints->setMinValue( 0.0 );
703  $allKeywordPoints->setMinvalueShouldBeGreater( true );
704  $scoringOptionAllKeyword->addSubItem( $allKeywordPoints );
705 
706  // One Keywords
707  $oneKeyword = new ilTextWizardInputGUI($this->lng->txt( "answers" ), "one_keyword");
708  $oneKeyword->setRequired( TRUE );
709  //$oneKeyword->setQuestionObject($this->object);
710  //$oneKeyword->setSingleline(TRUE);
711  $oneKeyword->setValues( self::buildAnswerTextOnlyArray( $this->object->getAnswers() ) );
712  $scoringOptionOneKeyword->addSubItem( $oneKeyword );
713  $oneKeywordPoints = new ilNumberInputGUI($this->lng->txt( "points" ), "one_keyword_points");
714  $oneKeywordPoints->allowDecimals(true);
715  $oneKeywordPoints->setValue( $this->object->getPoints() );
716  $oneKeywordPoints->setRequired( TRUE );
717  $oneKeywordPoints->setSize( 3 );
718  $oneKeywordPoints->setMinValue( 0.0 );
719  $oneKeywordPoints->setMinvalueShouldBeGreater( true );
720  $scoringOptionOneKeyword->addSubItem( $oneKeywordPoints );
721 
722  $form->addItem( $scoringMode );
723  }
This class represents an option in a radio group.
allowDecimals($a_value)
Toggle Decimals.
This class represents a property in a property form.
setValue($a_value)
Set Value.
addSubItem($a_item)
Add Subitem.
This class represents a number property in a property form.
This class represents a text wizard property in a property form.
setRequired($a_required)
Set Required.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateQuestionSpecificFormPart()

assTextQuestionGUI::populateQuestionSpecificFormPart ( \ilPropertyFormGUI  $form)

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

References ilPropertyFormGUI\addItem(), and ilNumberInputGUI\setSize().

Referenced by editQuestion().

607  {
608  // maxchars
609  $maxchars = new ilNumberInputGUI($this->lng->txt( "maxchars" ), "maxchars");
610  $maxchars->setSize( 5 );
611  if ($this->object->getMaxNumOfChars() > 0)
612  $maxchars->setValue( $this->object->getMaxNumOfChars() );
613  $maxchars->setInfo( $this->lng->txt( "description_maxchars" ) );
614  $form->addItem( $maxchars );
615 
616  // text rating
617  $textrating = new ilSelectInputGUI($this->lng->txt("text_rating"), "text_rating");
618  $text_options = array(
619  "ci" => $this->lng->txt("cloze_textgap_case_insensitive"),
620  "cs" => $this->lng->txt("cloze_textgap_case_sensitive"),
621  "l1" => sprintf($this->lng->txt("cloze_textgap_levenshtein_of"), "1"),
622  "l2" => sprintf($this->lng->txt("cloze_textgap_levenshtein_of"), "2"),
623  "l3" => sprintf($this->lng->txt("cloze_textgap_levenshtein_of"), "3"),
624  "l4" => sprintf($this->lng->txt("cloze_textgap_levenshtein_of"), "4"),
625  "l5" => sprintf($this->lng->txt("cloze_textgap_levenshtein_of"), "5")
626  );
627  $textrating->setOptions($text_options);
628  $textrating->setValue($this->object->getTextRating());
629  $form->addItem($textrating);
630 
631  return $form;
632  }
This class represents a selection list property in a property form.
This class represents a number property in a property form.
setSize($a_size)
Set Size.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setQuestionTabs()

assTextQuestionGUI::setQuestionTabs ( )

Sets the ILIAS tabs for this question type.

public

Todo:
: MOVE THIS STEPS TO COMMON QUESTION CLASS assQuestionGUI

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

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

491  {
492  global $rbacsystem, $ilTabs;
493 
494  $ilTabs->clearTargets();
495 
496  $this->ctrl->setParameterByClass("ilAssQuestionPageGUI", "q_id", $_GET["q_id"]);
497  include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
498  $q_type = $this->object->getQuestionType();
499 
500  if (strlen($q_type))
501  {
502  $classname = $q_type . "GUI";
503  $this->ctrl->setParameterByClass(strtolower($classname), "sel_question_types", $q_type);
504  $this->ctrl->setParameterByClass(strtolower($classname), "q_id", $_GET["q_id"]);
505  }
506 
507  if ($_GET["q_id"])
508  {
509  if ($rbacsystem->checkAccess('write', $_GET["ref_id"]))
510  {
511  // edit page
512  $ilTabs->addTarget("edit_page",
513  $this->ctrl->getLinkTargetByClass("ilAssQuestionPageGUI", "edit"),
514  array("edit", "insert", "exec_pg"),
515  "", "", $force_active);
516  }
517 
518  $this->addTab_QuestionPreview($ilTabs);
519  }
520 
521  $force_active = false;
522  if ($rbacsystem->checkAccess('write', $_GET["ref_id"]))
523  {
524  $url = "";
525  if ($classname) $url = $this->ctrl->getLinkTargetByClass($classname, "editQuestion");
526  // edit question properties
527  $ilTabs->addTarget("edit_question",
528  $url,
529  array("editQuestion", "save", "saveEdit", "originalSyncForm"),
530  $classname, "", $force_active);
531  }
532 
533  // add tab for question feedback within common class assQuestionGUI
534  $this->addTab_QuestionFeedback($ilTabs);
535 
536  // add tab for question hint within common class assQuestionGUI
537  $this->addTab_QuestionHints($ilTabs);
538 
539  // add tab for question's suggested solution within common class assQuestionGUI
540  $this->addTab_SuggestedSolution($ilTabs, $classname);
541 
542  // Assessment of questions sub menu entry
543  if ($_GET["q_id"])
544  {
545  $ilTabs->addTarget("statistics",
546  $this->ctrl->getLinkTargetByClass($classname, "assessment"),
547  array("assessment"),
548  $classname, "");
549  }
550 
551  $this->addBackTab($ilTabs);
552  }
addTab_QuestionPreview(ilTabsGUI $tabsGUI)
addTab_QuestionHints(ilTabsGUI $tabs)
adds the hints tab to ilTabsGUI
$_GET["client_id"]
$url
Definition: shib_logout.php:72
addTab_QuestionFeedback(ilTabsGUI $tabs)
adds the feedback tab to ilTabsGUI
addBackTab(ilTabsGUI $ilTabs)
addTab_SuggestedSolution(ilTabsGUI $tabs, $classname)
+ 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 583 of file class.assTextQuestionGUI.php.

References $_POST.

Referenced by writePostData().

584  {
585  switch ($this->object->getKeywordRelation())
586  {
587  case 'non':
588  $this->object->setAnswers( array() );
589  $this->object->setPoints( $_POST['non_keyword_points'] );
590  break;
591  case 'any':
592  $this->object->setAnswers( $_POST['any_keyword'] );
593  $this->object->setPoints( $this->object->getMaximumPoints() );
594  break;
595  case 'all':
596  $this->object->setAnswers( $_POST['all_keyword'] );
597  $this->object->setPoints( $_POST['all_keyword_points'] );
598  break;
599  case 'one':
600  $this->object->setAnswers( $_POST['one_keyword'] );
601  $this->object->setPoints( $_POST['one_keyword_points'] );
602  break;
603  }
604  }
$_POST['username']
Definition: cron.php:12
+ Here is the caller graph for this function:

◆ writePostData()

assTextQuestionGUI::writePostData (   $always = false)

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

Parameters
bool$always
Returns
integer A positive value, if one of the required fields wasn't set, else 0

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

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

50  {
51  $hasErrors = (!$always) ? $this->editQuestion(true) : false;
52  if (!$hasErrors)
53  {
54  require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
58  $this->saveTaxonomyAssignments();
59  return 0;
60  }
61  return 1;
62  }
This class represents a property form user interface.
editQuestion($checkonly=FALSE)
Creates an output of the edit form for the question.
writeAnswerSpecificPostData(ilPropertyFormGUI $form)
Extracts the answer specific values from $_POST and applies them to the data object.
writeQuestionSpecificPostData(ilPropertyFormGUI $form)
Extracts the question specific values from $_POST and applies them to the data object.
+ Here is the call 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 576 of file class.assTextQuestionGUI.php.

References $_POST.

Referenced by writePostData().

577  {
578  $this->object->setMaxNumOfChars( $_POST["maxchars"] );
579  $this->object->setTextRating( $_POST["text_rating"] );
580  $this->object->setKeywordRelation( $_POST['scoring_mode'] );
581  }
$_POST['username']
Definition: cron.php:12
+ Here is the caller graph for this function:

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