ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilTestSkillEvaluationToolbarGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
28{
32
33 public function __construct(
34 private ilCtrlInterface $ctrl
35 ) {
37 }
38
39 public function setAvailableSkillProfiles(array $availableSkillProfiles): void
40 {
41 $this->available_skill_profiles = $availableSkillProfiles;
42 }
43
44 public function setNoSkillProfileOptionEnabled(bool $noSkillProfileOptionEnabled): void
45 {
46 $this->no_skill_profile_option_enabled = $noSkillProfileOptionEnabled;
47 }
48
49 public function setSelectedEvaluationMode(int $selectedEvaluationMode): void
50 {
51 $this->selected_evaluation_mode = $selectedEvaluationMode;
52 }
53
54 public function build(): void
55 {
56 $this->setFormAction($this->ctrl->getFormActionByClass(ilTestSkillEvaluationGUI::class));
57
58 $select = new ilSelectInputGUI($this->lng->txt('tst_analysis'), ilTestSkillEvaluationGUI::SKILL_PROFILE_PARAM);
59 $select->setOptions($this->buildEvaluationModeOptionsArray());
60 $select->setValue($this->selected_evaluation_mode);
61 $this->addInputItem($select, true);
62
63 $this->addFormButton($this->lng->txt('select'), ilTestSkillEvaluationGUI::CMD_SHOW);
64 }
65
66 private function buildEvaluationModeOptionsArray(): array
67 {
68 $options = [];
69
70 if ($this->no_skill_profile_option_enabled) {
71 $options[0] = $this->lng->txt('tst_all_test_competences');
72 ;
73 }
74
75 foreach ($this->available_skill_profiles as $skillProfileId => $skillProfileTitle) {
76 $options[$skillProfileId] = "{$this->lng->txt('tst_gap_analysis')}: {$skillProfileTitle}";
77 }
78
79 return $options;
80 }
81}
This class represents a selection list property in a property form.
setNoSkillProfileOptionEnabled(bool $noSkillProfileOptionEnabled)
setAvailableSkillProfiles(array $availableSkillProfiles)
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)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc