ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.assOrderingQuestionGUI.php
Go to the documentation of this file.
1<?php
2
35{
36 public const CMD_EDIT_NESTING = 'editNesting';
37 public const CMD_SAVE_NESTING = 'saveNesting';
38 public const CMD_SWITCH_TO_TERMS = 'changeToText';
39 public const CMD_SWITCH_TO_PICTURESS = 'changeToPictures';
40
41 public const TAB_EDIT_QUESTION = 'edit_question';
42 public const TAB_EDIT_NESTING = 'edit_nesting';
43
44 public const F_USE_NESTED = 'nested_answers';
45 public const F_NESTED_ORDER = 'order_elems';
46 public const F_NESTED_ORDER_ORDER = 'content';
47 public const F_NESTED_ORDER_INDENT = 'indentation';
49
51
53 public $leveled_ordering = [];
54
62 public function __construct($id = -1)
63 {
65 $this->object = new assOrderingQuestion();
66 if ($id >= 0) {
67 $this->object->loadFromDb($id);
68 }
69 }
70
71 public function changeToPictures(): void
72 {
73 $this->object->setContentType($this->object::OQ_CT_PICTURES);
74 $this->object->saveToDb();
75
76 $values = $this->request_data_collector->getParsedBody();
77 $values['thumb_geometry'] = $this->object->getThumbSize();
78 $this->buildEditFormAfterTypeChange($values);
79 }
80
81 public function changeToText(): void
82 {
83 $ordering_element_list = $this->object->getOrderingElementList();
84 foreach ($ordering_element_list as $element) {
85 $this->object->dropImageFile($element->getContent());
86 }
87
88 $this->object->setContentType($this->object::OQ_CT_TERMS);
89 $this->object->saveToDb();
90
91 $this->buildEditFormAfterTypeChange($this->request_data_collector->getParsedBody());
92 }
93
94 private function buildEditFormAfterTypeChange(array $values): void
95 {
96 $form = $this->buildEditForm();
97
98 $ordering_element_list = $this->object->getOrderingElementList();
99 $ordering_element_list->resetElements();
100
102 $form->setValuesByArray($values);
103 $form->getItemByPostVar(assOrderingQuestion::ORDERING_ELEMENT_FORM_FIELD_POSTVAR)->setElementList($ordering_element_list);
104 $this->renderEditForm($form);
105 $this->addEditSubtabs();
106 }
107
108 public function saveNesting()
109 {
110 $form = $this->buildNestingForm();
111 $form->setValuesByPost();
112 if ($form->checkInput()) {
113 $post = $this->request_data_collector->raw(self::F_NESTED_ORDER);
114 $list = $this->object->getOrderingElementList();
115
116 $ordered = [];
117 foreach (array_keys($post[self::F_NESTED_ORDER_ORDER]) as $idx => $identifier) {
118 $element_identifier = str_replace(self::F_NESTED_IDENTIFIER_PREFIX, '', $identifier);
119 $element = $list->getElementByRandomIdentifier($element_identifier);
120
121 $ordered[] = $element
122 ->withPosition($idx)
123 ->withIndentation($post[self::F_NESTED_ORDER_INDENT][$identifier]);
124 }
125
126 $list = $list->withElements($ordered);
127 $this->object->setOrderingElementList($list);
128 $this->tpl->setOnScreenMessage('success', $this->lng->txt('saved_successfully'), true);
129 } else {
130 $this->tpl->setOnScreenMessage('error', $this->lng->txt('form_input_not_valid'), true);
131 }
132
133 $this->editNesting();
134 }
135
136
137 public function removeElementImage()
138 {
139 $this->uploadElementImage();
140 }
141
142 public function uploadElementImage(): void
143 {
144 $form = $this->buildEditForm();
145 $form->setValuesByPost();
146
147 $submitted_list = $this->fetchSolutionListFromSubmittedForm($form);
148
149 $elements = [];
150 foreach ($submitted_list->getElements() as $submitted_element) {
151 if ($submitted_element->isImageUploadAvailable()) {
152 $filename = $this->object->storeImageFile(
153 $submitted_element->getUploadImageFile(),
154 $submitted_element->getUploadImageName()
155 );
156
157 if (is_null($filename)) {
158 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('file_no_valid_file_type'));
159 } else {
160 $submitted_element = $submitted_element->withContent($filename);
161 }
162 }
163
164 if ($submitted_element->isImageRemovalRequest()) {
165 $this->object->dropImageFile($submitted_element->getContent());
166 $submitted_element = $submitted_element->withContent('');
167 }
168
169 $elements[] = $submitted_element;
170 }
171
172 $list = $this->object->getOrderingElementList()->withElements($elements);
173 $this->object->setOrderingElementList($list);
174
176 $this->writeQuestionSpecificPostData($form);
177
178 $this->editQuestion();
179 }
180
182 {
183 $thumb_size = $this->request_data_collector->int('thumb_geometry');
184 if ($thumb_size !== 0
185 && $thumb_size !== $this->object->getThumbSize()) {
186 $this->object->setThumbSize($thumb_size);
187 $this->updateImageFiles();
188 }
189
190 $this->object->setPoints($this->request_data_collector->float('points'));
191
192 $use_nested = $this->request_data_collector->int(self::F_USE_NESTED) === 1;
193 $this->object->setNestingType($use_nested);
194 }
195
196
198 {
200 ->getElementList($this->object->getId());
201
202 $use_nested = $this->request_data_collector->int(self::F_USE_NESTED) === 1;
203
204 if ($use_nested) {
205 $existing_list = $this->object->getOrderingElementList();
206
207 $nu = [];
208 $parent_indent = -1;
209 foreach ($list->getElements() as $element) {
210 $element = $list->ensureValidIdentifiers($element);
211
212 if ($existing = $existing_list->getElementByRandomIdentifier($element->getRandomIdentifier())) {
213 if ($existing->getIndentation() == $parent_indent + 1) {
214 $element = $element
215 ->withIndentation($existing->getIndentation());
216 }
217 }
218 $parent_indent = $element->getIndentation();
219 $nu[] = $element;
220 }
221 $list = $list->withElements($nu);
222 }
223
224 return $list;
225 }
226
227 protected function updateImageFiles(): void
228 {
229 $element_list = $this->object->getOrderingElementList();
230 $elements = [];
231 foreach ($element_list->getElements() as $element) {
232 if ($element->getContent() === '') {
233 continue;
234 }
235 $filename = $this->object->updateImageFile(
236 $element->getContent()
237 );
238
239 $elements[] = $element->withContent($filename);
240 }
241
242 $list = $this->object->getOrderingElementList()->withElements($elements);
243 $this->object->setOrderingElementList($list);
244 }
245
247 {
248 $this->object->setOrderingElementList(
250 );
251 }
252
254 {
255 $header = new ilFormSectionHeaderGUI();
256 $header->setTitle($this->lng->txt('oq_header_ordering_elements'));
257 $form->addItem($header);
258
259 $orderingElementInput = $this->object->buildOrderingElementInputGui();
260 $orderingElementInput->setStylingDisabled($this->isRenderPurposePrintPdf());
261 $this->object->initOrderingElementAuthoringProperties($orderingElementInput);
262
263 $list = $this->object->getOrderingElementList();
264 $orderingElementInput->setElementList($list);
265 $form->addItem($orderingElementInput);
266
267 return $form;
268 }
269
271 {
272 if ($this->object->isImageOrderingType()) {
273 $thumb_size = new ilNumberInputGUI($this->lng->txt('thumb_size'), 'thumb_geometry');
274 $thumb_size->setValue($this->object->getThumbSize());
275 $thumb_size->setRequired(true);
276 $thumb_size->setMaxLength(6);
277 $thumb_size->setMinValue($this->object->getMinimumThumbSize());
278 $thumb_size->setMaxValue($this->object->getMaximumThumbSize());
279 $thumb_size->setSize(6);
280 $thumb_size->setInfo($this->lng->txt('thumb_size_info'));
281 $form->addItem($thumb_size);
282 }
283
284 // points
285 $points = new ilNumberInputGUI($this->lng->txt("points"), "points");
286 $points->allowDecimals(true);
287 $points->setValue($this->object->getPoints());
288 $points->setRequired(true);
289 $points->setSize(3);
290 $points->setMinValue(0);
291 $points->setMinvalueShouldBeGreater(true);
292 $form->addItem($points);
293
294 if (!$this->isInLearningModuleContext()) {
295 $nested_answers = new ilSelectInputGUI(
296 $this->lng->txt('qst_use_nested_answers'),
297 self::F_USE_NESTED
298 );
299 $nested_answers_options = [
300 0 => $this->lng->txt('qst_nested_nested_answers_off'),
301 1 => $this->lng->txt('qst_nested_nested_answers_on')
302 ];
303 $nested_answers->setOptions($nested_answers_options);
304 $nested_answers->setValue($this->object->isOrderingTypeNested());
305 $form->addItem($nested_answers);
306 }
307
308 return $form;
309 }
310
311 protected function writePostData(bool $always = false): int
312 {
313 $form = $this->buildEditForm();
314 $form->setValuesByPost();
315
316 if (!$form->checkInput()) {
317 $this->renderEditForm($form);
318 $this->addEditSubtabs(self::TAB_EDIT_QUESTION);
319 return 1; // return 1 = something went wrong, no saving happened
320 }
321
324 $this->writeAnswerSpecificPostData($form);
325 $this->writeQuestionSpecificPostData($form);
326
328
329 return 0; // return 0 = all fine, was saved either forced or validated
330 }
331
332 protected function addEditSubtabs($active = self::TAB_EDIT_QUESTION)
333 {
334 $tabs = $this->getTabs();
335 $tabs->addSubTab(
336 self::TAB_EDIT_QUESTION,
337 $this->lng->txt('edit_question'),
338 $this->ctrl->getLinkTarget($this, 'editQuestion')
339 );
340 if ($this->object->isOrderingTypeNested() && !$this->isInLearningModuleContext()) {
341 $tabs->addSubTab(
342 self::TAB_EDIT_NESTING,
343 $this->lng->txt('tab_nest_answers'),
344 $this->ctrl->getLinkTarget($this, self::CMD_EDIT_NESTING)
345 );
346 }
347 $tabs->setTabActive('edit_question');
348 $tabs->setSubTabActive($active);
349 }
350
351 public function editQuestion(
352 bool $checkonly = false,
353 ?bool $is_save_cmd = null
354 ): bool {
355 $this->renderEditForm($this->buildEditForm());
356 $this->addEditSubtabs(self::TAB_EDIT_QUESTION);
357 return false;
358 }
359
360 public function editNesting()
361 {
362 $this->renderEditForm($this->buildNestingForm());
363 $this->addEditSubtabs(self::TAB_EDIT_NESTING);
364 $this->tpl->addCss(ilObjStyleSheet::getContentStylePath(0));
365 $this->tpl->addCss(ilObjStyleSheet::getSyntaxStylePath());
366 }
367
369 {
371 $form->setFormAction($this->ctrl->getFormAction($this));
372 $form->setTitle($this->outQuestionType());
373 $form->setMultipart($this->object->isImageOrderingType());
374 $form->setTableWidth("100%");
375 $form->setId("ordering");
376
377 $this->addBasicQuestionFormProperties($form);
378 $this->populateQuestionSpecificFormPart($form);
379 $this->populateAnswerSpecificFormPart($form);
380 $this->populateTaxonomyFormSection($form);
381
382 $form->addSpecificOrderingQuestionCommandButtons($this->object);
383 $form->addGenericAssessmentQuestionCommandButtons($this->object);
384
385 return $form;
386 }
387
388 protected function buildNestingForm()
389 {
391 $form->setFormAction($this->ctrl->getFormAction($this));
392 $form->setTitle($this->outQuestionType());
393 $form->setTableWidth("100%");
394
395 $header = new ilFormSectionHeaderGUI();
396 $header->setTitle($this->lng->txt('oq_header_ordering_elements'));
397 $form->addItem($header);
398
399 $orderingElementInput = $this->object->buildNestedOrderingElementInputGui();
400 $orderingElementInput->setStylingDisabled($this->isRenderPurposePrintPdf());
401
402 $this->object->initOrderingElementAuthoringProperties($orderingElementInput);
403
404 $list = $this->object->getOrderingElementList();
405 foreach ($list->getElements() as $element) {
406 $element = $list->ensureValidIdentifiers($element);
407 }
408
409 $orderingElementInput->setElementList($list);
410
411 $form->addItem($orderingElementInput);
412 $form->addCommandButton(self::CMD_SAVE_NESTING, $this->lng->txt("save"));
413 return $form;
414 }
415
417 {
418 return true;
419 }
420
421 public function getSolutionOutput(
422 int $active_id,
423 ?int $pass = null,
424 bool $graphical_output = false,
425 bool $result_output = false,
426 bool $show_question_only = true,
427 bool $show_feedback = false,
428 bool $show_correct_solution = false,
429 bool $show_manual_scoring = false,
430 bool $show_question_text = true,
431 bool $show_inline_feedback = true
432 ): string {
433 $solution_ordering_list = $this->object->getOrderingElementListForSolutionOutput(
434 $show_correct_solution,
435 $active_id,
436 $pass
437 );
438
439 $show_inline_feedback = false;
440 return $this->renderSolutionOutput(
441 $solution_ordering_list,
442 $active_id,
443 $pass,
444 $graphical_output,
445 $result_output,
446 $show_question_only,
447 $show_feedback,
448 $show_correct_solution,
449 $show_manual_scoring,
450 $show_question_text,
451 false,
452 $show_inline_feedback,
453 );
454 }
455
456 public function renderSolutionOutput(
457 mixed $user_solutions,
458 int $active_id,
459 ?int $pass,
460 bool $graphical_output = false,
461 bool $result_output = false,
462 bool $show_question_only = true,
463 bool $show_feedback = false,
464 bool $show_correct_solution = false,
465 bool $show_manual_scoring = false,
466 bool $show_question_text = true,
467 bool $show_autosave_title = false,
468 bool $show_inline_feedback = false,
469 ): ?string {
470 $solution_ordering_list = ($user_solutions instanceof ilAssOrderingElementList) ?
471 $user_solutions : $this->object->getSolutionOrderingElementList(
472 $this->object->fetchIndexedValuesFromValuePairs($user_solutions)
473 );
474 $answers_gui = $this->object->buildNestedOrderingElementInputGui();
475
476 if ($show_correct_solution) {
478 } else {
480 }
481
482 $answers_gui->setInteractionEnabled(false);
483 $answers_gui->setElementList($solution_ordering_list);
484
485 if ($graphical_output) {
486 $answers_gui->setShowCorrectnessIconsEnabled(true);
487 }
488 $answers_gui->setCorrectnessTrueElementList(
489 $solution_ordering_list->getParityTrueElementList($this->object->getOrderingElementList())
490 );
491 $solution_html = $answers_gui->getHTML();
492
493 $template = new ilTemplate('tpl.il_as_qpl_nested_ordering_output_solution.html', true, true, 'components/ILIAS/TestQuestionPool');
494 $template->setVariable('SOLUTION_OUTPUT', $this->renderLatex($solution_html));
495 if ($show_question_text == true) {
496 $template->setVariable('QUESTIONTEXT', $this->renderLatex($this->object->getQuestionForHTMLOutput()));
497 }
498 $questionoutput = $template->get();
499
500 $solutiontemplate = new ilTemplate('tpl.il_as_tst_solution_output.html', true, true, 'components/ILIAS/TestQuestionPool');
501 $solutiontemplate->setVariable('SOLUTION_OUTPUT', $questionoutput);
502
503 if ($show_feedback) {
504 $feedback = '';
505
506 if (!$this->isTestPresentationContext()) {
507 $fb = $this->getGenericFeedbackOutput((int) $active_id, $pass);
508 $feedback .= strlen($fb) ? $fb : '';
509 }
510
511 if ($feedback !== '') {
512 $cssClass = (
513 $this->hasCorrectSolution($active_id, $pass) ?
515 );
516
517 $solutiontemplate->setVariable('ILC_FB_CSS_CLASS', $cssClass);
518 $solutiontemplate->setVariable('FEEDBACK', ilLegacyFormElementsUtil::prepareTextareaOutput($feedback, true));
519 }
520 }
521
522 if ($show_question_only) {
523 return $solutiontemplate->get();
524 }
525
526 return $this->getILIASPage($solutiontemplate->get());
527
528 // is this template still in use? it is not used at this point any longer!
529 // $template = new ilTemplate("tpl.il_as_qpl_ordering_output_solution.html", TRUE, TRUE, "components/ILIAS/TestQuestionPool");
530 }
531
532 public function getPreview(
533 bool $show_question_only = false,
534 bool $show_inline_feedback = false
535 ): string {
536 if ($this->getPreviewSession() && $this->getPreviewSession()->hasParticipantSolution()) {
537 $solutionOrderingElementList = unserialize(
538 $this->getPreviewSession()->getParticipantsSolution(),
539 ['allowed_classes' => true]
540 );
541 } else {
542 $solutionOrderingElementList = $this->object->getShuffledOrderingElementList();
543 }
544
545 $answers = $this->object->buildNestedOrderingElementInputGui();
546 $answers->setNestingEnabled($this->object->isOrderingTypeNested());
548 $answers->setInteractionEnabled($this->isInteractivePresentation());
549 $answers->setElementList($solutionOrderingElementList);
550
551 $template = new ilTemplate('tpl.il_as_qpl_ordering_output.html', true, true, 'components/ILIAS/TestQuestionPool');
552
553 $template->setCurrentBlock('nested_ordering_output');
554 $template->setVariable('NESTED_ORDERING', $this->renderLatex($answers->getHTML()));
555 $template->parseCurrentBlock();
556 $template->setVariable('QUESTIONTEXT', $this->renderLatex($this->object->getQuestionForHTMLOutput()));
557
558 if ($show_question_only) {
559 return $template->get();
560 }
561
562 return $this->getILIASPage($template->get());
563 }
564
565 public function getTestOutput(
566 int $active_id,
567 int $pass,
568 bool $is_question_postponed = false,
569 array|bool $user_post_solutions = false,
570 bool $show_specific_inline_feedback = false
571 ): string {
572 $user_post_solutions = is_array($user_post_solutions) ? $user_post_solutions : [];
573
574 $ordering_gui = $this->object->buildNestedOrderingElementInputGui();
575 $ordering_gui->setNestingEnabled($this->object->isOrderingTypeNested());
576
577 $solutionOrderingElementList = $this->object->getSolutionOrderingElementListForTestOutput(
578 $ordering_gui,
579 $user_post_solutions,
580 $active_id,
581 $pass
582 );
583
584 $template = new ilTemplate('tpl.il_as_qpl_ordering_output.html', true, true, 'components/ILIAS/TestQuestionPool');
585
587 $ordering_gui->setElementList($solutionOrderingElementList);
588
589 $template->setCurrentBlock('nested_ordering_output');
590 $template->setVariable('NESTED_ORDERING', $this->renderLatex($ordering_gui->getHTML()));
591 $template->parseCurrentBlock();
592
593 $template->setVariable('QUESTIONTEXT', $this->renderLatex($this->object->getQuestionForHTMLOutput()));
594
595 $pageoutput = $this->outQuestionPage('', $is_question_postponed, $active_id, $template->get());
596
597 return $pageoutput;
598 }
599
600 protected function isInteractivePresentation(): bool
601 {
602 if ($this->isRenderPurposePlayback()) {
603 return true;
604 }
605
606 if ($this->isRenderPurposeDemoplay()) {
607 return true;
608 }
609
610 return false;
611 }
612
613 protected function getTabs(): ilTabsGUI
614 {
615 global $DIC;
616 return $DIC['ilTabs'];
617 }
618
619 public function getSpecificFeedbackOutput(array $userSolution): string
620 {
621 return '';
622 }
623
634 {
635 return [];
636 }
637
648 {
649 return [];
650 }
651
653 {
654 if ($this->object->isImageOrderingType()) {
655 $element->setImageThumbnailPrefix($this->object->getThumbPrefix());
656 $element->setImagePathWeb($this->object->getImagePathWeb());
657 $element->setImagePathFs($this->object->getImagePath());
658
659 $src = $element->getPresentationImageUrl();
660 $alt = $element->getContent();
661 $content = "<img src='{$src}' alt='{$alt}' title='{$alt}'/>";
662 } else {
663 $content = $element->getContent();
664 }
665
666 return $content;
667 }
668
670 {
671 $html = '<ul>';
672
673 $lastIndent = 0;
674 $firstElem = true;
675
676 foreach ($list as $elem) {
677 if ($elem->getIndentation() > $lastIndent) {
678 $html .= '<ul><li>';
679 } elseif ($elem->getIndentation() < $lastIndent) {
680 $html .= '</li></ul><li>';
681 } elseif (!$firstElem) {
682 $html .= '</li><li>';
683 } else {
684 $html .= '<li>';
685 }
686
687 $html .= $this->getAnswerStatisticOrderingElementHtml($elem);
688
689 $firstElem = false;
690 $lastIndent = $elem->getIndentation();
691 }
692
693 $html .= '</li>';
694
695 for ($i = $lastIndent; $i > 0; $i--) {
696 $html .= '</ul></li>';
697 }
698
699 $html .= '</ul>';
700
701 return $html;
702 }
703
704 public function getAnswersFrequency($relevantAnswers, $questionIndex): array
705 {
706 $answersByActiveAndPass = [];
707
708 foreach ($relevantAnswers as $row) {
709 $key = $row['active_fi'] . ':' . $row['pass'];
710
711 if (!isset($answersByActiveAndPass[$key])) {
712 $answersByActiveAndPass[$key] = [];
713 }
714
715 $answersByActiveAndPass[$key][$row['value1']] = $row['value2'];
716 }
717
718 $solutionLists = [];
719
720 foreach ($answersByActiveAndPass as $indexedSolutions) {
721 $solutionLists[] = $this->object->getSolutionOrderingElementList($indexedSolutions);
722 }
723
724 /* @var ilAssOrderingElementList[] $answers */
725 $answers = [];
726
727 foreach ($solutionLists as $orderingElementList) {
728 $hash = $orderingElementList->getHash();
729
730 if (!isset($answers[$hash])) {
731 $variantHtml = $this->getAnswerStatisticOrderingVariantHtml(
732 $orderingElementList
733 );
734
735 $answers[$hash] = [
736 'answer' => $variantHtml, 'frequency' => 0
737 ];
738 }
739
740 $answers[$hash]['frequency']++;
741 }
742
743 return array_values($answers);
744 }
745
750 {
752 $orderingInput->prepareReprintable($this->object);
753 }
754
759 {
760 $points = new ilNumberInputGUI($this->lng->txt("points"), "points");
761 $points->allowDecimals(true);
762 $points->setValue($this->object->getPoints());
763 $points->setRequired(true);
764 $points->setSize(3);
765 $points->setMinValue(0);
766 $points->setMinvalueShouldBeGreater(true);
767 $form->addItem($points);
768
769 $header = new ilFormSectionHeaderGUI();
770 $header->setTitle($this->lng->txt('oq_header_ordering_elements'));
771 $form->addItem($header);
772
773 $orderingElementInput = $this->object->buildNestedOrderingElementInputGui();
774
775 $this->object->initOrderingElementAuthoringProperties($orderingElementInput);
776
777 $orderingElementInput->setElementList($this->object->getOrderingElementList());
778
779 $form->addItem($orderingElementInput);
780 }
781
786 {
787 $this->object->setPoints((float) str_replace(',', '.', $form->getInput('points')));
788
789 $submittedElementList = $this->fetchSolutionListFromSubmittedForm($form);
790
791 $curElementList = $this->object->getOrderingElementList();
792
793 $newElementList = new ilAssOrderingElementList();
794 $newElementList->setQuestionId($this->object->getId());
795
796 foreach ($submittedElementList as $submittedElement) {
797 if (!$curElementList->elementExistByRandomIdentifier($submittedElement->getRandomIdentifier())) {
798 continue;
799 }
800
801 $curElement = $curElementList->getElementByRandomIdentifier($submittedElement->getRandomIdentifier());
802
803 $curElement->setPosition($submittedElement->getPosition());
804
805 if ($this->object->isOrderingTypeNested()) {
806 $curElement->setIndentation($submittedElement->getIndentation());
807 }
808
809 $newElementList->addElement($curElement);
810 }
811
812 $this->object->setOrderingElementList($newElementList);
813 }
814}
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
$filename
Definition: buildRTE.php:78
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
prepareReprintableCorrectionsForm(ilPropertyFormGUI $form)
addEditSubtabs($active=self::TAB_EDIT_QUESTION)
fetchSolutionListFromSubmittedForm(ilPropertyFormGUI $form)
getAnswersFrequency($relevantAnswers, $questionIndex)
__construct($id=-1)
assOrderingQuestionGUI constructor
writeQuestionSpecificPostData(ilPropertyFormGUI $form)
Extracts the question specific values from the request and applies them to the data object.
populateAnswerSpecificFormPart(ilPropertyFormGUI $form)
Adds the answer specific form parts to a question property form gui.
writePostData(bool $always=false)
Evaluates a posted edit form and writes the form data in the question object.
getPreview(bool $show_question_only=false, bool $show_inline_feedback=false)
getAnswerStatisticOrderingElementHtml(ilAssOrderingElement $element)
getAfterParticipationSuppressionAnswerPostVars()
Returns a list of postvars which will be suppressed in the form output when used in scoring adjustmen...
getTestOutput(int $active_id, int $pass, bool $is_question_postponed=false, array|bool $user_post_solutions=false, bool $show_specific_inline_feedback=false)
writeAnswerSpecificPostData(ilPropertyFormGUI $form)
Extracts the answer specific values from the request and applies them to the data object.
populateQuestionSpecificFormPart(\ilPropertyFormGUI $form)
populateCorrectionsFormProperties(ilPropertyFormGUI $form)
getSolutionOutput(int $active_id, ?int $pass=null, bool $graphical_output=false, bool $result_output=false, bool $show_question_only=true, bool $show_feedback=false, bool $show_correct_solution=false, bool $show_manual_scoring=false, bool $show_question_text=true, bool $show_inline_feedback=true)
saveCorrectionsFormProperties(ilPropertyFormGUI $form)
getAfterParticipationSuppressionQuestionPostVars()
Returns a list of postvars which will be suppressed in the form output when used in scoring adjustmen...
renderSolutionOutput(mixed $user_solutions, int $active_id, ?int $pass, bool $graphical_output=false, bool $result_output=false, bool $show_question_only=true, bool $show_feedback=false, bool $show_correct_solution=false, bool $show_manual_scoring=false, bool $show_question_text=true, bool $show_autosave_title=false, bool $show_inline_feedback=false,)
getAnswerStatisticOrderingVariantHtml(ilAssOrderingElementList $list)
getSpecificFeedbackOutput(array $userSolution)
Returns the answer specific feedback for the question.
editQuestion(bool $checkonly=false, ?bool $is_save_cmd=null)
Class for ordering questions.
renderEditForm(ilPropertyFormGUI $form)
setImagePathFs(string $image_path_fs)
setImageThumbnailPrefix($imageThumbnailPrefix)
This class represents a section header in a property form.
static prepareTextareaOutput(string $txt_output, bool $prepare_for_latex_output=false, bool $omitNl2BrWhenTextArea=false)
Prepares a string for a text area output where latex code may be in it If the text is HTML-free,...
This class represents a number property in a property form.
static getContentStylePath(int $a_style_id, bool $add_random=true, bool $add_token=true)
get content style path static (to avoid full reading)
This class represents a property form user interface.
getInput(string $a_post_var, bool $ensureValidation=true)
Returns the input of an item, if item provides getInput method and as fallback the value of the HTTP-...
getItemByPostVar(string $a_post_var)
This class represents a selection list property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
special template class to simplify handling of ITX/PEAR
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$post
Definition: ltitoken.php:46
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
if(!file_exists('../ilias.ini.php'))
global $DIC
Definition: shib_login.php:26