ILIAS  release_8 Revision v8.24
class.ilTestSkillEvaluationToolbarGUI.php
Go to the documentation of this file.
1<?php
2
26{
27 public const SKILL_PROFILE_PARAM = 'skill_profile';
28
29 private ilCtrl $ctrl;
30
31 private $parentGUI;
32 private $parentCMD;
36
38 {
39 $this->ctrl = $ctrl;
40
41 $this->parentGUI = $parentGUI;
42 $this->parentCMD = $parentCMD;
43
45 }
46
48 {
49 $this->availableSkillProfiles = $availableSkillProfiles;
50 }
51
52 public function getAvailableSkillProfiles()
53 {
55 }
56
58 {
59 $this->noSkillProfileOptionEnabled = $noSkillProfileOptionEnabled;
60 }
61
63 {
65 }
66
68 {
69 $this->selectedEvaluationMode = $selectedEvaluationMode;
70 }
71
72 public function getSelectedEvaluationMode()
73 {
75 }
76
77 public function build(): void
78 {
79 $this->setFormAction($this->ctrl->getFormAction($this->parentGUI));
80
81 $select = new ilSelectInputGUI($this->lng->txt("tst_analysis"), self::SKILL_PROFILE_PARAM);
82 $select->setOptions($this->buildEvaluationModeOptionsArray());
83 $select->setValue($this->getSelectedEvaluationMode());
84 $this->addInputItem($select, true);
85
86 $this->addFormButton($this->lng->txt("select"), $this->parentCMD);
87 }
88
89 private function buildEvaluationModeOptionsArray(): array
90 {
91 $options = array();
92
93 if ($this->isNoSkillProfileOptionEnabled()) {
94 $options[0] = $this->lng->txt('tst_all_test_competences');
95 ;
96 }
97
98 foreach ($this->getAvailableSkillProfiles() as $skillProfileId => $skillProfileTitle) {
99 $options[$skillProfileId] = "{$this->lng->txt('tst_gap_analysis')}: {$skillProfileTitle}";
100 }
101
102 return $options;
103 }
104
105 public static function fetchSkillProfileParam($postData): int
106 {
107 if (isset($postData[self::SKILL_PROFILE_PARAM])) {
108 return (int) $postData[self::SKILL_PROFILE_PARAM];
109 }
110
111 return 0;
112 }
113}
Class ilCtrl provides processing control methods.
language handling
This class represents a selection list property in a property form.
__construct(ilCtrl $ctrl, ilLanguage $lng, $parentGUI, $parentCMD)
setNoSkillProfileOptionEnabled($noSkillProfileOptionEnabled)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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)
addInputItem(ilToolbarItem $a_item, bool $a_output_label=false)
addFormButton(string $a_txt, string $a_cmd, ?int $a_acc_key=null, bool $a_primary=false, ?string $a_class=null)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc