ILIAS  release_7 Revision v7.30-3-g800a261c036
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 ()
 
 supportsIntermediateSolutionOutput ()
 Question type specific support of intermediate solution output The function getSolutionOutput respects getUseIntermediateSolution() More...
 
 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 ()
 
 getSpecificFeedbackOutput ($userSolution)
 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...
 
 isAnswerFreuqencyStatisticSupported ()
 
 getAnswersFrequency ($relevantAnswers, $questionIndex)
 
 populateCorrectionsFormProperties (ilPropertyFormGUI $form)
 
 saveCorrectionsFormProperties (ilPropertyFormGUI $form)
 
- Public Member Functions inherited from assQuestionGUI
 __construct ()
 assQuestionGUI constructor More...
 
 hasInlineFeedback ()
 this method can be overwritten per question type More...
 
 addHeaderAction ()
 
 redrawHeaderAction ()
 
 getHeaderAction ()
 
 getNotesHTML ()
 
 executeCommand ()
 execute command More...
 
 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 (ilGlobalTemplateInterface $tpl)
 
 getPresentationJavascripts ()
 
 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="", $inlineFeedbackEnabled=false)
 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 ($userSolution)
 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)
 
 supportsIntermediateSolutionOutput ()
 Question type specific support of intermediate solution output The function getSolutionOutput respects getUseIntermediateSolution() More...
 
 hasIntermediateSolution ($activeId, $passIndex)
 Check if the question has an intermediate solution. More...
 
 setUseIntermediateSolution ($use)
 
 getUseIntermediateSolution ()
 Get if intermediate solution should be used for solution output. More...
 
 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 ()
 
 buildFocusAnchorHtml ()
 
 isAnswerFreuqencyStatisticSupported ()
 
 getSubQuestionsIndex ()
 
 getAnswersFrequency ($relevantAnswers, $questionIndex)
 
 getAnswerFrequencyTableGUI ($parentGui, $parentCmd, $relevantAnswers, $questionIndex)
 
 prepareReprintableCorrectionsForm (ilPropertyFormGUI $form)
 
 populateCorrectionsFormProperties (ilPropertyFormGUI $form)
 
 saveCorrectionsFormProperties (ilPropertyFormGUI $form)
 
- 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
 hasSpecialQuestionCommands ()
 
 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)
 
 setDefaultTabs (ilTabsGUI $ilTabs)
 
 setQuestionSpecificTabs (ilTabsGUI $ilTabs)
 
 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_Question (ilTabsGUI $tabsGUI)
 
 hasCorrectSolution ($activeId, $passIndex)
 
 writeQuestionGenericPostData ()
 
 completeTestOutputFormAction ($formAction, $active_id, $pass)
 
 addBackTab (ilTabsGUI $ilTabs)
 
 buildBasicEditFormObject ()
 
 escapeTemplatePlaceholders (string $text)
 
 buildEditForm ()
 
 addSaveOnEnterOnLoadCode ()
 

Protected Attributes

 $tiny_mce_enabled
 
- Protected Attributes inherited from assQuestionGUI
const HAS_SPECIAL_QUESTION_COMMANDS = false
 
 $ctrl
 
 $editForm
 
 $use_intermediate_solution = false
 

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
 
 $request
 
 $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'
 

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

34 {
35 $this->tiny_mce_enabled = (new ilSetting('advanced_editing'))->get('advanced_editing_javascript_editor')
36 === 'tinymce' ? true : false;
38 include_once "./Modules/TestQuestionPool/classes/class.assTextQuestion.php";
39 $this->object = new assTextQuestion();
40 if ($id >= 0) {
41 $this->object->loadFromDb($id);
42 }
43 }
return true
Flag indicating whether or not HTTP headers will be sent when outputting captcha image/audio.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ILIAS Setting Class.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ILIAS\GlobalScreen\Provider\__construct(), and true.

+ Here is the call graph for this function:

Member Function Documentation

◆ addSuggestedSolution()

assTextQuestionGUI::addSuggestedSolution ( )

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

474 {
475 $_SESSION["subquestion_index"] = 0;
476 if ($_POST["cmd"]["addSuggestedSolution"]) {
477 if ($this->writePostData()) {
479 $this->editQuestion();
480 return;
481 }
482 if (!$this->checkInput()) {
483 ilUtil::sendInfo($this->lng->txt("fill_out_all_required_fields_add_answer"));
484 $this->editQuestion();
485 return;
486 }
487 }
488 $this->object->saveToDb();
489 $this->ctrl->setParameter($this, "q_id", $this->object->getId());
490 $this->tpl->setVariable("HEADER", $this->object->getTitle());
491 $this->getQuestionTemplate();
492 parent::addSuggestedSolution();
493 }
$_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 108 of file class.assTextQuestionGUI.php.

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

◆ editQuestion()

assTextQuestionGUI::editQuestion (   $checkonly = false)

Creates an output of the edit form for the question.

@access public

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

68 {
69 $save = $this->isSaveCommand();
70 $this->getQuestionTemplate();
71
72 include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
73 $form = new ilPropertyFormGUI();
74 $this->editForm = $form;
75
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
85
86
87 $this->populateTaxonomyFormSection($form);
88
90
91 $errors = false;
92
93 if ($save) {
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) {
98 $checkonly = false;
99 }
100 }
101
102 if (!$checkonly) {
103 $this->tpl->setVariable("QUESTION_DATA", $form->getHTML());
104 }
105 return $errors;
106 }
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: imgupload.php:49

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

701 {
702 return array();
703 }

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

715 {
716 return array();
717 }

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

728 {
729 return ''; //print_r($relevant_answers,true);
730 }

◆ getAnswersFrequency()

assTextQuestionGUI::getAnswersFrequency (   $relevantAnswers,
  $questionIndex 
)

Reimplemented from assQuestionGUI.

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

738 {
739 }

◆ getBestAnswer()

assTextQuestionGUI::getBestAnswer (   $asHtml)
private

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

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

447 {
448 $tpl = new ilTemplate('tpl.charcounter.html', true, true, 'Modules/TestQuestionPool');
449
450 $tpl->setCurrentBlock('tinymce_handler');
451 $tpl->touchBlock('tinymce_handler');
452 $tpl->parseCurrentBlock();
453
454 if ($this->object->getMaxNumOfChars() > 0) {
455 $tpl->setCurrentBlock('letter_counter_js');
456 $tpl->setVariable("MAXCHARS", $this->object->getMaxNumOfChars());
457 $tpl->parseCurrentBlock();
458 }
459
460 if ($this->object->isWordCounterEnabled()) {
461 $tpl->setCurrentBlock('word_counter_js');
462 $tpl->touchBlock('word_counter_js');
463 $tpl->parseCurrentBlock();
464 }
465
466 $tpl->setCurrentBlock('counter_js');
467 $tpl->setVariable("QID", $this->object->getId());
468 $tpl->parseCurrentBlock();
469
470 return $tpl->get();
471 }

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

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 $template->setCurrentBlock("maximum_char_hint");
349 $template->setVariable("MAXIMUM_CHAR_HINT", sprintf($this->lng->txt("text_maximum_chars_allowed"), $this->object->getMaxNumOfChars()));
350 $template->parseCurrentBlock();
351 #mbecker: No such block. $template->setCurrentBlock("has_maxchars");
352 $template->setVariable("MAXCHARS", $this->object->getMaxNumOfChars());
353 $template->parseCurrentBlock();
354 $template->setCurrentBlock("maxchars_counter");
355 $template->setVariable("QID", $this->object->getId());
356 $template->setVariable("MAXCHARS", $this->object->getMaxNumOfChars());
357 $template->setVariable("TEXTBOXSIZE", strlen($this->object->getMaxNumOfChars()));
358 $template->setVariable("CHARACTERS", $this->lng->txt("qst_essay_chars_remaining"));
359 $template->parseCurrentBlock();
360 }
361
362 if ($this->object->isWordCounterEnabled()) {
363 $template->setCurrentBlock("word_counter");
364 $template->setVariable("QID", $this->object->getId());
365 $template->setVariable("WORDCOUNTER", $this->lng->txt("qst_essay_allready_written_words"));
366 $template->parseCurrentBlock();
367 }
368
369 if (is_object($this->getPreviewSession())) {
370 $template->setVariable("ESSAY", ilUtil::prepareFormOutput(
371 $this->getPreviewSession()->getParticipantsSolution()
372 ));
373 }
374
375 $template->setVariable("QUESTIONTEXT", $this->object->getQuestionForHTMLOutput());
376 $template->setVariable("QID", $this->object->getId());
377
378 $questionoutput = $template->get();
379
380 $questionoutput .= $this->getJsCode();
381
382 if (!$show_question_only) {
383 // get page object output
384 $questionoutput = $this->getILIASPage($questionoutput);
385 }
386 return $questionoutput;
387 }
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(), and ilUtil\prepareFormOutput().

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

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

Returns the answer specific feedback for the question.

This method should be overwritten by the actual question.

Todo:
Mark this method abstract!
Parameters
array$userSolution($userSolution[<value1>] = <value2>)
Returns
string HTML Code with the answer specific feedback @access public

Reimplemented from assQuestionGUI.

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

496 {
497 $user_answer = key($userSolution);
498
499 $feedback = '';
500
501 foreach ($this->object->getAnswers() as $idx => $ans) {
502 if ($this->object->isKeywordMatching($user_answer, htmlspecialchars($ans->getAnswertext()))) {
503 $fb = $this->object->feedbackOBJ->getSpecificAnswerFeedbackTestPresentation(
504 $this->object->getId(),
505 0,
506 $idx
507 );
508 $feedback .= '<tr><td><b><i>' . $ans->getAnswertext() . '</i></b></td><td>';
509 $feedback .= $fb . '</td> </tr>';
510 }
511 }
512
513 if ($feedback === '') {
514 return '';
515 }
516
517 $feedback = '<table><tbody>' . $feedback . '</tbody></table>';
518 return $this->object->prepareTextareaOutput($feedback, true);
519 }

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

390 {
391 // get the solution of the user for the active pass or from the last pass if allowed
392 $user_solution = "";
393 if ($active_id) {
394 $solutions = null;
395
396 $solutions = $this->object->getUserSolutionPreferingIntermediate($active_id, $pass);
397 foreach ($solutions as $idx => $solution_value) {
398 $user_solution = $solution_value["value1"];
399 }
400
401 if ($this->tiny_mce_enabled) {
402 $user_solution = htmlentities($user_solution);
403 }
404
405 $user_solution = str_replace(['{', '}', '\\'], ['&#123', '&#125', '&#92'], $user_solution);
406 }
407
408 // generate the question output
409 include_once "./Services/UICore/classes/class.ilTemplate.php";
410 $template = new ilTemplate("tpl.il_as_qpl_text_question_output.html", true, true, "Modules/TestQuestionPool");
411 if ($this->object->getMaxNumOfChars()) {
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("qst_essay_chars_remaining"));
423 $template->parseCurrentBlock();
424 }
425
426 if ($this->object->isWordCounterEnabled()) {
427 $template->setCurrentBlock("word_counter");
428 $template->setVariable("QID", $this->object->getId());
429 $template->setVariable("WORDCOUNTER", $this->lng->txt("qst_essay_allready_written_words"));
430 $template->parseCurrentBlock();
431 }
432
433 $template->setVariable("QID", $this->object->getId());
434 $template->setVariable("ESSAY", $user_solution);
435 $template->setVariable("QUESTIONTEXT", $this->object->getQuestionForHTMLOutput());
436 $questionoutput = $template->get();
437
438 $questionoutput .= $this->getJsCode();
439
440 $pageoutput = $this->outQuestionPage("", $is_postponed, $active_id, $questionoutput);
441 include_once "./Services/YUI/classes/class.ilYuiUtil.php";
443 return $pageoutput;
444 }
outQuestionPage($a_temp_var, $a_postponed=false, $active_id="", $html="", $inlineFeedbackEnabled=false)
output question page
static initDomEvent(ilGlobalTemplateInterface $a_main_tpl=null)
Init YUI DomEvent.

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

+ Here is the call graph for this function:

◆ getUserAnswer()

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

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

333 {
334 $user_solution = "";
335 $solutions = $this->object->getSolutionValues($active_id, $pass, !$this->getUseIntermediateSolution());
336 foreach ($solutions as $idx => $solution_value) {
337 $user_solution = $solution_value["value1"];
338 }
339 return $user_solution;
340 }
getUseIntermediateSolution()
Get if intermediate solution should be used for solution output.

References $pass, and assQuestionGUI\getUseIntermediateSolution().

Referenced by getSolutionOutput().

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

◆ isAnswerFreuqencyStatisticSupported()

assTextQuestionGUI::isAnswerFreuqencyStatisticSupported ( )

Reimplemented from assQuestionGUI.

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

733 {
734 return false;
735 }

◆ magicAfterTestOutput()

assTextQuestionGUI::magicAfterTestOutput ( )

Reimplemented from assQuestionGUI.

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

124 {
125 // TODO - BEGIN: what exactly is done here? cant we use the parent method?
126
127 include_once "./Services/RTE/classes/class.ilRTE.php";
128 $rtestring = ilRTE::_getRTEClassname();
129 include_once "./Services/RTE/classes/class.$rtestring.php";
130 $rte = new $rtestring();
131 include_once "./Services/Object/classes/class.ilObject.php";
132 $obj_id = ilObject::_lookupObjectId($_GET["ref_id"]);
133 $obj_type = ilObject::_lookupType($_GET["ref_id"], true);
134 $rte->addUserTextEditor("textinput");
135 $this->outAdditionalOutput();
136
137 // TODO - END: what exactly is done here? cant we use the parent method?
138 }
$_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 119 of file class.assTextQuestionGUI.php.

120 {
121 }

Referenced by magicAfterTestOutput().

+ Here is the caller graph for this function:

◆ populateAnswerSpecificFormPart()

assTextQuestionGUI::populateAnswerSpecificFormPart ( \ilPropertyFormGUI  $form)

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

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

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

◆ populateCorrectionsFormProperties()

assTextQuestionGUI::populateCorrectionsFormProperties ( ilPropertyFormGUI  $form)
Parameters
ilPropertyFormGUI$form

Reimplemented from assQuestionGUI.

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

742 {
744 $this->populateAnswerSpecificFormPart($form);
745
746 $form->removeItemByPostVar('maxchars');
747 }
removeItemByPostVar($a_post_var, $a_remove_unused_headers=false)
Remove Item.

References populateAnswerSpecificFormPart(), populateQuestionSpecificFormPart(), and ilPropertyFormGUI\removeItemByPostVar().

+ Here is the call graph for this function:

◆ populateQuestionSpecificFormPart()

assTextQuestionGUI::populateQuestionSpecificFormPart ( \ilPropertyFormGUI  $form)

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

