ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
assLongMenuGUI Class Reference
+ Inheritance diagram for assLongMenuGUI:
+ Collaboration diagram for assLongMenuGUI:

Public Member Functions

 __construct ($id=-1)
 
 getCommand ($cmd)
 
 writeQuestionSpecificPostData (ilPropertyFormGUI $form)
 Extracts the question specific values from $_POST and applies them to the data object. More...
 
 populateQuestionSpecificFormPart (ilPropertyFormGUI $form)
 
 populateAnswerSpecificFormPart (ilPropertyFormGUI $form)
 
 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, $is_postponed=false, $use_post_solutions=false, $show_feedback=false)
 
 setQuestionTabs ()
 Sets the ILIAS tabs for this question type. More...
 
 getSpecificFeedbackOutput ($userSolution)
 Returns the answer specific feedback for the question. 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...
 
 getLongMenuTextWithInputFieldsInsteadOfGaps ($user_solution=array(), $solution=false, $graphical=false)
 
 getSubQuestionsIndex ()
 
 getAnswersFrequency ($relevant_answers, $questionIndex)
 
 getAnswerFrequencyTableGUI ($parentGui, $parentCmd, $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...
 
 getCommand ($cmd)
 
 getType ()
 needed for page editor compliance More...
 
 getPresentationContext ()
 
 setPresentationContext ($presentationContext)
 
 isTestPresentationContext ()
 
 isPreviousSolutionPrefilled ()
 
 setPreviousSolutionPrefilled ($previousSolutionPrefilled)
 
 getRenderPurpose ()
 
 setRenderPurpose ($renderPurpose)
 
 isRenderPurposePrintPdf ()
 
 isRenderPurposePreview ()
 
 isRenderPurposeInputValue ()
 
 isRenderPurposePlayback ()
 
 isRenderPurposeDemoplay ()
 
 renderPurposeSupportsFormHtml ()
 
 getEditContext ()
 
 setEditContext ($editContext)
 
 isAuthoringEditContext ()
 
 isAdjustmentEditContext ()
 
 setAdjustmentEditContext ()
 
 getNavigationGUI ()
 
 setNavigationGUI ($navigationGUI)
 
 setTaxonomyIds ($taxonomyIds)
 
 getTaxonomyIds ()
 
 setTargetGui ($linkTargetGui)
 
 setTargetGuiClass ($targetGuiClass)
 
 getTargetGuiClass ()
 
 setQuestionHeaderBlockBuilder ($questionHeaderBlockBuilder)
 
 getQuestionHeaderBlockBuilder ()
 
 setQuestionActionCmd ($questionActionCmd)
 
 getQuestionActionCmd ()
 
createQuestionGUI ($question_type, $question_id=-1)
 Creates a question gui representation. More...
 
 populateJavascriptFilesRequiredForWorkForm (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)
 
 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...
 

Data Fields

 $lng
 
- 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 Member Functions

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

Private Member Functions

 getTextGapTemplate ($key, $value, $solution, $ok=false, $graphical=false)
 
 getSelectGapTemplate ($key, $answers, $user_value, $solution, $ok=false, $graphical=false)
 

Private Attributes

 $rbacsystem
 
 $ilTabs
 

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...
 
- Protected Attributes inherited from assQuestionGUI
 $editForm
 
 $use_intermediate_solution = false
 

Detailed Description

Definition at line 15 of file class.assLongMenuGUI.php.

Constructor & Destructor Documentation

◆ __construct()

assLongMenuGUI::__construct (   $id = -1)

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

22 {
24 include_once './Modules/TestQuestionPool/classes/class.assLongMenu.php';
25 $this->object = new assLongMenu();
26 if ($id >= 0) {
27 $this->object->loadFromDb($id);
28 }
29 global $DIC;
30 $rbacsystem = $DIC['rbacsystem'];
31 $ilTabs = $DIC['ilTabs'];
32 $lng = $DIC['lng'];
33 $this->rbacsystem = $rbacsystem;
34 $this->ilTabs = $ilTabs;
35 $this->lng = $lng;
36 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$DIC
Definition: xapitoken.php:46

References $DIC, $ilTabs, $lng, $rbacsystem, and ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Member Function Documentation

◆ buildEditForm()

assLongMenuGUI::buildEditForm ( )
protected
Returns
ilPropertyFormGUI

Reimplemented from assQuestionGUI.

Definition at line 119 of file class.assLongMenuGUI.php.

120 {
121 $form = $this->buildBasicEditFormObject();
122
123 $this->addQuestionFormCommandButtons($form);
124
125 $this->addBasicQuestionFormProperties($form);
126
128 $this->populateAnswerSpecificFormPart($form);
129
130 $this->populateTaxonomyFormSection($form);
131
132 return $form;
133 }
populateQuestionSpecificFormPart(ilPropertyFormGUI $form)
populateAnswerSpecificFormPart(ilPropertyFormGUI $form)
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,...

References assQuestionGUI\addBasicQuestionFormProperties(), assQuestionGUI\addQuestionFormCommandButtons(), assQuestionGUI\buildBasicEditFormObject(), populateAnswerSpecificFormPart(), populateQuestionSpecificFormPart(), and assQuestionGUI\populateTaxonomyFormSection().

Referenced by editQuestion(), and writePostData().

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

◆ editQuestion()

assLongMenuGUI::editQuestion ( ilPropertyFormGUI  $form = null)
protected

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

106 {
107 if ($form === null) {
108 $form = $this->buildEditForm();
109 }
110
111 $this->getQuestionTemplate();
112 $this->tpl->addCss('Modules/Test/templates/default/ta.css');
113
114 $this->tpl->setVariable("QUESTION_DATA", $this->ctrl->getHTML($form));
115 }
getQuestionTemplate()
get question template

References buildEditForm(), and assQuestionGUI\getQuestionTemplate().

Referenced by writePostData().

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

◆ getAfterParticipationSuppressionQuestionPostVars()

assLongMenuGUI::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 516 of file class.assLongMenuGUI.php.

517 {
518 return array();
519 }

◆ getAggregatedAnswersView()

assLongMenuGUI::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 529 of file class.assLongMenuGUI.php.

530 {
531 $overview = array();
532 $aggregation = array();
533 foreach ($relevant_answers as $answer) {
534 $overview[$answer['active_fi']][$answer['pass']][$answer['value1']] = $answer['value2'];
535 }
536
537 foreach ($overview as $active) {
538 foreach ($active as $answer) {
539 foreach ($answer as $option => $value) {
540 $aggregation[$option][$value] = $aggregation[$option][$value] + 1;
541 }
542 }
543 }
544 $tpl = new ilTemplate('tpl.il_as_aggregated_long_menu_answers_table.html', true, true, "Modules/TestQuestionPool");
545 $json = json_decode($this->object->getJsonStructure());
546 foreach ($json as $key => $value) {
547 $tpl->setVariable('TITLE', 'Longmenu ' . ($key + 1));
548 if (array_key_exists($key, $aggregation)) {
549 $aggregate = $aggregation[$key];
550 foreach ($aggregate as $answer => $counts) {
551 $tpl->setVariable('OPTION', $answer);
552 $tpl->setVariable('COUNT', $counts);
553 $tpl->parseCurrentBlock();
554 }
555 }
556 }
557
558 return $tpl->get();
559 }
special template class to simplify handling of ITX/PEAR

References assQuestionGUI\$tpl.

◆ getAnswerFrequencyTableGUI()

assLongMenuGUI::getAnswerFrequencyTableGUI (   $parentGui,
  $parentCmd,
  $relevantAnswers,
  $questionIndex 
)
Parameters
$parentGui
$parentCmd
$relevantAnswers
$questionIndex
Returns
ilAnswerFrequencyStatisticTableGUI

Reimplemented from assQuestionGUI.

Definition at line 682 of file class.assLongMenuGUI.php.

683 {
684 global $DIC; /* @var ILIAS\DI\Container $DIC */
685
686 $table = parent::getAnswerFrequencyTableGUI(
687 $parentGui,
688 $parentCmd,
689 $relevantAnswers,
690 $questionIndex
691 );
692
693 $table->setTitle(sprintf(
694 $DIC->language()->txt('tst_corrections_answers_tbl_subindex'),
695 $DIC->language()->txt('longmenu') . ' ' . ($questionIndex + 1)
696 ));
697
698 return $table;
699 }

References $DIC.

◆ getAnswersFrequency()

assLongMenuGUI::getAnswersFrequency (   $relevant_answers,
  $questionIndex 
)

Reimplemented from assQuestionGUI.

Definition at line 659 of file class.assLongMenuGUI.php.

660 {
661 $answers = array();
662
663 foreach ($relevant_answers as $row) {
664 if ($row['value1'] != $questionIndex) {
665 continue;
666 }
667
668 if (!isset($answers[$row['value2']])) {
669 //$label = $this->getAnswerTextLabel($row['value1'], $row['value2']);
670
671 $answers[$row['value2']] = array(
672 'answer' => $row['value2'], 'frequency' => 0
673 );
674 }
675
676 $answers[$row['value2']]['frequency']++;
677 }
678
679 return $answers;
680 }

◆ getCommand()

assLongMenuGUI::getCommand (   $cmd)

Reimplemented from assQuestionGUI.

Definition at line 65 of file class.assLongMenuGUI.php.

66 {
67 return $cmd;
68 }

◆ getLongMenuTextWithInputFieldsInsteadOfGaps()

assLongMenuGUI::getLongMenuTextWithInputFieldsInsteadOfGaps (   $user_solution = array(),
  $solution = false,
  $graphical = false 
)

Definition at line 561 of file class.assLongMenuGUI.php.

562 {
563 $return_value = '';
564 $text_array = preg_split("/\\[" . assLongMenu::GAP_PLACEHOLDER . " (\\d+)\\]/", $this->object->getLongMenuTextValue());
565 $correct_answers = $this->object->getCorrectAnswers();
566 $answers = $this->object->getAnswers();
567 foreach ($text_array as $key => $value) {
568 $answer_is_correct = false;
569 $user_value = '';
570 $return_value .= $value;
571 if ($key < sizeof($text_array) - 1) {
572 if ($correct_answers[$key][2] == assLongMenu::ANSWER_TYPE_TEXT_VAL) {
573 if (array_key_exists($key, $user_solution)) {
574 $user_value = $user_solution[$key];
575 if (in_array($user_value, $correct_answers[$key][0])) {
576 $answer_is_correct = true;
577 }
578 }
579
580 $return_value .= $this->getTextGapTemplate($key, $user_value, $solution, $answer_is_correct, $graphical);
581 } elseif ($correct_answers[$key][2] == assLongMenu::ANSWER_TYPE_SELECT_VAL) {
582 if (array_key_exists($key, $user_solution)) {
583 $user_value = $user_solution[$key];
584 if (in_array($user_value, $correct_answers[$key][0])) {
585 $answer_is_correct = true;
586 }
587 }
588 $return_value .= $this->getSelectGapTemplate($key, $answers[$key], $user_value, $solution, $answer_is_correct, $graphical);
589 }
590 }
591 }
592 return $return_value;
593 }
getSelectGapTemplate($key, $answers, $user_value, $solution, $ok=false, $graphical=false)
getTextGapTemplate($key, $value, $solution, $ok=false, $graphical=false)
const ANSWER_TYPE_TEXT_VAL
const ANSWER_TYPE_SELECT_VAL

References assLongMenu\ANSWER_TYPE_SELECT_VAL, assLongMenu\ANSWER_TYPE_TEXT_VAL, assLongMenu\GAP_PLACEHOLDER, getSelectGapTemplate(), and getTextGapTemplate().

Referenced by getPreview(), getSolutionOutput(), and getTestOutput().

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

◆ getPreview()

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

Reimplemented from assQuestionGUI.

Definition at line 336 of file class.assLongMenuGUI.php.

337 {
338 $user_solution = is_object($this->getPreviewSession()) ? (array) $this->getPreviewSession()->getParticipantsSolution() : array();
339 $user_solution = array_values($user_solution);
340
341 include_once "./Services/UICore/classes/class.ilTemplate.php";
342 $template = new ilTemplate("tpl.il_as_qpl_longmenu_output.html", true, true, "Modules/TestQuestionPool");
343
344 $question_text = $this->object->getQuestion();
345 $template->setVariable("QUESTIONTEXT", $this->object->prepareTextareaOutput($question_text, true));
346 $template->setVariable("ANSWER_OPTIONS_JSON", json_encode($this->object->getAvailableAnswerOptions()));
347 $template->setVariable('AUTOCOMPLETE_LENGTH', $this->object->getMinAutoComplete());
348 $template->setVariable('LONGMENU_TEXT', $this->getLongMenuTextWithInputFieldsInsteadOfGaps($user_solution));
349
350 $question_output = $template->get();
351 if (!$show_question_only) {
352 $question_output = $this->getILIASPage($question_output);
353 }
354 return $question_output;
355 }
getLongMenuTextWithInputFieldsInsteadOfGaps($user_solution=array(), $solution=false, $graphical=false)
getILIASPage($html="")
Returns the ILIAS Page around a question.

References assQuestionGUI\getILIASPage(), getLongMenuTextWithInputFieldsInsteadOfGaps(), and assQuestionGUI\getPreviewSession().

+ Here is the call graph for this function:

◆ getSelectGapTemplate()

assLongMenuGUI::getSelectGapTemplate (   $key,
  $answers,
  $user_value,
  $solution,
  $ok = false,
  $graphical = false 
)
private

Definition at line 617 of file class.assLongMenuGUI.php.

618 {
619 $tpl = new ilTemplate("tpl.il_as_qpl_long_menu_select_gap.html", true, true, "Modules/TestQuestionPool");
620 $tpl->setVariable('KEY', $key);
621 if ($solution) {
622 $tpl->setVariable('DISABLED', 'disabled');
623 $tpl->setVariable('JS_IGNORE', '_ignore');
624 $tpl->setCurrentBlock('best_solution');
625 if ($user_value == -1) {
626 $tpl->setVariable("SOLUTION", $this->lng->txt("please_select"));
627 } else {
628 $tpl->setVariable('SOLUTION', $user_value);
629 }
630 if ($graphical) {
631 if ($ok) {
632 $tpl->setVariable("ICON_OK", ilUtil::getImagePath("icon_ok.svg"));
633 $tpl->setVariable("TEXT_OK", $this->lng->txt("answer_is_right"));
634 } else {
635 $tpl->setVariable("ICON_OK", ilUtil::getImagePath("icon_not_ok.svg"));
636 $tpl->setVariable("TEXT_OK", $this->lng->txt("answer_is_wrong"));
637 }
638 }
639 $tpl->parseCurrentBlock();
640 } else {
641 $tpl->setVariable("PLEASE_SELECT", $this->lng->txt("please_select"));
642 foreach ($answers as $value) {
643 $tpl->setCurrentBlock('select_option');
644 $tpl->setVariable('VALUE', $value);
645 if ($value == $user_value) {
646 $tpl->setVariable('SELECTED', 'selected');
647 }
648 $tpl->parseCurrentBlock();
649 }
650 }
651 return $tpl->get();
652 }
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)

References $ok, assQuestionGUI\$tpl, and ilUtil\getImagePath().

Referenced by getLongMenuTextWithInputFieldsInsteadOfGaps().

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

◆ getSolutionOutput()

assLongMenuGUI::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 279 of file class.assLongMenuGUI.php.

289 {
290 include_once "./Services/UICore/classes/class.ilTemplate.php";
291 $template = new ilTemplate("tpl.il_as_qpl_lome_question_output_solution.html", true, true, "Modules/TestQuestionPool");
292
293 if ($show_question_text) {
294 $question_text = $this->object->getQuestion();
295 $template->setVariable("QUESTIONTEXT", $this->object->prepareTextareaOutput($question_text, true));
296 }
297 if (($active_id > 0) && (!$show_correct_solution)) {
298 $correct_solution = $this->getUserSolution($active_id, $pass);
299 } else {
300 $correct_solution = $this->object->getCorrectAnswersForQuestionSolution($this->object->getId());
301 }
302 $template->setVariable('LONGMENU_TEXT_SOLUTION', $this->getLongMenuTextWithInputFieldsInsteadOfGaps($correct_solution, true, $graphicalOutput));
303 $solution_template = new ilTemplate("tpl.il_as_tst_solution_output.html", true, true, "Modules/TestQuestionPool");
304 $question_output = $template->get();
305 $feedback = '';
306 if ($show_feedback) {
307 if (!$this->isTestPresentationContext()) {
308 $fb = $this->getGenericFeedbackOutput($active_id, $pass);
309 $feedback .= strlen($fb) ? $fb : '';
310 }
311
312 $fb = $this->getSpecificFeedbackOutput(array());
313 $feedback .= strlen($fb) ? $fb : '';
314 }
315 if (strlen($feedback)) {
316 $cssClass = (
317 $this->hasCorrectSolution($active_id, $pass) ?
319 );
320
321 $solution_template->setVariable("ILC_FB_CSS_CLASS", $cssClass);
322 $solution_template->setVariable("FEEDBACK", $this->object->prepareTextareaOutput($feedback, true));
323 }
324
325 $solution_template->setVariable("SOLUTION_OUTPUT", $question_output);
326
327 $solution_output = $solution_template->get();
328
329 if (!$show_question_only) {
330 $solution_output = $this->getILIASPage($solution_output);
331 }
332
333 return $solution_output;
334 }
getUserSolution($active_id, $pass)
getSpecificFeedbackOutput($userSolution)
Returns the answer specific feedback for the question.
hasCorrectSolution($activeId, $passIndex)
getGenericFeedbackOutput($active_id, $pass)
Returns the answer specific feedback for the question.

References $pass, ilAssQuestionFeedback\CSS_CLASS_FEEDBACK_CORRECT, ilAssQuestionFeedback\CSS_CLASS_FEEDBACK_WRONG, assQuestionGUI\getGenericFeedbackOutput(), assQuestionGUI\getILIASPage(), getLongMenuTextWithInputFieldsInsteadOfGaps(), getSpecificFeedbackOutput(), getUserSolution(), assQuestionGUI\hasCorrectSolution(), and assQuestionGUI\isTestPresentationContext().

+ Here is the call graph for this function:

◆ getSpecificFeedbackOutput()

assLongMenuGUI::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 481 of file class.assLongMenuGUI.php.

482 {
483 if (!$this->object->feedbackOBJ->getSpecificAnswerFeedbackTestPresentation($this->object->getId(), 0, 0)) {
484 return '';
485 }
486
487 $feedback = '<table class="test_specific_feedback"><tbody>';
488 $gaps = $this->object->getCorrectAnswers();
489 foreach ($gaps as $index => $answer) {
490 $caption = assLongMenu::GAP_PLACEHOLDER . ' ';
491 $caption .= $index + 1 . ': ';
492
493 $feedback .= '<tr><td>';
494
495 $feedback .= $caption . '</td><td>';
496 $feedback .= $this->object->feedbackOBJ->getSpecificAnswerFeedbackTestPresentation(
497 $this->object->getId(),
498 0,
499 $index
500 ) . '</td> </tr>';
501 }
502 $feedback .= '</tbody></table>';
503 return $this->object->prepareTextareaOutput($feedback, true);
504 }
$index
Definition: metadata.php:128

References $index, and assLongMenu\GAP_PLACEHOLDER.

Referenced by getSolutionOutput().

+ Here is the caller graph for this function:

◆ getSubQuestionsIndex()

assLongMenuGUI::getSubQuestionsIndex ( )

Reimplemented from assQuestionGUI.

Definition at line 654 of file class.assLongMenuGUI.php.

655 {
656 return array_keys($this->object->getAnswers());
657 }

◆ getTestOutput()

assLongMenuGUI::getTestOutput (   $active_id,
  $pass,
  $is_postponed = false,
  $use_post_solutions = false,
  $show_feedback = false 
)

Reimplemented from assQuestionGUI.

Definition at line 359 of file class.assLongMenuGUI.php.

367 {
368 $user_solution = array();
369 if ($active_id) {
370 $solutions = null;
371 include_once "./Modules/Test/classes/class.ilObjTest.php";
372 if (!ilObjTest::_getUsePreviousAnswers($active_id, true)) {
373 if (is_null($pass)) {
374 $pass = ilObjTest::_getPass($active_id);
375 }
376 }
377 $solutions = $this->object->getUserSolutionPreferingIntermediate($active_id, $pass);
378 foreach ($solutions as $idx => $solution_value) {
379 $user_solution[$solution_value["value1"]] = $solution_value["value2"];
380 }
381 }
382
383 // generate the question output
384 include_once "./Services/UICore/classes/class.ilTemplate.php";
385 $template = new ilTemplate("tpl.il_as_qpl_longmenu_output.html", true, true, "Modules/TestQuestionPool");
386
387 $question_text = $this->object->getQuestion();
388 $template->setVariable("QUESTIONTEXT", $this->object->prepareTextareaOutput($question_text, true));
389 $template->setVariable("ANSWER_OPTIONS_JSON", json_encode($this->object->getAvailableAnswerOptions()));
390 $template->setVariable('LONGMENU_TEXT', $this->getLongMenuTextWithInputFieldsInsteadOfGaps($user_solution));
391 $template->setVariable('AUTOCOMPLETE_LENGTH', $this->object->getMinAutoComplete());
392 $question_output = $template->get();
393 $page_output = $this->outQuestionPage("", $is_postponed, $active_id, $question_output);
394 return $page_output;
395 }
outQuestionPage($a_temp_var, $a_postponed=false, $active_id="", $html="", $inlineFeedbackEnabled=false)
output question page
static _getUsePreviousAnswers($active_id, $user_active_user_setting=false)
Returns if the previous results should be hidden for a learner.
static _getPass($active_id)
Retrieves the actual pass of a given user for a given test.

References $pass, ilObjTest\_getPass(), ilObjTest\_getUsePreviousAnswers(), getLongMenuTextWithInputFieldsInsteadOfGaps(), and assQuestionGUI\outQuestionPage().

+ Here is the call graph for this function:

◆ getTextGapTemplate()

assLongMenuGUI::getTextGapTemplate (   $key,
  $value,
  $solution,
  $ok = false,
  $graphical = false 
)
private

Definition at line 595 of file class.assLongMenuGUI.php.

596 {
597 $tpl = new ilTemplate("tpl.il_as_qpl_long_menu_text_gap.html", true, true, "Modules/TestQuestionPool");
598 if ($solution) {
599 $tpl->setVariable('DISABLED', 'disabled');
600 $tpl->setVariable('JS_IGNORE', '_ignore');
601 if ($graphical) {
602 if ($ok) {
603 $tpl->setVariable("ICON_OK", ilUtil::getImagePath("icon_ok.svg"));
604 $tpl->setVariable("TEXT_OK", $this->lng->txt("answer_is_right"));
605 } else {
606 $tpl->setVariable("ICON_OK", ilUtil::getImagePath("icon_not_ok.svg"));
607 $tpl->setVariable("TEXT_OK", $this->lng->txt("answer_is_wrong"));
608 }
609 }
610 }
611 $tpl->setVariable('VALUE', $value);
612 $tpl->setVariable('KEY', $key);
613
614 return $tpl->get();
615 }

References $ok, assQuestionGUI\$tpl, and ilUtil\getImagePath().

Referenced by getLongMenuTextWithInputFieldsInsteadOfGaps().

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

◆ getUserSolution()

assLongMenuGUI::getUserSolution (   $active_id,
  $pass 
)
protected
Parameters
$active_id
$pass
Returns
array

Definition at line 43 of file class.assLongMenuGUI.php.

44 {
45 $user_solution = array();
46 if ($active_id) {
47 // hey: prevPassSolutions - obsolete due to central check
48 #$solutions = NULL;
49 #include_once "./Modules/Test/classes/class.ilObjTest.php";
50 #if (!ilObjTest::_getUsePreviousAnswers($active_id, true))
51 #{
52 # if (is_null($pass)) $pass = ilObjTest::_getPass($active_id);
53 #}
54 $solutions = $this->object->getSolutionValues($active_id, $pass, !$this->getUseIntermediateSolution());
55 //$solutions = $this->object->getTestOutputSolutions($active_id, $pass);
56 // hey.
57 foreach ($solutions as $idx => $solution_value) {
58 $user_solution[$solution_value["value1"]] = $solution_value["value2"];
59 }
60 return $user_solution;
61 }
62 return $user_solution;
63 }
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:

◆ populateAnswerSpecificFormPart()

assLongMenuGUI::populateAnswerSpecificFormPart ( ilPropertyFormGUI  $form)
Parameters
ilPropertyFormGUI$form
Returns
ilPropertyFormGUI

Definition at line 251 of file class.assLongMenuGUI.php.

252 {
253 return $form;
254 }

Referenced by buildEditForm().

+ Here is the caller graph for this function:

◆ populateCorrectionsFormProperties()

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

Reimplemented from assQuestionGUI.

Definition at line 701 of file class.assLongMenuGUI.php.

702 {
703 $correctAnswers = $this->object->getCorrectAnswers();
704
705 foreach ($this->object->getAnswers() as $lmIndex => $lm) {
706 $lmValues = array(
707 'answers_all' => array(0 => $lm),
708 'answers_all_count' => count($lm),
709 'answers_correct' => $correctAnswers[$lmIndex][0]
710 );
711
712 $lmPoints = $correctAnswers[$lmIndex][1];
713
715 $section->setTitle($this->lng->txt('longmenu') . ' ' . ($lmIndex + 1));
716 $form->addItem($section);
717
719 $this->lng->txt('answers'),
720 'longmenu_' . $lmIndex
721 );
722
723 $lmInput->setRequired(true);
724
725 $lmInput->setValues($lmValues);
726
727 $form->addItem($lmInput);
728
729 $pointsInp = new ilNumberInputGUI($this->lng->txt("points"), 'points_' . $lmIndex);
730 $pointsInp->setRequired(true);
731 $pointsInp->allowDecimals(true);
732 $pointsInp->setSize(4);
733 $pointsInp->setMinValue(0);
734 $pointsInp->setMinvalueShouldBeGreater(false);
735 $pointsInp->setValue($lmPoints);
736 $form->addItem($pointsInp);
737 }
738 }
$section
Definition: Utf8Test.php:83
This class represents a section header in a property form.
This class represents a number property in a property form.
addItem($a_item)
Add Item (Property, SectionHeader).

