ILIAS  release_8 Revision v8.24
class.ilAssQuestionRelatedNavigationBarGUI.php
Go to the documentation of this file.
1<?php
2
26{
30 protected $ctrl;
31
35 protected $lng;
36
38
40
42
44
46
47 protected $hintRequestCmd;
48
49 protected $hintListCmd;
50
52 {
53 $this->ctrl = $ctrl;
54 $this->lng = $lng;
55 }
56
57 public function getHintListCmd()
58 {
59 return $this->hintListCmd;
60 }
61
62 public function setHintListCmd($hintListCmd): void
63 {
64 $this->hintListCmd = $hintListCmd;
65 }
66
67 public function getHintRequestCmd()
68 {
70 }
71
72 public function setHintRequestCmd($hintRequestCmd): void
73 {
74 $this->hintRequestCmd = $hintRequestCmd;
75 }
76
78 {
79 $this->hintRequestsExist = $hintRequestsExist;
80 }
81
82 public function doesHintRequestsExist()
83 {
85 }
86
88 {
89 $this->hintRequestsPossible = $hintRequestsPossible;
90 }
91
92 public function areHintRequestsPossible()
93 {
95 }
96
98 {
99 $this->hintProvidingEnabled = $hintProvidingEnabled;
100 }
101
102 public function isHintProvidingEnabled()
103 {
105 }
106
107 public function setInstantResponseEnabled($instantFeedbackEnabled): void
108 {
109 $this->instantResponseEnabled = $instantFeedbackEnabled;
110 }
111
112 public function isInstantResponseEnabled()
113 {
115 }
116
118 {
119 $this->instantResponseCmd = $instantResponseCmd;
120 }
121
122 public function getInstantResponseCmd()
123 {
125 }
126
127 public function getHTML(): string
128 {
129 $navTpl = new ilTemplate('tpl.qst_question_related_navigation.html', true, true, 'Modules/TestQuestionPool');
130
131 $parseQuestionRelatedNavigation = false;
132
133 if ($this->isInstantResponseEnabled()) {
134 $navTpl->setCurrentBlock("direct_feedback");
135 $navTpl->setVariable("CMD_SHOW_INSTANT_RESPONSE", $this->getInstantResponseCmd());
136 $navTpl->setVariable("TEXT_SHOW_INSTANT_RESPONSE", $this->lng->txt("check"));
137 $navTpl->parseCurrentBlock();
138
139 $parseQuestionRelatedNavigation = true;
140 }
141
142 if ($this->isHintProvidingEnabled()) {
143 require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintTracking.php';
144 require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestGUI.php';
145
146 if ($this->areHintRequestsPossible()) {
147 if ($this->doesHintRequestsExist()) {
148 $buttonText = $this->lng->txt("button_request_next_question_hint");
149 } else {
150 $buttonText = $this->lng->txt("button_request_question_hint");
151 }
152
153 $navTpl->setCurrentBlock("button_request_next_question_hint");
154 $navTpl->setVariable("CMD_REQUEST_NEXT_QUESTION_HINT", $this->getHintRequestCmd());
155 $navTpl->setVariable("TEXT_REQUEST_NEXT_QUESTION_HINT", $buttonText);
156 $navTpl->parseCurrentBlock();
157
158 $parseQuestionRelatedNavigation = true;
159 }
160
161 if ($this->doesHintRequestsExist()) {
162 $navTpl->setCurrentBlock("button_show_requested_question_hints");
163 $navTpl->setVariable("CMD_SHOW_REQUESTED_QUESTION_HINTS", $this->getHintListCmd());
164 $navTpl->setVariable("TEXT_SHOW_REQUESTED_QUESTION_HINTS", $this->lng->txt("show_requested_question_hints"));
165 $navTpl->parseCurrentBlock();
166
167 $parseQuestionRelatedNavigation = true;
168 }
169 }
170
171 if ($parseQuestionRelatedNavigation) {
172 $navTpl->setCurrentBlock("question_related_navigation");
173 $navTpl->parseCurrentBlock();
174 }
175
176 return $navTpl->get();
177 }
178}
Class ilCtrl provides processing control methods.
language handling
special template class to simplify handling of ITX/PEAR