ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilAssOrderingQuestionAuthoringFormGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4require_once 'Modules/TestQuestionPool/classes/forms/class.ilAssQuestionAuthoringFormGUI.php';
12{
13 const COMMAND_BUTTON_PREFIX = 'assOrderingQuestionBtn_';
14
16
17 public function __construct()
18 {
19 global $DIC;
20 $tpl = $DIC->ui()->mainTemplate();
22 [
25 ]
26 );
28 }
29
31 {
32 $this->availableCommandButtonIds = $availableCommandButtonIds;
33 }
34
35 protected function getAvailableCommandButtonIds()
36 {
38 }
39
41 {
42 if ($questionOBJ->isImageOrderingType()) {
44 $label = $this->lng->txt("oq_btn_use_order_terms");
45 } else {
47 $label = $this->lng->txt("oq_btn_use_order_pictures");
48 }
49
50 $id = $this->buildCommandButtonId($cmd);
51 $this->addCommandButton($cmd, $label, $id);
52 }
53
58 {
59 return $this->getItemByPostVar(
61 );
62 }
63
64 public function prepareValuesReprintable(assOrderingQuestion $questionOBJ)
65 {
66 $this->getOrderingElementInputField()->prepareReprintable($questionOBJ);
67 }
68
70 {
71 $this->renewOrderingElementInput($questionOBJ);
72 $this->renewOrderingCommandButtons($questionOBJ);
73 }
74
79 protected function renewOrderingElementInput(assOrderingQuestion $questionOBJ)
80 {
81 $replacingInput = $questionOBJ->buildOrderingElementInputGui();
82 $questionOBJ->initOrderingElementAuthoringProperties($replacingInput);
83 $dodgingInput = $this->getItemByPostVar($replacingInput->getPostVar());
84 $replacingInput->setElementList($dodgingInput->getElementList($questionOBJ->getId()));
85 $this->replaceFormItemByPostVar($replacingInput);
86 }
87
88 protected function buildCommandButtonId($id)
89 {
90 return self::COMMAND_BUTTON_PREFIX . $id;
91 }
92
93 protected function renewOrderingCommandButtons(assOrderingQuestion $questionOBJ)
94 {
95 $this->clearCommandButtons();
98 }
99}
An exception for terminatinating execution or to throw for unit testing.
Class for ordering questions.
initOrderingElementAuthoringProperties(ilFormPropertyGUI $formField)
getId()
Gets the id of the assQuestion object.
__construct()
ilAssQuestionAuthoringFormGUI constructor.
addSpecificOrderingQuestionCommandButtons(assOrderingQuestion $questionOBJ)
replaceFormItemByPostVar(ilFormPropertyGUI $replacingItem)
addGenericAssessmentQuestionCommandButtons(assQuestion $questionOBJ)
addCommandButton($a_cmd, $a_text, $a_id="")
Add Command button.
clearCommandButtons()
Remove all command buttons.
getItemByPostVar($a_post_var)
Get Item by POST variable.
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc