ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 
4 require_once 'Modules/TestQuestionPool/classes/forms/class.ilAssQuestionAuthoringFormGUI.php';
12 {
13  const COMMAND_BUTTON_PREFIX = 'assOrderingQuestionBtn_';
14 
15  protected $availableCommandButtonIds = null;
16 
17  public function __construct()
18  {
24  ));
25 
26  parent::__construct();
27  }
28 
30  {
31  $this->availableCommandButtonIds = $availableCommandButtonIds;
32  }
33 
34  protected function getAvailableCommandButtonIds()
35  {
37  }
38 
40  {
41  switch ($questionOBJ->getOrderingType()) {
42  case OQ_TERMS:
43 
44  $this->addCommandButton(
45  "changeToPictures",
46  $this->lng->txt("oq_btn_use_order_pictures"),
48  );
49  $this->addCommandButton(
50  "orderNestedTerms",
51  $this->lng->txt("oq_btn_nest_terms"),
53  );
54  break;
55 
56  case OQ_PICTURES:
57 
58  $this->addCommandButton(
59  "changeToText",
60  $this->lng->txt("oq_btn_use_order_terms"),
62  );
63  $this->addCommandButton(
64  "orderNestedPictures",
65  $this->lng->txt("oq_btn_nest_pictures"),
67  );
68  break;
69 
70  case OQ_NESTED_TERMS:
71 
72  $this->addCommandButton(
73  "changeToPictures",
74  $this->lng->txt("oq_btn_use_order_pictures"),
76  );
77  $this->addCommandButton(
78  "changeToText",
79  $this->lng->txt("oq_btn_define_terms"),
81  );
82  break;
83 
84  case OQ_NESTED_PICTURES:
85 
86  $this->addCommandButton(
87  "changeToText",
88  $this->lng->txt("oq_btn_use_order_terms"),
89  'assOrderingQuestionBtn_' . OQ_TERMS
90  );
91  $this->addCommandButton(
92  "changeToPictures",
93  $this->lng->txt("oq_btn_define_pictures"),
94  'assOrderingQuestionBtn_' . OQ_PICTURES
95  );
96  break;
97  }
98  }
99 
104  {
105  return $this->getItemByPostVar(
107  );
108  }
109 
110  public function prepareValuesReprintable(assOrderingQuestion $questionOBJ)
111  {
112  $this->getOrderingElementInputField()->prepareReprintable($questionOBJ);
113  }
114 
116  {
117  $this->renewOrderingElementInput($questionOBJ);
118  $this->renewOrderingCommandButtons($questionOBJ);
119  }
120 
125  protected function renewOrderingElementInput(assOrderingQuestion $questionOBJ)
126  {
127  $replacingInput = $questionOBJ->buildOrderingElementInputGui();
128  $questionOBJ->initOrderingElementAuthoringProperties($replacingInput);
129  $dodgingInput = $this->getItemByPostVar($replacingInput->getPostVar());
130  $replacingInput->setElementList($dodgingInput->getElementList($questionOBJ->getId()));
131  $this->replaceFormItemByPostVar($replacingInput);
132  }
133 
134  protected function buildCommandButtonId($orderingType)
135  {
136  return self::COMMAND_BUTTON_PREFIX . $orderingType;
137  }
138 
139  protected function renewOrderingCommandButtons(assOrderingQuestion $questionOBJ)
140  {
141  $this->clearCommandButtons();
142  $this->addSpecificOrderingQuestionCommandButtons($questionOBJ);
143  $this->addGenericAssessmentQuestionCommandButtons($questionOBJ);
144  }
145 }
initOrderingElementAuthoringProperties(ilFormPropertyGUI $formField)
getId()
Gets the id of the assQuestion object.
addGenericAssessmentQuestionCommandButtons(assQuestion $questionOBJ)
getItemByPostVar($a_post_var)
Get Item by POST variable.
getOrderingType()
Returns the ordering question type.
const OQ_NESTED_TERMS
clearCommandButtons()
Remove all command buttons.
replaceFormItemByPostVar(ilFormPropertyGUI $replacingItem)
addSpecificOrderingQuestionCommandButtons(assOrderingQuestion $questionOBJ)
const OQ_PICTURES
Ordering question constants.
addCommandButton($a_cmd, $a_text, $a_id="")
Add Command button.
Create styles array
The data for the language used.
const OQ_TERMS
const OQ_NESTED_PICTURES
Class for ordering questions.