ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
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 readonly ilComponentFactory $component_factory, private TabsManager $test_tabs, private readonly ilToolbarGUI $toolbar, private readonly ilGlobalTemplateInterface $main_tpl, private readonly UIFactory $ui_factory, private readonly SkillService $skills_service, private readonly ContentStyle $content_style, private readonly RequestDataCollector $testrequest, private readonly ilTestSession $test_session, private readonly ilTestObjectiveOrientedContainer $objective_parent)
 
 executeCommand ()
 

Data Fields

const DEFAULT_CMD = 'show'
 

Protected Member Functions

 showCmd ()
 
 showNoResultsReportingMessage ()
 

Detailed Description

Definition at line 47 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 readonly ilComponentFactory  $component_factory,
private TabsManager  $test_tabs,
private readonly ilToolbarGUI  $toolbar,
private readonly ilGlobalTemplateInterface  $main_tpl,
private readonly UIFactory  $ui_factory,
private readonly SkillService  $skills_service,
private readonly ContentStyle  $content_style,
private readonly RequestDataCollector  $testrequest,
private readonly ilTestSession  $test_session,
private readonly ilTestObjectiveOrientedContainer  $objective_parent 
)

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

71 {
72 }

Member Function Documentation

◆ executeCommand()

ilTestResultsGUI::executeCommand ( )

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

74 : void
75 {
76 $this->test_tabs->activateTab(TabsManager::TAB_ID_YOUR_RESULTS);
77 $this->test_tabs->getYourResultsSubTabs();
78
79 switch ($this->ctrl->getNextClass()) {
80 case 'ilmytestresultsgui':
81 if (!$this->test_tabs->needsYourResultsTab()) {
82 ilObjTestGUI::accessViolationRedirect();
83 }
84
85 $this->test_tabs->activateSubTab(
86 $this->ctrl->getCmd() === 'outUserListOfAnswerPasses'
87 ? TabsManager::SUBTAB_ID_MY_SOLUTIONS
88 : TabsManager::SUBTAB_ID_MY_RESULTS
89 );
90
91 $gui = new ilMyTestResultsGUI(
92 $this->test_object,
93 $this->test_access,
94 $this->objective_parent,
95 $this->lng,
96 $this->ctrl,
97 $this->main_tpl,
98 $this->content_style,
99 $this->testrequest
100 );
101 $this->ctrl->forwardCommand($gui);
102 break;
103
104 case 'iltestevalobjectiveorientedgui':
105 if (!$this->test_tabs->needsLoResultsSubTab()) {
106 ilObjTestGUI::accessViolationRedirect();
107 }
108
109 $this->test_tabs->activateSubTab(TabsManager::SUBTAB_ID_LO_RESULTS);
110
111 $gui = new ilTestEvalObjectiveOrientedGUI($this->test_object);
112 $gui->setObjectiveOrientedContainer($this->objective_parent);
113 $this->ctrl->forwardCommand($gui);
114 break;
115
116 case 'iltestskillevaluationgui':
117 $this->test_tabs->activateSubTab(TabsManager::SUBTAB_ID_SKILL_RESULTS);
118
119 $question_list = new ilAssQuestionList(
120 $this->db,
121 $this->lng,
122 $this->refinery,
123 $this->component_repository,
124 $this->component_factory
125 );
126 $question_list->setParentObjId($this->test_object->getId());
127 $question_list->setQuestionInstanceTypeFilter(null);
128 $question_list->load();
129
130 $gui = new ilTestSkillEvaluationGUI(
131 $this->test_object,
132 $this->ctrl,
133 $this->main_tpl,
134 $this->lng,
135 $this->db,
136 $this->logger,
137 $this->skills_service,
138 $this->testrequest
139 );
140 $gui->setQuestionList($question_list);
141 $gui->setTestSession(
143 $this->test_object,
144 $this->db,
145 $this->user
146 ))->getSession()
147 );
148 $gui->setObjectiveOrientedContainer($this->objective_parent);
149
150 $this->ctrl->forwardCommand($gui);
151 break;
152
153 case strtolower(__CLASS__):
154 default:
155 $command = $this->ctrl->getCmd(self::DEFAULT_CMD) . 'Cmd';
156 $this->{$command}();
157 }
158 }

References ILIAS\Repository\ctrl(), 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 160 of file class.ilTestResultsGUI.php.

160 : void
161 {
162 if ($this->test_object->canShowTestResults($this->test_session)) {
163 if ($this->objective_parent->isObjectiveOrientedPresentationRequired()) {
164 $this->ctrl->redirectByClass('ilTestEvalObjectiveOrientedGUI');
165 }
166
167 $this->ctrl->redirectByClass(['ilMyTestResultsGUI', 'ilTestEvaluationGUI']);
168 }
169
170 $validator = new ilCertificateDownloadValidator();
171 if ($validator->isCertificateDownloadable($this->user->getId(), $this->test_object->getId())) {
172 $button = $this->ui_factory->button()->standard('certficiate', $this->ctrl->getFormActionByClass(ilTestEvaluationGUI::class, 'outCertificate'));
173 $this->toolbar->addComponent($button);
174 }
175
177 }
Validates if an active certificate is stored in the database and can be downloaded by the user.

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

+ Here is the call graph for this function:

◆ showNoResultsReportingMessage()

ilTestResultsGUI::showNoResultsReportingMessage ( )
protected

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

179 : void
180 {
181 $message = $this->lng->txt('tst_res_tab_msg_res_after_taking_test');
182
183 switch ($this->test_object->getScoreReporting()) {
184 case ScoreReportingTypes::SCORE_REPORTING_FINISHED:
185 if ($this->test_object->hasAnyTestResult($this->test_session)) {
186 $message = $this->lng->txt('tst_res_tab_msg_res_after_finish_test');
187 }
188
189 break;
190
191 case ScoreReportingTypes::SCORE_REPORTING_DATE:
192 $date = $this->test_object->getScoreSettings()->getResultSummarySettings()->getReportingDate()
193 ->setTimezone(new \DateTimeZone($this->user->getTimeZone()));
194
195 if (!$this->test_object->hasAnyTestResult($this->test_session)) {
196 $message = sprintf(
197 $this->lng->txt('tst_res_tab_msg_res_after_date_no_res'),
198 $date->format($this->user->getDateTimeFormat()->toString())
199 );
200 break;
201 }
202
203 $message = sprintf(
204 $this->lng->txt('tst_res_tab_msg_res_after_date'),
205 $date->format($this->user->getDateTimeFormat()->toString())
206 );
207 break;
208
209 case ScoreReportingTypes::SCORE_REPORTING_AFTER_PASSED:
210 $message = $this->lng->txt('tst_res_tab_msg_res_after_test_passed');
211 break;
212 }
213
214 $this->main_tpl->setOnScreenMessage('info', $message);
215 }

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

◆ DEFAULT_CMD

const ilTestResultsGUI::DEFAULT_CMD = 'show'

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


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