ILIAS  trunk Revision v11.0_alpha-1811-gd2d5443e411
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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.

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

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  $questionList = new ilAssQuestionList($this->db, $this->lng, $this->refinery, $this->component_repository);
165  $questionList->setParentObjId($this->test_object->getId());
166  $questionList->load();
167 
168  $testSessionFactory = new ilTestSessionFactory($this->test_object, $this->db, $this->user);
169  $testSession = $testSessionFactory->getSession();
170 
171  $gui = new ilTestSkillEvaluationGUI(
172  $this->test_object,
173  $this->ctrl,
174  $this->main_tpl,
175  $this->lng,
176  $this->db,
177  $this->logger,
178  $this->skills_service,
179  $this->testrequest
180  );
181  $gui->setQuestionList($questionList);
182  $gui->setTestSession($testSession);
183  $gui->setObjectiveOrientedContainer($this->objective_parent);
184 
185  $this->ctrl->forwardCommand($gui);
186  break;
187 
188  case strtolower(__CLASS__):
189  default:
190  $command = $this->ctrl->getCmd(self::DEFAULT_CMD) . 'Cmd';
191  $this->{$command}();
192  }
193  }
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:

◆ showCmd()

ilTestResultsGUI::showCmd ( )
protected

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

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

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

◆ showNoResultsReportingMessage()

ilTestResultsGUI::showNoResultsReportingMessage ( )
protected

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

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

Referenced by showCmd().

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