552 {
553 // wordcounter
554 $wordcounter = new ilCheckboxInputGUI($this->lng->txt('qst_essay_wordcounter_enabled'), 'wordcounter');
555 $wordcounter->setInfo($this->lng->txt('qst_essay_wordcounter_enabled_info'));
556 $wordcounter->setChecked($this->object->isWordCounterEnabled());
557 $form->addItem($wordcounter);
558
559 // maxchars
560 $maxchars = new ilNumberInputGUI($this->lng->txt("maxchars"), "maxchars");
561 $maxchars->setSize(5);
562 $maxchars->setMinValue(1);
563 if ($this->object->getMaxNumOfChars() > 0) {
564 $maxchars->setValue($this->object->getMaxNumOfChars());
565 }
566 $maxchars->setInfo($this->lng->txt("description_maxchars"));
567 $form->addItem($maxchars);
568
569 // text rating
570 $textrating = new ilSelectInputGUI($this->lng->txt("text_rating"), "text_rating");
571 $text_options = array(
572 "ci" => $this->lng->txt("cloze_textgap_case_insensitive"),
573 "cs" => $this->lng->txt("cloze_textgap_case_sensitive"),
574 "l1" => sprintf($this->lng->txt("cloze_textgap_levenshtein_of"), "1"),
575 "l2" => sprintf($this->lng->txt("cloze_textgap_levenshtein_of"), "2"),
576 "l3" => sprintf($this->lng->txt("cloze_textgap_levenshtein_of"), "3"),
577 "l4" => sprintf($this->lng->txt("cloze_textgap_levenshtein_of"), "4"),
578 "l5" => sprintf($this->lng->txt("cloze_textgap_levenshtein_of"), "5")
579 );
580 $textrating->setOptions($text_options);
581 $textrating->setValue($this->object->getTextRating());
582 $form->addItem($textrating);
583
584 return $form;
585 }
This class represents a checkbox property in a property form.
This class represents a selection list property in a property form.

References ilPropertyFormGUI\addItem().

Referenced by editQuestion(), and populateCorrectionsFormProperties().

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

◆ saveCorrectionsFormProperties()

assTextQuestionGUI::saveCorrectionsFormProperties ( ilPropertyFormGUI  $form)
Parameters
ilPropertyFormGUI$form

Reimplemented from assQuestionGUI.

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

753 {
754 $this->writeQuestionSpecificPostData($form);
755 $this->writeAnswerSpecificPostData($form);
756 }
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 writeAnswerSpecificPostData(), and writeQuestionSpecificPostData().

+ Here is the call graph for this function:

◆ supportsIntermediateSolutionOutput()

assTextQuestionGUI::supportsIntermediateSolutionOutput ( )

Question type specific support of intermediate solution output The function getSolutionOutput respects getUseIntermediateSolution()

Returns
bool

Reimplemented from assQuestionGUI.

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

146 {
147 return true;
148 }

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

530 {
531 switch ($this->object->getKeywordRelation()) {
532 case 'non':
533 $this->object->setAnswers(array());
534 $this->object->setPoints($_POST['non_keyword_points']);
535 break;
536 case 'any':
537 $this->object->setAnswers($_POST['any_keyword']);
538 $this->object->setPoints($this->object->getMaximumPoints());
539 break;
540 case 'all':
541 $this->object->setAnswers($_POST['all_keyword']);
542 $this->object->setPoints($_POST['all_keyword_points']);
543 break;
544 case 'one':
545 $this->object->setAnswers($_POST['one_keyword']);
546 $this->object->setPoints($_POST['one_keyword_points']);
547 break;
548 }
549 }

References $_POST.

Referenced by saveCorrectionsFormProperties(), and 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 48 of file class.assTextQuestionGUI.php.

49 {
50 $hasErrors = (!$always) ? $this->editQuestion(true) : false;
51 if (!$hasErrors) {
52 require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
57 return 0;
58 }
59 return 1;
60 }

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

522 {
523 $this->object->setWordCounterEnabled(isset($_POST['wordcounter']) && $_POST['wordcounter']);
524 $this->object->setMaxNumOfChars($_POST["maxchars"]);
525 $this->object->setTextRating($_POST["text_rating"]);
526 $this->object->setKeywordRelation($_POST['scoring_mode']);
527 }

References $_POST.

Referenced by saveCorrectionsFormProperties(), and writePostData().

+ Here is the caller graph for this function:

Field Documentation

◆ $tiny_mce_enabled

assTextQuestionGUI::$tiny_mce_enabled
protected

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


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