References $section, and ilPropertyFormGUI\addItem().

+ Here is the call graph for this function:

◆ populateQuestionSpecificFormPart()

assLongMenuGUI::populateQuestionSpecificFormPart ( ilPropertyFormGUI  $form)
Parameters
ilPropertyFormGUI$form
Returns
ilPropertyFormGUI

Implements ilGuiQuestionScoringAdjustable.

Definition at line 138 of file class.assLongMenuGUI.php.

139 {
140 $long_menu_text = new ilTextAreaInputGUI($this->lng->txt("longmenu_text"), 'longmenu_text');
141 $long_menu_text->setRequired(true);
142 //$long_menu_text->setInfo($this->lng->txt("longmenu_hint"));
143 $long_menu_text->setRows(10);
144 $long_menu_text->setCols(80);
145 if (!$this->object->getSelfAssessmentEditingMode()) {
146 if ($this->object->getAdditionalContentEditingMode() == assQuestion::ADDITIONAL_CONTENT_EDITING_MODE_DEFAULT) {
147 include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
148 $long_menu_text->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("assessment"));
149 $long_menu_text->addPlugin("latex");
150 $long_menu_text->addButton("latex");
151 $long_menu_text->addButton("pastelatex");
152 $long_menu_text->setRTESupport($this->object->getId(), "qpl", "assessment");
153 $long_menu_text->setUseRte(true);
154 }
155 } else {
156 require_once 'Modules/TestQuestionPool/classes/questions/class.ilAssSelfAssessmentQuestionFormatter.php';
158 $long_menu_text->setUseTagsForRteOnly(false);
159 }
160
161 $long_menu_text->setValue($this->object->prepareTextareaOutput($this->object->getLongMenuTextValue()));
162 $form->addItem($long_menu_text);
163
164 $tpl = new ilTemplate("tpl.il_as_qpl_long_menu_gap_button_code.html", true, true, "Modules/TestQuestionPool");
165 $tpl->setVariable('INSERT_GAP', $this->lng->txt('insert_gap'));
166 $tpl->parseCurrentBlock();
167 $button = new ilCustomInputGUI('&nbsp;', '');
168 $button->setHtml($tpl->get());
169 $form->addItem($button);
170
171 require_once("./Services/UIComponent/Modal/classes/class.ilModalGUI.php");
172 $modal = ilModalGUI::getInstance();
173 $modal->setHeading('');
174 $modal->setId("ilGapModal");
175 //$modal->setBackdrop(ilModalGUI::BACKDROP_OFF);
176 $modal->setBody('');
177
178 $min_auto_complete = new ilNumberInputGUI($this->lng->txt("min_auto_complete"), 'min_auto_complete');
179
180 $auto_complete = $this->object->getMinAutoComplete();
181 if ($auto_complete == 0) {
183 }
184 $min_auto_complete->setValue($auto_complete);
185 $min_auto_complete->setMinValue(1);
186 $min_auto_complete->setMaxValue(99);
187 $min_auto_complete->setSize(5);
188 $form->addItem($min_auto_complete);
189 // identical scoring
190 $identical_scoring = new ilCheckboxInputGUI($this->lng->txt("identical_scoring"), "identical_scoring");
191 $identical_scoring->setValue(1);
192 $identical_scoring->setChecked($this->object->getIdenticalScoring());
193 $identical_scoring->setInfo($this->lng->txt('identical_scoring_desc'));
194 $identical_scoring->setRequired(false);
195 $form->addItem($identical_scoring);
196 $hidden_text = new ilHiddenInputGUI('hidden_text_files');
197 $form->addItem($hidden_text);
198
199 $hidden_correct = new ilHiddenInputGUI('hidden_correct_answers');
200 $form->addItem($hidden_correct);
201
202 $tpl = new ilTemplate("tpl.il_as_qpl_long_menu_gap.html", true, true, "Modules/TestQuestionPool");
203 if (is_array($_POST) && array_key_exists('hidden_text_files', $_POST)) {
204 $tpl->setVariable('CORRECT_ANSWERS', $_POST['hidden_correct_answers']);
205 $tpl->setVariable('ALL_ANSWERS', $_POST['hidden_text_files']);
206 } else {
207 $tpl->setVariable('CORRECT_ANSWERS', $this->object->getJsonStructure());
208 $tpl->setVariable('ALL_ANSWERS', $this->object->getAnswersObject());
209 }
210 $tpl->setVariable('MAX_INPUT_FIELDS', assLongMenu::MAX_INPUT_FIELDS);
211 $tpl->setVariable('GAP_PLACEHOLDER', assLongMenu::GAP_PLACEHOLDER);
212 $tpl->setVariable('SELECT_BOX', $this->lng->txt('insert_gap'));
213 $tpl->setVariable("SELECT", $this->lng->txt('answers_select'));
214 $tpl->setVariable("TEXT", $this->lng->txt('answers_text_box'));
215 $tpl->setVariable("POINTS", $this->lng->txt('points'));
216 $tpl->setVariable("INFO_TEXT_UPLOAD", $this->lng->txt('info_text_upload'));
217 $tpl->setVariable("TXT_BROWSE", $this->lng->txt('select_file'));
218 $tpl->setVariable("MANUAL_EDITING", $this->lng->txt('manual_editing'));
219 $tpl->setVariable("CORRECT_ANSWER_TXT", $this->lng->txt('correct_answers'));
220 $tpl->setVariable("ANSWER_OPTIONS_TXT", $this->lng->txt('answer_options'));
221 $tpl->setVariable("ANSWERS_TXT", $this->lng->txt('answers'));
222 $tpl->setVariable("TYPE_TXT", $this->lng->txt('type'));
223 $tpl->setVariable("EDIT_TXT", $this->lng->txt('edit'));
224 $tpl->setVariable("ADD_ANSWER_TXT", $this->lng->txt('add_answers'));
225 $tpl->setVariable('POINTS_ERROR', $this->lng->txt('enter_enough_positive_points'));
226 $tpl->setVariable('AUTOCOMPLETE_ERROR', $this->lng->txt('autocomplete_error'));
227 $tpl->setVariable('MISSING_VALUE', $this->lng->txt('msg_input_is_required'));
228 $tpl->setVariable('SAVE', $this->lng->txt('save'));
229 $tpl->setVariable('CANCEL', $this->lng->txt('cancel'));
230 require_once("Services/Form/classes/class.ilTagInputGUI.php");
231 $tag_input = new ilTagInputGUI();
232 $tag_input->setTypeAhead(true);
233 $tag_input->setPostVar('taggable');
234 $tag_input->setJsSelfInit(false);
235 $tag_input->setTypeAheadMinLength(1);
236 $tpl->setVariable("TAGGING_PROTOTYPE", $tag_input->render(''));
237
238 $tpl->setVariable("MY_MODAL", $modal->getHTML());
239
240 $tpl->parseCurrentBlock();
241 $button = new ilCustomInputGUI('&nbsp;', '');
242 $button->setHtml($tpl->get());
243 $form->addItem($button);
244 return $form;
245 }
$_POST["username"]
const MIN_LENGTH_AUTOCOMPLETE
const ADDITIONAL_CONTENT_EDITING_MODE_DEFAULT
constant for additional content editing mode "default"
static getSelfAssessmentTags()
Get tags allowed in question tags in self assessment mode.
This class represents a checkbox property in a property form.
This class represents a custom property in a property form.
This class represents a hidden form property in a property form.
static getInstance()
Get instance.
static _getUsedHTMLTags($a_module="")
Returns an array of all allowed HTML tags for text editing.
This class represents a tag list property in a property form.
This class represents a text area property in a property form.

