ILIAS  trunk Revision v12.0_alpha-1227-g7ff6d300864
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, private readonly ParticipantRepository $participant_repository)
 
 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,
private readonly ParticipantRepository  $participant_repository 
)

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

78 {
79 }

Member Function Documentation

◆ executeCommand()

ilTestResultsGUI::executeCommand ( )

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

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

184 : void
185 {
186 if ($this->test_object->canShowTestResults($this->test_session)) {
187 if ($this->objective_parent->isObjectiveOrientedPresentationRequired()) {
188 $this->ctrl->redirectByClass('ilTestEvalObjectiveOrientedGUI');
189 }
190
191 $this->ctrl->redirectByClass(['ilMyTestResultsGUI', 'ilTestEvaluationGUI']);
192 }
193
194 $validator = new ilCertificateDownloadValidator();
195 if ($validator->isCertificateDownloadable($this->user->getId(), $this->test_object->getId())) {
196 $button = $this->ui->factory()->button()->standard('certficiate', $this->ctrl->getFormActionByClass(ilTestEvaluationGUI::class, 'outCertificate'));
197 $this->toolbar->addComponent($button);
198 }
199
201 }
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 203 of file class.ilTestResultsGUI.php.

203 : void
204 {
205 $message = $this->lng->txt('tst_res_tab_msg_res_after_taking_test');
206
207 switch ($this->test_object->getScoreReporting()) {
208 case ScoreReportingTypes::SCORE_REPORTING_FINISHED:
209 if ($this->test_object->hasAnyTestResult($this->test_session)) {
210 $message = $this->lng->txt('tst_res_tab_msg_res_after_finish_test');
211 }
212
213 break;
214
215 case ScoreReportingTypes::SCORE_REPORTING_DATE:
216 $date = $this->test_object->getScoreSettings()->getResultSummarySettings()->getReportingDate()
217 ->setTimezone(new \DateTimeZone($this->user->getTimeZone()));
218
219 if (!$this->test_object->hasAnyTestResult($this->test_session)) {
220 $message = sprintf(
221 $this->lng->txt('tst_res_tab_msg_res_after_date_no_res'),
222 $date->format($this->user->getDateTimeFormat()->toString())
223 );
224 break;
225 }
226
227 $message = sprintf(
228 $this->lng->txt('tst_res_tab_msg_res_after_date'),
229 $date->format($this->user->getDateTimeFormat()->toString())
230 );
231 break;
232
233 case ScoreReportingTypes::SCORE_REPORTING_AFTER_PASSED:
234 $message = $this->lng->txt('tst_res_tab_msg_res_after_test_passed');
235 break;
236 }
237
238 $this->main_tpl->setOnScreenMessage('info', $message);
239 }

References 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: