ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
class.ilTestSkillEvaluationToolbarGUI.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
28 {
29  private array $availableSkillProfiles;
32 
33  public function __construct(
34  private ilCtrl $ctrl
35  ) {
37  }
38 
39  public function setAvailableSkillProfiles(array $availableSkillProfiles): void
40  {
41  $this->availableSkillProfiles = $availableSkillProfiles;
42  }
43 
44  public function getAvailableSkillProfiles(): array
45  {
47  }
48 
49  public function setNoSkillProfileOptionEnabled(bool $noSkillProfileOptionEnabled): void
50  {
51  $this->noSkillProfileOptionEnabled = $noSkillProfileOptionEnabled;
52  }
53 
54  public function isNoSkillProfileOptionEnabled(): bool
55  {
57  }
58 
59  public function setSelectedEvaluationMode(int $selectedEvaluationMode): void
60  {
61  $this->selectedEvaluationMode = $selectedEvaluationMode;
62  }
63 
64  public function getSelectedEvaluationMode(): int
65  {
67  }
68 
69  public function build(): void
70  {
71  $this->setFormAction($this->ctrl->getFormActionByClass(ilTestSkillEvaluationGUI::class));
72 
73  $select = new ilSelectInputGUI($this->lng->txt('tst_analysis'), ilTestSkillEvaluationGUI::SKILL_PROFILE_PARAM);
75  $select->setValue($this->getSelectedEvaluationMode());
76  $this->addInputItem($select, true);
77 
78  $this->addFormButton($this->lng->txt('select'), ilTestSkillEvaluationGUI::CMD_SHOW);
79  }
80 
81  private function buildEvaluationModeOptionsArray(): array
82  {
83  $options = array();
84 
85  if ($this->isNoSkillProfileOptionEnabled()) {
86  $options[0] = $this->lng->txt('tst_all_test_competences');
87  ;
88  }
89 
90  foreach ($this->getAvailableSkillProfiles() as $skillProfileId => $skillProfileTitle) {
91  $options[$skillProfileId] = "{$this->lng->txt('tst_gap_analysis')}: {$skillProfileTitle}";
92  }
93 
94  return $options;
95  }
96 }
This class represents a selection list property in a property form.
setFormAction(string $a_val, bool $a_multipart=false, string $a_target="")
Set form action (if form action is set, toolbar is wrapped into form tags)
setOptions(array $a_options)
__construct(VocabulariesInterface $vocabularies)
setAvailableSkillProfiles(array $availableSkillProfiles)
setNoSkillProfileOptionEnabled(bool $noSkillProfileOptionEnabled)
addFormButton(string $a_txt, string $a_cmd, ?int $a_acc_key=null, bool $a_primary=false, ?string $a_class=null)
addInputItem(ilToolbarItem $a_item, bool $a_output_label=false)