ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 ()
 
 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)
 
 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 {
39 $this->object->loadFromDb($id);
40 }
41 }
Class for text questions.

Member Function Documentation

◆ addSuggestedSolution()

assTextQuestionGUI::addSuggestedSolution ( )

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

457 {
458 $_SESSION["subquestion_index"] = 0;
459 if ($_POST["cmd"]["addSuggestedSolution"])
460 {
461 if ($this->writePostData())
462 {
464 $this->editQuestion();
465 return;
466 }
467 if (!$this->checkInput())
468 {
469 ilUtil::sendInfo($this->lng->txt("fill_out_all_required_fields_add_answer"));
470 $this->editQuestion();
471 return;
472 }
473 }
474 $this->object->saveToDb();
475 $this->ctrl->setParameter($this, "q_id", $this->object->getId());
476 $this->tpl->setVariable("HEADER", $this->object->getTitle());
477 $this->getQuestionTemplate();
478 parent::addSuggestedSolution();
479 }
$_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 104 of file class.assTextQuestionGUI.php.

105 {
106 $answerTexts = array();
107
108 foreach($answers as $answer)
109 {
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 66 of file class.assTextQuestionGUI.php.

67 {
68 $save = $this->isSaveCommand();
69 $this->getQuestionTemplate();
70
71 include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
72 $form = new ilPropertyFormGUI();
73 $this->editForm = $form;
74
75 $form->setFormAction($this->ctrl->getFormAction($this));
76 $form->setTitle($this->outQuestionType());
77 $form->setMultipart(TRUE);
78 $form->setTableWidth("100%");
79 $form->setId("asstextquestion");
80
81 $this->addBasicQuestionFormProperties( $form );
83 $this->populateAnswerSpecificFormPart( $form );
84
85
86 $this->populateTaxonomyFormSection($form);
87
89
90 $errors = false;
91
92 if ($save)
93 {
94 $form->setValuesByPost();
95 $errors = !$form->checkInput();
96 $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
97 if ($errors) $checkonly = false;
98 }
99
100 if (!$checkonly) $this->tpl->setVariable("QUESTION_DATA", $form->getHTML());
101 return $errors;
102 }
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

References $errors, 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 732 of file class.assTextQuestionGUI.php.

733 {
734 return array();
735 }

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

747 {
748 return array();
749 }

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

760 {
761 return ''; //print_r($relevant_answers,true);
762 }

◆ getBestAnswer()

assTextQuestionGUI::getBestAnswer (   $asHtml)
private

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

277 {
278 $answers = $this->object->getAnswers();
279 if( !count($answers) )
280 {
281 return '';
282 }
283
284 if($asHtml)
285 {
286 $tplFile = 'tpl.il_as_qpl_text_question_best_solution_html.html';
287 }
288 else
289 {
290 $tplFile = 'tpl.il_as_qpl_text_question_best_solution_ta.html';
291 }
292
293 $tpl = new ilTemplate($tplFile, true, true, 'Modules/TestQuestionPool');
294
295 foreach ($answers as $answer)
296 {
297 $keywordString = $answer->getAnswertext();
298
299 if( in_array($this->object->getKeywordRelation(), assTextQuestion::getScoringModesWithPointsByKeyword()) )
300 {
301 $keywordString .= ' ' . $this->lng->txt('for') . ' ';
302 $keywordString .= $answer->getPoints() . ' ' . $this->lng->txt('points');
303 }
304
305 $tpl->setCurrentBlock('keyword');
306 $tpl->setVariable('KEYWORD', $keywordString);
307 $tpl->parseCurrentBlock();
308 }
309
310 $tpl->setVariable('KEYWORD_HEADER', $this->lng->txt('solution_contain_keywords'));
311 $tpl->setVariable('SCORING_LABEL', $this->lng->txt('essay_scoring_mode').': ');
312
313 switch( $this->object->getKeywordRelation() )
314 {
315 case 'any':
316 $tpl->setVariable('SCORING_MODE', $this->lng->txt('essay_scoring_mode_keyword_relation_any'));
317 break;
318 case 'all':
319 $tpl->setVariable('SCORING_MODE', $this->lng->txt('essay_scoring_mode_keyword_relation_all'));
320 break;
321 case 'one':
322 $tpl->setVariable('SCORING_MODE', $this->lng->txt('essay_scoring_mode_keyword_relation_one'));
323 break;
324 }
325
326 return $tpl->get();
327 }
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 437 of file class.assTextQuestionGUI.php.

438 {
439 $tpl = new ilTemplate('tpl.charcounter.html', true, true, 'Modules/TestQuestionPool');
440
441 $tpl->setCurrentBlock('tinymce_handler');
442 $tpl->touchBlock('tinymce_handler');
443 $tpl->parseCurrentBlock();
444
445 if ($this->object->getMaxNumOfChars() > 0)
446 {
447 $tpl->setCurrentBlock('letter_counter_js');
448 $tpl->setVariable("QID", $this->object->getId());
449 $tpl->setVariable("MAXCHARS", $this->object->getMaxNumOfChars());
450 $tpl->parseCurrentBlock();
451 }
452
453 return $tpl->get();
454 }

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

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

References 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.

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

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

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

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

References $pass, 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 329 of file class.assTextQuestionGUI.php.

330 {
331 $user_solution = "";
332 $solutions = $this->object->getSolutionValues( $active_id, $pass );
333 foreach ($solutions as $idx => $solution_value)
334 {
335 $user_solution = $solution_value["value1"];
336 }
337 return $user_solution;
338 }

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

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

Referenced by editQuestion().

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

◆ populateQuestionSpecificFormPart()

assTextQuestionGUI::populateQuestionSpecificFormPart ( \ilPropertyFormGUI  $form)

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

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

References ilPropertyFormGUI\addItem(), and sprintf.

Referenced by editQuestion().

+ 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.

@access public

Todo:
: MOVE THIS STEPS TO COMMON QUESTION CLASS assQuestionGUI

Reimplemented from assQuestionGUI.

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

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

582 {
583 switch ($this->object->getKeywordRelation())
584 {
585 case 'non':
586 $this->object->setAnswers( array() );
587 $this->object->setPoints( $_POST['non_keyword_points'] );
588 break;
589 case 'any':
590 $this->object->setAnswers( $_POST['any_keyword'] );
591 $this->object->setPoints( $this->object->getMaximumPoints() );
592 break;
593 case 'all':
594 $this->object->setAnswers( $_POST['all_keyword'] );
595 $this->object->setPoints( $_POST['all_keyword_points'] );
596 break;
597 case 'one':
598 $this->object->setAnswers( $_POST['one_keyword'] );
599 $this->object->setPoints( $_POST['one_keyword_points'] );
600 break;
601 }
602 }

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

47 {
48 $hasErrors = (!$always) ? $this->editQuestion(true) : false;
49 if (!$hasErrors)
50 {
51 require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
56 return 0;
57 }
58 return 1;
59 }
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 574 of file class.assTextQuestionGUI.php.

575 {
576 $this->object->setMaxNumOfChars( $_POST["maxchars"] );
577 $this->object->setTextRating( $_POST["text_rating"] );
578 $this->object->setKeywordRelation( $_POST['scoring_mode'] );
579 }

References $_POST.

Referenced by writePostData().

+ Here is the caller graph for this function:

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