ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.assLongMenuGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 require_once './Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
5 require_once './Modules/TestQuestionPool/interfaces/interface.ilGuiQuestionScoringAdjustable.php';
6 include_once './Modules/Test/classes/inc.AssessmentConstants.php';
7 
16 {
17  private $rbacsystem;
18  private $ilTabs;
19  public $lng;
20 
21  public function __construct($id = -1)
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 $rbacsystem, $ilTabs, $lng;
30  $this->rbacsystem = $rbacsystem;
31  $this->ilTabs = $ilTabs;
32  $this->lng = $lng;
33  }
34 
40  protected function getUserSolution($active_id, $pass)
41  {
42  $user_solution = array();
43  if ($active_id) {
44  // hey: prevPassSolutions - obsolete due to central check
45  #$solutions = NULL;
46  #include_once "./Modules/Test/classes/class.ilObjTest.php";
47  #if (!ilObjTest::_getUsePreviousAnswers($active_id, true))
48  #{
49  # if (is_null($pass)) $pass = ilObjTest::_getPass($active_id);
50  #}
51  $solutions = $this->object->getTestOutputSolutions($active_id, $pass);
52  // hey.
53  foreach ($solutions as $idx => $solution_value) {
54  $user_solution[$solution_value["value1"]] = $solution_value["value2"];
55  }
56  return $user_solution;
57  }
58  return $user_solution;
59  }
60 
61  public function getCommand($cmd)
62  {
63  return $cmd;
64  }
65 
69  protected function writePostData($always = false)
70  {
71  $form = $this->buildEditForm();
72  $form->setValuesByPost();
75  $custom_check = $this->object->checkQuestionCustomPart();
76  if (!$form->checkInput() || !$custom_check) {
77  if (!$custom_check) {
78  ilUtil::sendFailure($this->lng->txt("form_input_not_valid"));
79  }
80  $this->editQuestion($form);
81  return 1;
82  }
83  $this->saveTaxonomyAssignments();
84  return 0;
85  }
86 
88  {
89  $this->object->setLongMenuTextValue(ilUtil::stripSlashesRecursive($_POST['longmenu_text']));
90  $this->object->setAnswers(json_decode(ilUtil::stripSlashesRecursive($_POST['hidden_text_files'])));
91  $this->object->setCorrectAnswers(json_decode(ilUtil::stripSlashesRecursive($_POST['hidden_correct_answers'])));
92  $this->object->setAnswerType(ilUtil::stripSlashesRecursive($_POST['long_menu_type']));
93  $this->object->setQuestion($_POST['question']);
94  $this->object->setLongMenuTextValue($_POST["longmenu_text"]);
95  $this->object->setMinAutoComplete((int) $_POST["min_auto_complete"]);
96  $this->saveTaxonomyAssignments();
97  }
98 
99  protected function editQuestion(ilPropertyFormGUI $form = null)
100  {
101  if ($form === null) {
102  $form = $this->buildEditForm();
103  }
104 
105  $this->getQuestionTemplate();
106  $this->tpl->addCss('Modules/Test/templates/default/ta.css');
107 
108  $this->tpl->setVariable("QUESTION_DATA", $this->ctrl->getHTML($form));
109  }
113  protected function buildEditForm()
114  {
115  $form = $this->buildBasicEditFormObject();
116 
118 
120 
123 
125 
126  return $form;
127  }
133  {
134  $long_menu_text = new ilTextAreaInputGUI($this->lng->txt("longmenu_text"), 'longmenu_text');
135  $long_menu_text->setRequired(true);
136  //$long_menu_text->setInfo($this->lng->txt("longmenu_hint"));
137  $long_menu_text->setRows(10);
138  $long_menu_text->setCols(80);
139  if (!$this->object->getSelfAssessmentEditingMode()) {
140  if ($this->object->getAdditionalContentEditingMode() == assQuestion::ADDITIONAL_CONTENT_EDITING_MODE_DEFAULT) {
141  include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
142  $long_menu_text->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("assessment"));
143  $long_menu_text->addPlugin("latex");
144  $long_menu_text->addButton("latex");
145  $long_menu_text->addButton("pastelatex");
146  $long_menu_text->setRTESupport($this->object->getId(), "qpl", "assessment");
147  $long_menu_text->setUseRte(true);
148  }
149  } else {
150  require_once 'Modules/TestQuestionPool/classes/questions/class.ilAssSelfAssessmentQuestionFormatter.php';
152  $long_menu_text->setUseTagsForRteOnly(false);
153  }
154 
155  $long_menu_text->setValue($this->object->prepareTextareaOutput($this->object->getLongMenuTextValue()));
156  $form->addItem($long_menu_text);
157 
158  $tpl = new ilTemplate("tpl.il_as_qpl_long_menu_gap_button_code.html", true, true, "Modules/TestQuestionPool");
159  $tpl->setVariable('INSERT_GAP', $this->lng->txt('insert_gap'));
160  $tpl->parseCurrentBlock();
161  $button = new ilCustomInputGUI('&nbsp;', '');
162  $button->setHtml($tpl->get());
163  $form->addItem($button);
164 
165  require_once("./Services/UIComponent/Modal/classes/class.ilModalGUI.php");
166  $modal = ilModalGUI::getInstance();
167  $modal->setHeading('');
168  $modal->setId("ilGapModal");
169  //$modal->setBackdrop(ilModalGUI::BACKDROP_OFF);
170  $modal->setBody('');
171 
172  $min_auto_complete = new ilNumberInputGUI($this->lng->txt("min_auto_complete"), 'min_auto_complete');
173 
174  $auto_complete = $this->object->getMinAutoComplete();
175  if ($auto_complete == 0) {
176  $auto_complete = assLongMenu::MIN_LENGTH_AUTOCOMPLETE;
177  }
178  $min_auto_complete->setValue($auto_complete);
179  $min_auto_complete->setMinValue(1);
180  $min_auto_complete->setMaxValue(99);
181  $min_auto_complete->setSize(5);
182  $form->addItem($min_auto_complete);
183 
184  $hidden_text = new ilHiddenInputGUI('hidden_text_files');
185  $form->addItem($hidden_text);
186 
187  $hidden_correct = new ilHiddenInputGUI('hidden_correct_answers');
188  $form->addItem($hidden_correct);
189 
190  $tpl = new ilTemplate("tpl.il_as_qpl_long_menu_gap.html", true, true, "Modules/TestQuestionPool");
191  if (is_array($_POST) && array_key_exists('hidden_text_files', $_POST)) {
192  $tpl->setVariable('CORRECT_ANSWERS', $_POST['hidden_correct_answers']);
193  $tpl->setVariable('ALL_ANSWERS', $_POST['hidden_text_files']);
194  } else {
195  $tpl->setVariable('CORRECT_ANSWERS', $this->object->getJsonStructure());
196  $tpl->setVariable('ALL_ANSWERS', $this->object->getAnswersObject());
197  }
198  $tpl->setVariable('MAX_INPUT_FIELDS', assLongMenu::MAX_INPUT_FIELDS);
199  $tpl->setVariable('GAP_PLACEHOLDER', assLongMenu::GAP_PLACEHOLDER);
200  $tpl->setVariable('SELECT_BOX', $this->lng->txt('insert_gap'));
201  $tpl->setVariable("SELECT", $this->lng->txt('answers_select'));
202  $tpl->setVariable("TEXT", $this->lng->txt('answers_text_box'));
203  $tpl->setVariable("POINTS", $this->lng->txt('points'));
204  $tpl->setVariable("INFO_TEXT_UPLOAD", $this->lng->txt('info_text_upload'));
205  $tpl->setVariable("TXT_BROWSE", $this->lng->txt('select_file'));
206  $tpl->setVariable("MANUAL_EDITING", $this->lng->txt('manual_editing'));
207  $tpl->setVariable("CORRECT_ANSWER_TXT", $this->lng->txt('correct_answers'));
208  $tpl->setVariable("ANSWER_OPTIONS_TXT", $this->lng->txt('answer_options'));
209  $tpl->setVariable("ANSWERS_TXT", $this->lng->txt('answers'));
210  $tpl->setVariable("TYPE_TXT", $this->lng->txt('type'));
211  $tpl->setVariable("EDIT_TXT", $this->lng->txt('edit'));
212  $tpl->setVariable("ADD_ANSWER_TXT", $this->lng->txt('add_answers'));
213  $tpl->setVariable('POINTS_ERROR', $this->lng->txt('enter_enough_positive_points'));
214  $tpl->setVariable('AUTOCOMPLETE_ERROR', $this->lng->txt('autocomplete_error'));
215  $tpl->setVariable('MISSING_VALUE', $this->lng->txt('msg_input_is_required'));
216  $tpl->setVariable('SAVE', $this->lng->txt('save'));
217  $tpl->setVariable('CANCEL', $this->lng->txt('cancel'));
218  require_once("Services/Form/classes/class.ilTagInputGUI.php");
219  $tag_input = new ilTagInputGUI();
220  $tag_input->setTypeAhead(true);
221  $tag_input->setPostVar('taggable');
222  $tag_input->setJsSelfInit(false);
223  $tag_input->setTypeAheadMinLength(1);
224  $tpl->setVariable("TAGGING_PROTOTYPE", $tag_input->render(''));
225 
226  $tpl->setVariable("MY_MODAL", $modal->getHTML());
227 
228  $tpl->parseCurrentBlock();
229  $button = new ilCustomInputGUI('&nbsp;', '');
230  $button->setHtml($tpl->get());
231  $form->addItem($button);
232  return $form;
233  }
234 
240  {
241  return $form;
242  }
243 
257  public function getSolutionOutput(
258  $active_id,
259  $pass = null,
260  $graphicalOutput = false,
261  $result_output = false,
262  $show_question_only = true,
263  $show_feedback = false,
264  $show_correct_solution = false,
265  $show_manual_scoring = false,
266  $show_question_text = true
267  ) {
268  include_once "./Services/UICore/classes/class.ilTemplate.php";
269  $template = new ilTemplate("tpl.il_as_qpl_lome_question_output_solution.html", true, true, "Modules/TestQuestionPool");
270 
271  if ($show_question_text) {
272  $question_text = $this->object->getQuestion();
273  $template->setVariable("QUESTIONTEXT", $this->object->prepareTextareaOutput($question_text, true));
274  }
275  if (($active_id > 0) && (!$show_correct_solution)) {
276  $correct_solution = $this->getUserSolution($active_id, $pass);
277  } else {
278  $correct_solution = $this->object->getCorrectAnswersForQuestionSolution($this->object->getId());
279  }
280  $template->setVariable('LONGMENU_TEXT_SOLUTION', $this->getLongMenuTextWithInputFieldsInsteadOfGaps($correct_solution, true, $graphicalOutput));
281  $solution_template = new ilTemplate("tpl.il_as_tst_solution_output.html", true, true, "Modules/TestQuestionPool");
282  $question_output = $template->get();
283  $feedback = '';
284  if ($show_feedback) {
285  if (!$this->isTestPresentationContext()) {
286  $fb = $this->getGenericFeedbackOutput($active_id, $pass);
287  $feedback .= strlen($fb) ? $fb : '';
288  }
289 
290  $fb = $this->getSpecificFeedbackOutput($active_id, $pass);
291  $feedback .= strlen($fb) ? $fb : '';
292  }
293  if (strlen($feedback)) {
294  $cssClass = (
295  $this->hasCorrectSolution($active_id, $pass) ?
297  );
298 
299  $solution_template->setVariable("ILC_FB_CSS_CLASS", $cssClass);
300  $solution_template->setVariable("FEEDBACK", $this->object->prepareTextareaOutput($feedback, true));
301  }
302 
303  $solution_template->setVariable("SOLUTION_OUTPUT", $question_output);
304 
305  $solution_output = $solution_template->get();
306 
307  if (!$show_question_only) {
308  $solution_output = $this->getILIASPage($solution_output);
309  }
310 
311  return $solution_output;
312  }
313 
314  public function getPreview($show_question_only = false, $showInlineFeedback = false)
315  {
316  $user_solution = is_object($this->getPreviewSession()) ? (array) $this->getPreviewSession()->getParticipantsSolution() : array();
317  $user_solution = array_values($user_solution);
318 
319  include_once "./Services/UICore/classes/class.ilTemplate.php";
320  $template = new ilTemplate("tpl.il_as_qpl_longmenu_output.html", true, true, "Modules/TestQuestionPool");
321 
322  $question_text = $this->object->getQuestion();
323  $template->setVariable("QUESTIONTEXT", $this->object->prepareTextareaOutput($question_text, true));
324  $template->setVariable("ANSWER_OPTIONS_JSON", json_encode($this->object->getAvailableAnswerOptions()));
325  $template->setVariable('AUTOCOMPLETE_LENGTH', $this->object->getMinAutoComplete());
326  $template->setVariable('LONGMENU_TEXT', $this->getLongMenuTextWithInputFieldsInsteadOfGaps($user_solution));
327 
328  $question_output = $template->get();
329  if (!$show_question_only) {
330  $question_output = $this->getILIASPage($question_output);
331  }
332  return $question_output;
333  }
334 
335 
336 
337  public function getTestOutput(
338  $active_id,
339  // hey: prevPassSolutions - will be always available from now on
340  $pass,
341  // hey.
342  $is_postponed = false,
343  $use_post_solutions = false,
344  $show_feedback = false
345  ) {
346  $user_solution = array();
347  if ($active_id) {
348  $solutions = null;
349  include_once "./Modules/Test/classes/class.ilObjTest.php";
350  if (!ilObjTest::_getUsePreviousAnswers($active_id, true)) {
351  if (is_null($pass)) {
352  $pass = ilObjTest::_getPass($active_id);
353  }
354  }
355  $solutions = $this->object->getUserSolutionPreferingIntermediate($active_id, $pass);
356  foreach ($solutions as $idx => $solution_value) {
357  $user_solution[$solution_value["value1"]] = $solution_value["value2"];
358  }
359  }
360 
361  // generate the question output
362  include_once "./Services/UICore/classes/class.ilTemplate.php";
363  $template = new ilTemplate("tpl.il_as_qpl_longmenu_output.html", true, true, "Modules/TestQuestionPool");
364 
365  $question_text = $this->object->getQuestion();
366  $template->setVariable("QUESTIONTEXT", $this->object->prepareTextareaOutput($question_text, true));
367  $template->setVariable("ANSWER_OPTIONS_JSON", json_encode($this->object->getAvailableAnswerOptions()));
368  $template->setVariable('LONGMENU_TEXT', $this->getLongMenuTextWithInputFieldsInsteadOfGaps($user_solution));
369  $template->setVariable('AUTOCOMPLETE_LENGTH', $this->object->getMinAutoComplete());
370  $question_output = $template->get();
371  $page_output = $this->outQuestionPage("", $is_postponed, $active_id, $question_output);
372  return $page_output;
373  }
374 
381  public function setQuestionTabs()
382  {
383  $this->ilTabs->clearTargets();
384 
385  $this->ctrl->setParameterByClass("ilAssQuestionPageGUI", "q_id", $_GET["q_id"]);
386  include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
387  $q_type = $this->object->getQuestionType();
388 
389  if (strlen($q_type)) {
390  $classname = $q_type . "GUI";
391  $this->ctrl->setParameterByClass(strtolower($classname), "sel_question_types", $q_type);
392  $this->ctrl->setParameterByClass(strtolower($classname), "q_id", $_GET["q_id"]);
393  }
394 
395  if ($_GET["q_id"]) {
396  if ($this->rbacsystem->checkAccess('write', $_GET["ref_id"])) {
397  // edit page
398  $this->ilTabs->addTarget(
399  "edit_page",
400  $this->ctrl->getLinkTargetByClass("ilAssQuestionPageGUI", "edit"),
401  array("edit", "insert", "exec_pg"),
402  "",
403  "",
404  $force_active
405  );
406  }
407 
408  $this->addTab_QuestionPreview($this->ilTabs);
409  }
410 
411  $force_active = false;
412  if ($this->rbacsystem->checkAccess('write', $_GET["ref_id"])) {
413  $url = "";
414  if ($classname) {
415  $url = $this->ctrl->getLinkTargetByClass($classname, "editQuestion");
416  }
417  $commands = $_POST["cmd"];
418  if (is_array($commands)) {
419  foreach ($commands as $key => $value) {
420  if (preg_match("/^delete_.*/", $key, $matches)) {
421  $force_active = true;
422  }
423  }
424  }
425  // edit question properties
426  $this->ilTabs->addTarget(
427  "edit_question",
428  $url,
429  array("editQuestion", "save", "saveEdit", "addkvp", "removekvp", "originalSyncForm"),
430  $classname,
431  "",
432  $force_active
433  );
434  }
435 
436  // add tab for question feedback within common class assQuestionGUI
437  $this->addTab_QuestionFeedback($this->ilTabs);
438 
439  // add tab for question hint within common class assQuestionGUI
440  $this->addTab_QuestionHints($this->ilTabs);
441 
442  // add tab for question's suggested solution within common class assQuestionGUI
443  $this->addTab_SuggestedSolution($this->ilTabs, $classname);
444 
445  // Assessment of questions sub menu entry
446  if ($_GET["q_id"]) {
447  $this->ilTabs->addTarget(
448  "statistics",
449  $this->ctrl->getLinkTargetByClass($classname, "assessment"),
450  array("assessment"),
451  $classname,
452  ""
453  );
454  }
455 
456  $this->addBackTab($this->ilTabs);
457  }
458 
459  public function getSpecificFeedbackOutput($active_id, $pass)
460  {
461  if (!$this->object->feedbackOBJ->getSpecificAnswerFeedbackTestPresentation($this->object->getId(), 0)) {
462  return '';
463  }
464 
465  $feedback = '<table class="test_specific_feedback"><tbody>';
466  $gaps = $this->object->getCorrectAnswers();
467  foreach ($gaps as $index => $answer) {
468  $caption = assLongMenu::GAP_PLACEHOLDER . ' ';
469  $caption .= $index + 1 . ': ';
470 
471  $feedback .= '<tr><td>';
472 
473  $feedback .= $caption . '</td><td>';
474  $feedback .= $this->object->feedbackOBJ->getSpecificAnswerFeedbackTestPresentation(
475  $this->object->getId(),
476  $index
477  ) . '</td> </tr>';
478  }
479  $feedback .= '</tbody></table>';
480  return $this->object->prepareTextareaOutput($feedback, true);
481  }
482 
483 
494  {
495  return array();
496  }
497 
506  public function getAggregatedAnswersView($relevant_answers)
507  {
508  $overview = array();
509  $aggregation = array();
510  foreach ($relevant_answers as $answer) {
511  $overview[$answer['active_fi']][$answer['pass']][$answer['value1']] = $answer['value2'];
512  }
513 
514  foreach ($overview as $active) {
515  foreach ($active as $answer) {
516  foreach ($answer as $option => $value) {
517  $aggregation[$option][$value] = $aggregation[$option][$value] + 1;
518  }
519  }
520  }
521  $tpl = new ilTemplate('tpl.il_as_aggregated_long_menu_answers_table.html', true, true, "Modules/TestQuestionPool");
522  $json = json_decode($this->object->getJsonStructure());
523  foreach ($json as $key => $value) {
524  $tpl->setVariable('TITLE', 'Longmenu ' . ($key+1));
525  if (array_key_exists($key, $aggregation)) {
526  $aggregate = $aggregation[$key];
527  foreach ($aggregate as $answer => $counts) {
528  $tpl->setVariable('OPTION', $answer);
529  $tpl->setVariable('COUNT', $counts);
530  $tpl->parseCurrentBlock();
531  }
532  }
533  }
534 
535  return $tpl->get();
536  }
537 
538  public function getLongMenuTextWithInputFieldsInsteadOfGaps($user_solution = array(), $solution = false, $graphical = false)
539  {
540  $return_value = '';
541  $text_array = preg_split("/\\[" . assLongMenu::GAP_PLACEHOLDER . " (\\d+)\\]/", $this->object->getLongMenuTextValue());
542  $correct_answers = $this->object->getCorrectAnswers();
543  $answers = $this->object->getAnswers();
544  foreach ($text_array as $key => $value) {
545  $answer_is_correct = false;
546  $user_value = '';
547  $return_value .= $value;
548  if ($key < sizeof($text_array) - 1) {
549  if ($correct_answers[$key][2] == assLongMenu::ANSWER_TYPE_TEXT_VAL) {
550  if (array_key_exists($key, $user_solution)) {
551  $user_value = $user_solution[$key];
552  if (in_array($user_value, $correct_answers[$key][0])) {
553  $answer_is_correct = true;
554  }
555  }
556 
557  $return_value .= $this->getTextGapTemplate($key, $user_value, $solution, $answer_is_correct, $graphical);
558  } elseif ($correct_answers[$key][2] == assLongMenu::ANSWER_TYPE_SELECT_VAL) {
559  if (array_key_exists($key, $user_solution)) {
560  $user_value = $user_solution[$key];
561  if (in_array($user_value, $correct_answers[$key][0])) {
562  $answer_is_correct = true;
563  }
564  }
565  $return_value .= $this->getSelectGapTemplate($key, $answers[$key], $user_value, $solution, $answer_is_correct, $graphical);
566  }
567  }
568  }
569  return $return_value;
570  }
571 
572  private function getTextGapTemplate($key, $value, $solution, $ok = false, $graphical = false)
573  {
574  $tpl = new ilTemplate("tpl.il_as_qpl_long_menu_text_gap.html", true, true, "Modules/TestQuestionPool");
575  if ($solution) {
576  $tpl->setVariable('DISABLED', 'disabled');
577  $tpl->setVariable('JS_IGNORE', '_ignore');
578  if ($graphical) {
579  if ($ok) {
580  $tpl->setVariable("ICON_OK", ilUtil::getImagePath("icon_ok.svg"));
581  $tpl->setVariable("TEXT_OK", $this->lng->txt("answer_is_right"));
582  } else {
583  $tpl->setVariable("ICON_OK", ilUtil::getImagePath("icon_not_ok.svg"));
584  $tpl->setVariable("TEXT_OK", $this->lng->txt("answer_is_wrong"));
585  }
586  }
587  }
588  $tpl->setVariable('VALUE', $value);
589  $tpl->setVariable('KEY', $key);
590 
591  return $tpl->get();
592  }
593 
594  private function getSelectGapTemplate($key, $answers, $user_value, $solution, $ok = false, $graphical = false)
595  {
596  $tpl = new ilTemplate("tpl.il_as_qpl_long_menu_select_gap.html", true, true, "Modules/TestQuestionPool");
597  $tpl->setVariable('KEY', $key);
598  if ($solution) {
599  $tpl->setVariable('DISABLED', 'disabled');
600  $tpl->setVariable('JS_IGNORE', '_ignore');
601  $tpl->setCurrentBlock('best_solution');
602  if ($user_value == -1) {
603  $tpl->setVariable("SOLUTION", $this->lng->txt("please_select"));
604  } else {
605  $tpl->setVariable('SOLUTION', $user_value);
606  }
607  if ($graphical) {
608  if ($ok) {
609  $tpl->setVariable("ICON_OK", ilUtil::getImagePath("icon_ok.svg"));
610  $tpl->setVariable("TEXT_OK", $this->lng->txt("answer_is_right"));
611  } else {
612  $tpl->setVariable("ICON_OK", ilUtil::getImagePath("icon_not_ok.svg"));
613  $tpl->setVariable("TEXT_OK", $this->lng->txt("answer_is_wrong"));
614  }
615  }
616  $tpl->parseCurrentBlock();
617  } else {
618  $tpl->setVariable("PLEASE_SELECT", $this->lng->txt("please_select"));
619  foreach ($answers as $value) {
620  $tpl->setCurrentBlock('select_option');
621  $tpl->setVariable('VALUE', $value);
622  if ($value == $user_value) {
623  $tpl->setVariable('SELECTED', 'selected');
624  }
625  $tpl->parseCurrentBlock();
626  }
627  }
628  return $tpl->get();
629  }
630 }
static getSelfAssessmentTags()
Get tags allowed in question tags in self assessment mode.
hasCorrectSolution($activeId, $passIndex)
addTab_QuestionPreview(ilTabsGUI $tabsGUI)
This class represents a tag list property in a property form.
addBasicQuestionFormProperties($form)
Add basic question form properties: assessment: title, author, description, question, working time.
static _getPass($active_id)
Retrieves the actual pass of a given user for a given test.
getSelectGapTemplate($key, $answers, $user_value, $solution, $ok=false, $graphical=false)
addTab_QuestionHints(ilTabsGUI $tabs)
adds the hints tab to ilTabsGUI
$template
This class represents a property form user interface.
getUserSolution($active_id, $pass)
$_GET["client_id"]
static _getUsedHTMLTags($a_module="")
Returns an array of all allowed HTML tags for text editing.
if(!array_key_exists('StateId', $_REQUEST)) $id
getLongMenuTextWithInputFieldsInsteadOfGaps($user_solution=array(), $solution=false, $graphical=false)
addItem($a_item)
Add Item (Property, SectionHeader).
writePostData($always=false)
{}
$index
Definition: metadata.php:60
getQuestionTemplate()
get question template
populateTaxonomyFormSection(ilPropertyFormGUI $form)
getAggregatedAnswersView($relevant_answers)
Returns an html string containing a question specific representation of the answers so far given in t...
editQuestion(ilPropertyFormGUI $form=null)
const MIN_LENGTH_AUTOCOMPLETE
This class represents a hidden form property in a property form.
const ANSWER_TYPE_TEXT_VAL
if(isset($_POST['submit'])) $form
getILIASPage($html="")
Returns the ILIAS Page around a question.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
This class represents a number property in a property form.
special template class to simplify handling of ITX/PEAR
static stripSlashesRecursive($a_data, $a_strip_html=true, $a_allow="")
Strip slashes from array and sub-arrays.
getTestOutput( $active_id, $pass, $is_postponed=false, $use_post_solutions=false, $show_feedback=false)
addTab_QuestionFeedback(ilTabsGUI $tabs)
adds the feedback tab to ilTabsGUI
setQuestionTabs()
Sets the ILIAS tabs for this question type.
Basic GUI class for assessment questions.
Create styles array
The data for the language used.
populateQuestionSpecificFormPart(ilPropertyFormGUI $form)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
getSpecificFeedbackOutput($active_id, $pass)
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.
getTextGapTemplate($key, $value, $solution, $ok=false, $graphical=false)
Create new PHPExcel object
obj_idprivate
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.
This class represents a text area property in a property form.
addBackTab(ilTabsGUI $ilTabs)
outQuestionPage($a_temp_var, $a_postponed=false, $active_id="", $html="")
output question page
$url
writeQuestionSpecificPostData(ilPropertyFormGUI $form)
Extracts the question specific values from $_POST and applies them to the data object.
getGenericFeedbackOutput($active_id, $pass)
Returns the answer specific feedback for the question.
Interface ilGuiQuestionScoringAdjustable.
static _getUsePreviousAnswers($active_id, $user_active_user_setting=false)
Returns if the previous results should be hidden for a learner.
populateAnswerSpecificFormPart(ilPropertyFormGUI $form)
const ANSWER_TYPE_SELECT_VAL
$key
Definition: croninfo.php:18
getAfterParticipationSuppressionQuestionPostVars()
Returns a list of postvars which will be suppressed in the form output when used in scoring adjustmen...
$_POST["username"]
getPreview($show_question_only=false, $showInlineFeedback=false)
setRequired($a_required)
Set Required.
addTab_SuggestedSolution(ilTabsGUI $tabs, $classname)
addQuestionFormCommandButtons($form)
Add the command buttons of a question properties form.