References $_POST, assQuestionGUI\$tpl, ilObjAdvancedEditing\_getUsedHTMLTags(), ilPropertyFormGUI\addItem(), assQuestion\ADDITIONAL_CONTENT_EDITING_MODE_DEFAULT, assLongMenu\GAP_PLACEHOLDER, ilModalGUI\getInstance(), ilAssSelfAssessmentQuestionFormatter\getSelfAssessmentTags(), assLongMenu\MAX_INPUT_FIELDS, and assLongMenu\MIN_LENGTH_AUTOCOMPLETE.

Referenced by buildEditForm().

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

◆ saveCorrectionsFormProperties()

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

Reimplemented from assQuestionGUI.

Definition at line 743 of file class.assLongMenuGUI.php.

744 {
745 $correctAnswers = $this->object->getCorrectAnswers();
746
747 foreach ($this->object->getAnswers() as $lmIndex => $lm) {
748 $pointsInput = (float) $form->getInput('points_' . $lmIndex);
749 $correctAnswersInput = (array) $form->getInput('longmenu_' . $lmIndex . '_tags');
750
751 foreach ($correctAnswersInput as $idx => $answer) {
752 if (in_array($answer, $lm)) {
753 continue;
754 }
755
756 unset($correctAnswersInput[$idx]);
757 }
758
759 $correctAnswersInput = array_values($correctAnswersInput);
760
761 $correctAnswers[$lmIndex][0] = $correctAnswersInput;
762 $correctAnswers[$lmIndex][1] = $pointsInput;
763 }
764
765 $this->object->setCorrectAnswers($correctAnswers);
766 }
getInput($a_post_var, $ensureValidation=true)
Returns the value of a HTTP-POST variable, identified by the passed id.

References ilPropertyFormGUI\getInput().

+ Here is the call graph for this function:

◆ setQuestionTabs()

assLongMenuGUI::setQuestionTabs ( )

Sets the ILIAS tabs for this question type.

@access public

Reimplemented from assQuestionGUI.

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

404 {
405 $this->ilTabs->clearTargets();
406
407 $this->ctrl->setParameterByClass("ilAssQuestionPageGUI", "q_id", $_GET["q_id"]);
408 include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
409 $q_type = $this->object->getQuestionType();
410
411 if (strlen($q_type)) {
412 $classname = $q_type . "GUI";
413 $this->ctrl->setParameterByClass(strtolower($classname), "sel_question_types", $q_type);
414 $this->ctrl->setParameterByClass(strtolower($classname), "q_id", $_GET["q_id"]);
415 }
416
417 if ($_GET["q_id"]) {
418 if ($this->rbacsystem->checkAccess('write', $_GET["ref_id"])) {
419 // edit page
420 $this->ilTabs->addTarget(
421 "edit_page",
422 $this->ctrl->getLinkTargetByClass("ilAssQuestionPageGUI", "edit"),
423 array("edit", "insert", "exec_pg"),
424 "",
425 "",
426 $force_active
427 );
428 }
429
430 $this->addTab_QuestionPreview($this->ilTabs);
431 }
432
433 $force_active = false;
434 if ($this->rbacsystem->checkAccess('write', $_GET["ref_id"])) {
435 $url = "";
436 if ($classname) {
437 $url = $this->ctrl->getLinkTargetByClass($classname, "editQuestion");
438 }
439 $commands = $_POST["cmd"];
440 if (is_array($commands)) {
441 foreach ($commands as $key => $value) {
442 if (preg_match("/^delete_.*/", $key, $matches)) {
443 $force_active = true;
444 }
445 }
446 }
447 // edit question properties
448 $this->ilTabs->addTarget(
449 "edit_question",
450 $url,
451 array("editQuestion", "save", "saveEdit", "addkvp", "removekvp", "originalSyncForm"),
452 $classname,
453 "",
454 $force_active
455 );
456 }
457
458 // add tab for question feedback within common class assQuestionGUI
459 $this->addTab_QuestionFeedback($this->ilTabs);
460
461 // add tab for question hint within common class assQuestionGUI
462 $this->addTab_QuestionHints($this->ilTabs);
463
464 // add tab for question's suggested solution within common class assQuestionGUI
465 $this->addTab_SuggestedSolution($this->ilTabs, $classname);
466
467 // Assessment of questions sub menu entry
468 if ($_GET["q_id"]) {
469 $this->ilTabs->addTarget(
470 "statistics",
471 $this->ctrl->getLinkTargetByClass($classname, "assessment"),
472 array("assessment"),
473 $classname,
474 ""
475 );
476 }
477
478 $this->addBackTab($this->ilTabs);
479 }
$_GET["client_id"]
addTab_QuestionHints(ilTabsGUI $tabs)
adds the hints tab to ilTabsGUI
addTab_SuggestedSolution(ilTabsGUI $tabs, $classname)
addBackTab(ilTabsGUI $ilTabs)
addTab_QuestionFeedback(ilTabsGUI $tabs)
adds the feedback tab to ilTabsGUI
addTab_QuestionPreview(ilTabsGUI $tabsGUI)
$url

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

+ Here is the call graph for this function:

◆ supportsIntermediateSolutionOutput()

assLongMenuGUI::supportsIntermediateSolutionOutput ( )

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

Returns
bool

Reimplemented from assQuestionGUI.

Definition at line 261 of file class.assLongMenuGUI.php.

262 {
263 return true;
264 }

◆ writePostData()

assLongMenuGUI::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 73 of file class.assLongMenuGUI.php.

74 {
75 $form = $this->buildEditForm();
76 $form->setValuesByPost();
77 $check = $form->checkInput();
80 $custom_check = $this->object->checkQuestionCustomPart($form);
81 if (!$check || !$custom_check) {
82 if (!$custom_check) {
83 ilUtil::sendFailure($this->lng->txt("form_input_not_valid"));
84 }
85 $this->editQuestion($form);
86 return 1;
87 }
89 return 0;
90 }
editQuestion(ilPropertyFormGUI $form=null)
writeQuestionSpecificPostData(ilPropertyFormGUI $form)
Extracts the question specific values from $_POST and applies them to the data object.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.

References buildEditForm(), editQuestion(), assQuestionGUI\saveTaxonomyAssignments(), ilUtil\sendFailure(), assQuestionGUI\writeQuestionGenericPostData(), and writeQuestionSpecificPostData().

+ Here is the call graph for this function:

◆ writeQuestionSpecificPostData()

assLongMenuGUI::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 92 of file class.assLongMenuGUI.php.

93 {
94 $this->object->setLongMenuTextValue(ilUtil::stripSlashesRecursive($_POST['longmenu_text']));
95 $this->object->setAnswers(json_decode(ilUtil::stripSlashesRecursive($_POST['hidden_text_files'])));
96 $this->object->setCorrectAnswers(json_decode(ilUtil::stripSlashesRecursive($_POST['hidden_correct_answers'])));
97 $this->object->setAnswerType(ilUtil::stripSlashesRecursive($_POST['long_menu_type']));
98 $this->object->setQuestion($_POST['question']);
99 $this->object->setLongMenuTextValue($_POST["longmenu_text"]);
100 $this->object->setMinAutoComplete((int) $_POST["min_auto_complete"]);
101 $this->object->setIdenticalScoring((int) $_POST["identical_scoring"]);
103 }
static stripSlashesRecursive($a_data, $a_strip_html=true, $a_allow="")
Strip slashes from array and sub-arrays.

References $_POST, assQuestionGUI\saveTaxonomyAssignments(), and ilUtil\stripSlashesRecursive().

Referenced by writePostData().

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

Field Documentation

◆ $ilTabs

assLongMenuGUI::$ilTabs
private

Definition at line 18 of file class.assLongMenuGUI.php.

Referenced by __construct().

◆ $lng

assLongMenuGUI::$lng

Definition at line 19 of file class.assLongMenuGUI.php.

Referenced by __construct().

◆ $rbacsystem

assLongMenuGUI::$rbacsystem
private

Definition at line 17 of file class.assLongMenuGUI.php.

Referenced by __construct().


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