ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilTestResultsGUI Class Reference
+ Collaboration diagram for ilTestResultsGUI:

Public Member Functions

 __construct (private ilObjTest $test_object, private readonly ilCtrlInterface $ctrl, private readonly ilTestAccess $test_access, private readonly ilDBInterface $db, private readonly Refinery $refinery, private readonly ilObjUser $user, private readonly ilLanguage $lng, private readonly TestLogger $logger, private readonly ilComponentRepository $component_repository, private TabsManager $test_tabs, private readonly ilToolbarGUI $toolbar, private readonly ilGlobalTemplateInterface $main_tpl, private readonly UIFactory $ui_factory, private readonly UIRenderer $ui_renderer, private readonly SkillService $skills_service, private readonly GeneralQuestionPropertiesRepository $questionrepository, private readonly TestTopListRepository $toplist_repository, private readonly RequestDataCollector $testrequest, private readonly GlobalHttpState $http, private readonly DataFactory $data_factory, private readonly ilTestSession $test_session, private readonly ilTestObjectiveOrientedContainer $objective_parent)
 
 executeCommand ()
 

Data Fields

const DEFAULT_CMD = 'show'
 

Protected Member Functions

 showCmd ()
 
 showNoResultsReportingMessage ()
 

Private Attributes

ILIAS DI UIServices $ui
 

Detailed Description

Definition at line 49 of file class.ilTestResultsGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilTestResultsGUI::__construct ( private ilObjTest  $test_object,
private readonly ilCtrlInterface  $ctrl,
private readonly ilTestAccess  $test_access,
private readonly ilDBInterface  $db,
private readonly Refinery  $refinery,
private readonly ilObjUser  $user,
private readonly ilLanguage  $lng,
private readonly TestLogger  $logger,
private readonly ilComponentRepository  $component_repository,
private TabsManager  $test_tabs,
private readonly ilToolbarGUI  $toolbar,
private readonly ilGlobalTemplateInterface  $main_tpl,
private readonly UIFactory  $ui_factory,
private readonly UIRenderer  $ui_renderer,
private readonly SkillService  $skills_service,
private readonly GeneralQuestionPropertiesRepository  $questionrepository,
private readonly TestTopListRepository  $toplist_repository,
private readonly RequestDataCollector  $testrequest,
private readonly GlobalHttpState  $http,
private readonly DataFactory  $data_factory,
private readonly ilTestSession  $test_session,
private readonly ilTestObjectiveOrientedContainer  $objective_parent 
)

Definition at line 54 of file class.ilTestResultsGUI.php.

77 {
78 }

Member Function Documentation

◆ executeCommand()

ilTestResultsGUI::executeCommand ( )

Definition at line 80 of file class.ilTestResultsGUI.php.

80 : void
81 {
82 $this->test_tabs->activateTab(TabsManager::TAB_ID_YOUR_RESULTS);
83 $this->test_tabs->getYourResultsSubTabs();
84
85 switch ($this->ctrl->getNextClass()) {
86 case 'ilmytestresultsgui':
87 if (!$this->test_tabs->needsYourResultsTab()) {
88 ilObjTestGUI::accessViolationRedirect();
89 }
90
91 $this->test_tabs->activateSubTab(TabsManager::SUBTAB_ID_MY_RESULTS);
92
93 $gui = new ilMyTestResultsGUI(
94 $this->test_object,
95 $this->test_access,
96 $this->objective_parent,
97 $this->user,
98 $this->lng,
99 $this->ctrl,
100 $this->main_tpl,
101 $this->questionrepository,
102 $this->testrequest
103 );
104 $this->ctrl->forwardCommand($gui);
105 break;
106
107 case 'iltestevalobjectiveorientedgui':
108 if (!$this->test_tabs->needsLoResultsSubTab()) {
109 ilObjTestGUI::accessViolationRedirect();
110 }
111
112 $this->test_tabs->activateSubTab(TabsManager::SUBTAB_ID_LO_RESULTS);
113
114 $gui = new ilTestEvalObjectiveOrientedGUI($this->test_object);
115 $gui->setObjectiveOrientedContainer($this->objective_parent);
116 $this->ctrl->forwardCommand($gui);
117 break;
118
119 case 'ilmytestsolutionsgui':
120 if (!$this->test_tabs->needsYourSolutionsSubTab()) {
121 ilObjTestGUI::accessViolationRedirect();
122 }
123
124 $this->test_tabs->activateSubTab(TabsManager::SUBTAB_ID_MY_SOLUTIONS);
125
126 $gui = new ilMyTestSolutionsGUI(
127 $this->test_object,
128 $this->test_access,
129 $this->objective_parent,
130 $this->lng,
131 $this->ctrl,
132 $this->main_tpl,
133 $this->questionrepository,
134 $this->testrequest
135 );
136 $this->ctrl->forwardCommand($gui);
137 break;
138
139 case 'iltesttoplistgui':
140 if (!$this->test_tabs->needsHighSoreSubTab()) {
141 ilObjTestGUI::accessViolationRedirect();
142 }
143
144 $this->test_tabs->activateSubTab(TabsManager::SUBTAB_ID_HIGHSCORE);
145
146 $gui = new ilTestToplistGUI(
147 $this->test_object,
148 $this->toplist_repository,
149 $this->ctrl,
150 $this->main_tpl,
151 $this->lng,
152 $this->user,
153 $this->ui_factory,
154 $this->ui_renderer,
155 $this->data_factory,
156 $this->http
157 );
158 $this->ctrl->forwardCommand($gui);
159 break;
160
161 case 'iltestskillevaluationgui':
162 $this->test_tabs->activateSubTab(TabsManager::SUBTAB_ID_SKILL_RESULTS);
163
164 $question_list = new ilAssQuestionList($this->db, $this->lng, $this->refinery, $this->component_repository);
165 $question_list->setParentObjId($this->test_object->getId());
166 $question_list->setQuestionInstanceTypeFilter(null);
167 $question_list->load();
168
169 $gui = new ilTestSkillEvaluationGUI(
170 $this->test_object,
171 $this->ctrl,
172 $this->main_tpl,
173 $this->lng,
174 $this->db,
175 $this->logger,
176 $this->skills_service,
177 $this->testrequest
178 );
179 $gui->setQuestionList($question_list);
180 $gui->setTestSession(
182 $this->test_object,
183 $this->db,
184 $this->user
185 ))->getSession()
186 );
187 $gui->setObjectiveOrientedContainer($this->objective_parent);
188
189 $this->ctrl->forwardCommand($gui);
190 break;
191
192 case strtolower(__CLASS__):
193 default:
194 $command = $this->ctrl->getCmd(self::DEFAULT_CMD) . 'Cmd';
195 $this->{$command}();
196 }
197 }
static http()
Fetches the global http state from ILIAS.

References ILIAS\Repository\ctrl(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\logger(), ILIAS\Repository\refinery(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ showCmd()

ilTestResultsGUI::showCmd ( )
protected

Definition at line 199 of file class.ilTestResultsGUI.php.

199 : void
200 {
201 if ($this->test_object->canShowTestResults($this->test_session)) {
202 if ($this->objective_parent->isObjectiveOrientedPresentationRequired()) {
203 $this->ctrl->redirectByClass('ilTestEvalObjectiveOrientedGUI');
204 }
205
206 $this->ctrl->redirectByClass(['ilMyTestResultsGUI', 'ilTestEvaluationGUI']);
207 }
208
209 $validator = new ilCertificateDownloadValidator();
210 if ($validator->isCertificateDownloadable($this->user->getId(), $this->test_object->getId())) {
211 $button = $this->ui->factory()->button()->standard('certficiate', $this->ctrl->getFormActionByClass(ilTestEvaluationGUI::class, 'outCertificate'));
212 $this->toolbar->addComponent($button);
213 }
214
216 }
Validates if an active certificate is stored in the database and can be downloaded by the user.

References ILIAS\Repository\ctrl(), showNoResultsReportingMessage(), ILIAS\Repository\toolbar(), and ILIAS\Repository\ui().

+ Here is the call graph for this function:

◆ showNoResultsReportingMessage()

ilTestResultsGUI::showNoResultsReportingMessage ( )
protected

Definition at line 218 of file class.ilTestResultsGUI.php.

218 : void
219 {
220 $message = $this->lng->txt('tst_res_tab_msg_res_after_taking_test');
221
222 switch ($this->test_object->getScoreReporting()) {
223 case ScoreReportingTypes::SCORE_REPORTING_FINISHED:
224 if ($this->test_object->hasAnyTestResult($this->test_session)) {
225 $message = $this->lng->txt('tst_res_tab_msg_res_after_finish_test');
226 }
227
228 break;
229
230 case ScoreReportingTypes::SCORE_REPORTING_DATE:
231 $date = $this->test_object->getScoreSettings()->getResultSummarySettings()->getReportingDate()
232 ->setTimezone(new \DateTimeZone($this->user->getTimeZone()));
233
234 if (!$this->test_object->hasAnyTestResult($this->test_session)) {
235 $message = sprintf(
236 $this->lng->txt('tst_res_tab_msg_res_after_date_no_res'),
237 $date->format($this->user->getDateTimeFormat()->toString())
238 );
239 break;
240 }
241
242 $message = sprintf(
243 $this->lng->txt('tst_res_tab_msg_res_after_date'),
244 $date->format($this->user->getDateTimeFormat()->toString())
245 );
246 break;
247
248 case ScoreReportingTypes::SCORE_REPORTING_AFTER_PASSED:
249 $message = $this->lng->txt('tst_res_tab_msg_res_after_test_passed');
250 break;
251 }
252
253 $this->main_tpl->setOnScreenMessage('info', $message);
254 }
$message
Definition: xapiexit.php:31

References $message, ILIAS\Repository\lng(), and ILIAS\Repository\user().

Referenced by showCmd().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $ui

ILIAS DI UIServices ilTestResultsGUI::$ui
private

Definition at line 52 of file class.ilTestResultsGUI.php.

◆ DEFAULT_CMD

const ilTestResultsGUI::DEFAULT_CMD = 'show'

Definition at line 51 of file class.ilTestResultsGUI.php.


The documentation for this class was generated from the following file: