ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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)
 
 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 (ilTemplate $tpl)
 
 getQuestionTemplate ()
 get question template More...
 
 getILIASPage ($html="")
 Returns the ILIAS Page around a question. More...
 
 outQuestionPage ($a_temp_var, $a_postponed=false, $active_id="", $html="", $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)
 

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)
 {} 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.

References $DIC, $id, $ilTabs, $lng, and $rbacsystem.

22  {
23  parent::__construct();
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  }
global $DIC
Definition: saml.php:7
if(!array_key_exists('StateId', $_REQUEST)) $id

Member Function Documentation

◆ buildEditForm()

assLongMenuGUI::buildEditForm ( )
protected
Returns
ilPropertyFormGUI

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

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

Referenced by editQuestion(), and writePostData().

119  {
120  $form = $this->buildBasicEditFormObject();
121 
123 
125 
128 
130 
131  return $form;
132  }
addBasicQuestionFormProperties($form)
Add basic question form properties: assessment: title, author, description, question, working time.
populateTaxonomyFormSection(ilPropertyFormGUI $form)
if(isset($_POST['submit'])) $form
populateQuestionSpecificFormPart(ilPropertyFormGUI $form)
populateAnswerSpecificFormPart(ilPropertyFormGUI $form)
addQuestionFormCommandButtons($form)
Add the command buttons of a question properties form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editQuestion()

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

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

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

Referenced by writePostData().

105  {
106  if ($form === null) {
107  $form = $this->buildEditForm();
108  }
109 
110  $this->getQuestionTemplate();
111  $this->tpl->addCss('Modules/Test/templates/default/ta.css');
112 
113  $this->tpl->setVariable("QUESTION_DATA", $this->ctrl->getHTML($form));
114  }
getQuestionTemplate()
get question template
+ 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 515 of file class.assLongMenuGUI.php.

516  {
517  return array();
518  }

◆ 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 528 of file class.assLongMenuGUI.php.

References $key, and assQuestionGUI\$tpl.

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

◆ getAnswerFrequencyTableGUI()

assLongMenuGUI::getAnswerFrequencyTableGUI (   $parentGui,
  $parentCmd,
  $relevantAnswers,
  $questionIndex 
)

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

References $DIC, and $table.

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

◆ getAnswersFrequency()

assLongMenuGUI::getAnswersFrequency (   $relevant_answers,
  $questionIndex 
)

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

References $row.

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

◆ getCommand()

assLongMenuGUI::getCommand (   $cmd)

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

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

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

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

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

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

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

◆ getSelectGapTemplate()

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

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

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

Referenced by getLongMenuTextWithInputFieldsInsteadOfGaps().

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

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

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

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

◆ getSpecificFeedbackOutput()

assLongMenuGUI::getSpecificFeedbackOutput (   $userSolution)

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

References $index, and assLongMenu\GAP_PLACEHOLDER.

Referenced by getSolutionOutput().

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

◆ getSubQuestionsIndex()

assLongMenuGUI::getSubQuestionsIndex ( )

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

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

◆ getTestOutput()

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

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

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

366  {
367  $user_solution = array();
368  if ($active_id) {
369  $solutions = null;
370  include_once "./Modules/Test/classes/class.ilObjTest.php";
371  if (!ilObjTest::_getUsePreviousAnswers($active_id, true)) {
372  if (is_null($pass)) {
373  $pass = ilObjTest::_getPass($active_id);
374  }
375  }
376  $solutions = $this->object->getUserSolutionPreferingIntermediate($active_id, $pass);
377  foreach ($solutions as $idx => $solution_value) {
378  $user_solution[$solution_value["value1"]] = $solution_value["value2"];
379  }
380  }
381 
382  // generate the question output
383  include_once "./Services/UICore/classes/class.ilTemplate.php";
384  $template = new ilTemplate("tpl.il_as_qpl_longmenu_output.html", true, true, "Modules/TestQuestionPool");
385 
386  $question_text = $this->object->getQuestion();
387  $template->setVariable("QUESTIONTEXT", $this->object->prepareTextareaOutput($question_text, true));
388  $template->setVariable("ANSWER_OPTIONS_JSON", json_encode($this->object->getAvailableAnswerOptions()));
389  $template->setVariable('LONGMENU_TEXT', $this->getLongMenuTextWithInputFieldsInsteadOfGaps($user_solution));
390  $template->setVariable('AUTOCOMPLETE_LENGTH', $this->object->getMinAutoComplete());
391  $question_output = $template->get();
392  $page_output = $this->outQuestionPage("", $is_postponed, $active_id, $question_output);
393  return $page_output;
394  }
static _getPass($active_id)
Retrieves the actual pass of a given user for a given test.
$template
getLongMenuTextWithInputFieldsInsteadOfGaps($user_solution=array(), $solution=false, $graphical=false)
special template class to simplify handling of ITX/PEAR
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.
+ Here is the call graph for this function:

◆ getTextGapTemplate()

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

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

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

Referenced by getLongMenuTextWithInputFieldsInsteadOfGaps().

595  {
596  $tpl = new ilTemplate("tpl.il_as_qpl_long_menu_text_gap.html", true, true, "Modules/TestQuestionPool");
597  if ($solution) {
598  $tpl->setVariable('DISABLED', 'disabled');
599  $tpl->setVariable('JS_IGNORE', '_ignore');
600  if ($graphical) {
601  if ($ok) {
602  $tpl->setVariable("ICON_OK", ilUtil::getImagePath("icon_ok.svg"));
603  $tpl->setVariable("TEXT_OK", $this->lng->txt("answer_is_right"));
604  } else {
605  $tpl->setVariable("ICON_OK", ilUtil::getImagePath("icon_not_ok.svg"));
606  $tpl->setVariable("TEXT_OK", $this->lng->txt("answer_is_wrong"));
607  }
608  }
609  }
610  $tpl->setVariable('VALUE', $value);
611  $tpl->setVariable('KEY', $key);
612 
613  return $tpl->get();
614  }
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
special template class to simplify handling of ITX/PEAR
$key
Definition: croninfo.php:18
+ 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.

References $pass, and assQuestionGUI\getUseIntermediateSolution().

Referenced by getSolutionOutput().

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.
+ 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 250 of file class.assLongMenuGUI.php.

References $form.

Referenced by buildEditForm().

251  {
252  return $form;
253  }
if(isset($_POST['submit'])) $form
+ Here is the caller graph for this function:

◆ populateCorrectionsFormProperties()

assLongMenuGUI::populateCorrectionsFormProperties ( ilPropertyFormGUI  $form)

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

References $section, ilPropertyFormGUI\addItem(), and ilFormPropertyGUI\setRequired().

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

◆ populateQuestionSpecificFormPart()

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

Implements ilGuiQuestionScoringAdjustable.

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

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

Referenced by buildEditForm().

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

◆ saveCorrectionsFormProperties()

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

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

References ilPropertyFormGUI\getInput().

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

◆ setQuestionTabs()

assLongMenuGUI::setQuestionTabs ( )

Sets the ILIAS tabs for this question type.

public

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

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

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

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

261  {
262  return true;
263  }

◆ writePostData()

assLongMenuGUI::writePostData (   $always = false)
protected

{}

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

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

74  {
75  $form = $this->buildEditForm();
76  $form->setValuesByPost();
79  $custom_check = $this->object->checkQuestionCustomPart($form);
80  if (!$form->checkInput() || !$custom_check) {
81  if (!$custom_check) {
82  ilUtil::sendFailure($this->lng->txt("form_input_not_valid"));
83  }
84  $this->editQuestion($form);
85  return 1;
86  }
87  $this->saveTaxonomyAssignments();
88  return 0;
89  }
editQuestion(ilPropertyFormGUI $form=null)
if(isset($_POST['submit'])) $form
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
writeQuestionSpecificPostData(ilPropertyFormGUI $form)
Extracts the question specific values from $_POST and applies them to the data object.
+ Here is the call graph for this function:

◆ writeQuestionSpecificPostData()

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

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

Referenced by writePostData().

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