ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilAssOrderingQuestionAuthoringFormGUI.php
Go to the documentation of this file.
1 <?php
2 
26 {
27  public const COMMAND_BUTTON_PREFIX = 'assOrderingQuestionBtn_';
28 
29  protected $availableCommandButtonIds = null;
30 
31  public function __construct()
32  {
33  global $DIC;
34  $tpl = $DIC->ui()->mainTemplate();
36  [
39  ]
40  );
42  }
43 
45  {
46  $this->availableCommandButtonIds = $availableCommandButtonIds;
47  }
48 
49  protected function getAvailableCommandButtonIds()
50  {
52  }
53 
55  {
56  if ($questionOBJ->isImageOrderingType()) {
58  $label = $this->lng->txt("oq_btn_use_order_terms");
59  } else {
61  $label = $this->lng->txt("oq_btn_use_order_pictures");
62  }
63 
64  $id = $this->buildCommandButtonId($cmd);
65  $this->addCommandButton($cmd, $label, $id);
66  }
67 
68  public function getOrderingElementInputField()
69  {
70  return $this->getItemByPostVar(
72  );
73  }
74 
75  public function prepareValuesReprintable(assOrderingQuestion $questionOBJ): void
76  {
77  $this->getOrderingElementInputField()->prepareReprintable($questionOBJ);
78  }
79 
80  public function ensureReprintableFormStructure(assOrderingQuestion $questionOBJ): void
81  {
82  $this->renewOrderingElementInput($questionOBJ);
83  $this->renewOrderingCommandButtons($questionOBJ);
84  }
85 
90  protected function renewOrderingElementInput(assOrderingQuestion $questionOBJ): void
91  {
92  $replacingInput = $questionOBJ->buildOrderingElementInputGui();
93  $questionOBJ->initOrderingElementAuthoringProperties($replacingInput);
94  $dodgingInput = $this->getItemByPostVar($replacingInput->getPostVar());
95  $replacingInput->setElementList($dodgingInput->getElementList($questionOBJ->getId()));
96  $this->replaceFormItemByPostVar($replacingInput);
97  }
98 
99  protected function buildCommandButtonId($id): string
100  {
101  return self::COMMAND_BUTTON_PREFIX . $id;
102  }
103 
104  protected function renewOrderingCommandButtons(assOrderingQuestion $questionOBJ): void
105  {
106  $this->clearCommandButtons();
107  $this->addSpecificOrderingQuestionCommandButtons($questionOBJ);
108  $this->addGenericAssessmentQuestionCommandButtons($questionOBJ);
109  }
110 }
initOrderingElementAuthoringProperties(ilFormPropertyGUI $formField)
addGenericAssessmentQuestionCommandButtons(assQuestion $questionOBJ)
getItemByPostVar(string $a_post_var)
global $DIC
Definition: feed.php:28
replaceFormItemByPostVar(ilFormPropertyGUI $replacingItem)
addSpecificOrderingQuestionCommandButtons(assOrderingQuestion $questionOBJ)
addCommandButton(string $a_cmd, string $a_text, string $a_id="")
__construct(Container $dic, ilPlugin $plugin)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...