ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilTestResultsGUI Class Reference
+ Collaboration diagram for ilTestResultsGUI:

Public Member Functions

 __construct (ilObjTest $testObj, ilTestQuestionSetConfig $questionSetConfig)
 ilTestParticipantsGUI constructor. More...
 
 getObjectiveParent ()
 
 setObjectiveParent ($objectiveParent)
 
 getTestObj ()
 
 setTestObj ($testObj)
 
 getQuestionSetConfig ()
 
 setQuestionSetConfig ($questionSetConfig)
 
 getTestAccess ()
 
 setTestAccess ($testAccess)
 
 getTestSession ()
 
 setTestSession ($testSession)
 
 getTestTabs ()
 
 setTestTabs ($testTabs)
 
 executeCommand ()
 Execute Command. More...
 

Data Fields

const DEFAULT_CMD = 'show'
 

Protected Member Functions

 showCmd ()
 
 showNoResultsReportingMessage ()
 

Protected Attributes

 $testObj
 
 $questionSetConfig
 
 $testAccess
 
 $testSession
 
 $testTabs
 
 $objectiveParent
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilTestResultsGUI::__construct ( ilObjTest  $testObj,
ilTestQuestionSetConfig  $questionSetConfig 
)

ilTestParticipantsGUI constructor.

Parameters
ilObjTest$testObj

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

59 {
60 $this->testObj = $testObj;
61 $this->questionSetConfig = $questionSetConfig;
62 }

References $questionSetConfig, and $testObj.

Member Function Documentation

◆ executeCommand()

ilTestResultsGUI::executeCommand ( )

Execute Command.

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

164 {
165 global $DIC; /* @var ILIAS\DI\Container $DIC */
166
167 $this->getTestTabs()->activateTab(ilTestTabsManager::TAB_ID_RESULTS);
168 $this->getTestTabs()->getResultsSubTabs();
169
170 switch ($DIC->ctrl()->getNextClass()) {
171 case 'ilparticipantstestresultsgui':
172
173 if (!$this->getTestAccess()->checkManageParticipantsAccess() && !$this->getTestAccess()->checkParticipantsResultsAccess()) {
175 }
176
178
179 require_once 'Modules/Test/classes/class.ilParticipantsTestResultsGUI.php';
180 $gui = new ilParticipantsTestResultsGUI();
181 $gui->setTestObj($this->getTestObj());
182 $gui->setQuestionSetConfig($this->getQuestionSetConfig());
183 $gui->setTestAccess($this->getTestAccess());
184 $gui->setObjectiveParent($this->getObjectiveParent());
185 $DIC->ctrl()->forwardCommand($gui);
186 break;
187
188 case 'ilmytestresultsgui':
189
190 if (!$this->getTestTabs()->needsMyResultsSubTab()) {
192 }
193
195
196 require_once 'Modules/Test/classes/class.ilMyTestResultsGUI.php';
197 $gui = new ilMyTestResultsGUI();
198 $gui->setTestObj($this->getTestObj());
199 $gui->setTestAccess($this->getTestAccess());
200 $gui->setTestSession($this->getTestSession());
201 $gui->setObjectiveParent($this->getObjectiveParent());
202 $DIC->ctrl()->forwardCommand($gui);
203 break;
204
205 case 'iltestevalobjectiveorientedgui':
206
207 if (!$this->getTestTabs()->needsLoResultsSubTab()) {
209 }
210
212
213 require_once 'Modules/Test/classes/class.ilTestEvalObjectiveOrientedGUI.php';
214 $gui = new ilTestEvalObjectiveOrientedGUI($this->getTestObj());
215 $gui->setObjectiveOrientedContainer($this->getObjectiveParent());
216 $DIC->ctrl()->forwardCommand($gui);
217 break;
218
219 case 'ilmytestsolutionsgui':
220
221 if (!$this->getTestTabs()->needsMySolutionsSubTab()) {
223 }
224
226
227 require_once 'Modules/Test/classes/class.ilMyTestSolutionsGUI.php';
228 $gui = new ilMyTestSolutionsGUI();
229 $gui->setTestObj($this->getTestObj());
230 $gui->setTestAccess($this->getTestAccess());
231 $gui->setObjectiveParent($this->getObjectiveParent());
232 $DIC->ctrl()->forwardCommand($gui);
233 break;
234
235 case 'iltesttoplistgui':
236
237 if (!$this->getTestTabs()->needsHighSoreSubTab()) {
239 }
240
241 $this->getTestTabs()->activateSubTab(ilTestTabsManager::SUBTAB_ID_HIGHSCORE);
242
243 require_once './Modules/Test/classes/class.ilTestToplistGUI.php';
244 $gui = new ilTestToplistGUI($this->getTestObj());
245 $DIC->ctrl()->forwardCommand($gui);
246 break;
247
248 case 'iltestskillevaluationgui':
249
251
252 global $DIC; /* @var ILIAS\DI\Container $DIC */
253 require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionList.php';
254 if ($this->getTestObj()->isDynamicTest()) {
255 require_once 'Modules/Test/classes/class.ilObjTestDynamicQuestionSetConfig.php';
256 $dynamicQuestionSetConfig = new ilObjTestDynamicQuestionSetConfig(
257 $DIC->repositoryTree(),
258 $DIC->database(),
259 $DIC['ilPluginAdmin'],
260 $this->getTestObj()
261 );
262 $dynamicQuestionSetConfig->loadFromDb();
263 $questionList = new ilAssQuestionList($DIC->database(), $DIC->language(), $DIC['ilPluginAdmin']);
264 $questionList->setParentObjId($dynamicQuestionSetConfig->getSourceQuestionPoolId());
265 $questionList->setQuestionInstanceTypeFilter(ilAssQuestionList::QUESTION_INSTANCE_TYPE_ORIGINALS);
266 } else {
267 $questionList = new ilAssQuestionList($DIC->database(), $DIC->language(), $DIC['ilPluginAdmin']);
268 $questionList->setParentObjId($this->getTestObj()->getId());
269 $questionList->setQuestionInstanceTypeFilter(ilAssQuestionList::QUESTION_INSTANCE_TYPE_DUPLICATES);
270 }
271 $questionList->load();
272
273 require_once 'Modules/Test/classes/class.ilTestSessionFactory.php';
274 $testSessionFactory = new ilTestSessionFactory($this->getTestObj());
275 $testSession = $testSessionFactory->getSession();
276
277 require_once 'Modules/Test/classes/class.ilTestSkillEvaluationGUI.php';
278 $gui = new ilTestSkillEvaluationGUI(
279 $DIC->ctrl(),
280 $DIC->tabs(),
281 $DIC->ui()->mainTemplate(),
282 $DIC->language(),
283 $DIC->database(),
284 $this->getTestObj()
285 );
286 $gui->setQuestionList($questionList);
287 $gui->setTestSession($testSession);
288 $gui->setObjectiveOrientedContainer($this->getObjectiveParent());
289
290 $DIC->ctrl()->forwardCommand($gui);
291 break;
292
293 case strtolower(__CLASS__):
294 default:
295
296 $command = $DIC->ctrl()->getCmd(self::DEFAULT_CMD) . 'Cmd';
297 $this->{$command}();
298 }
299 }
static accessViolationRedirect()
$DIC
Definition: xapitoken.php:46

References $DIC, $testSession, ilObjTestGUI\accessViolationRedirect(), getObjectiveParent(), getQuestionSetConfig(), getTestAccess(), getTestObj(), getTestSession(), getTestTabs(), ilAssQuestionList\QUESTION_INSTANCE_TYPE_DUPLICATES, ilAssQuestionList\QUESTION_INSTANCE_TYPE_ORIGINALS, ilTestTabsManager\SUBTAB_ID_HIGHSCORE, ilTestTabsManager\SUBTAB_ID_LO_RESULTS, ilTestTabsManager\SUBTAB_ID_MY_RESULTS, ilTestTabsManager\SUBTAB_ID_MY_SOLUTIONS, ilTestTabsManager\SUBTAB_ID_PARTICIPANTS_RESULTS, ilTestTabsManager\SUBTAB_ID_SKILL_RESULTS, and ilTestTabsManager\TAB_ID_RESULTS.

+ Here is the call graph for this function:

◆ getObjectiveParent()

ilTestResultsGUI::getObjectiveParent ( )
Returns
ilTestObjectiveOrientedContainer

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

References $objectiveParent.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ getQuestionSetConfig()

ilTestResultsGUI::getQuestionSetConfig ( )
Returns
ilTestQuestionSetConfig

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

100 {
102 }

References $questionSetConfig.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ getTestAccess()

ilTestResultsGUI::getTestAccess ( )
Returns
ilTestAccess

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

116 {
117 return $this->testAccess;
118 }

References $testAccess.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ getTestObj()

ilTestResultsGUI::getTestObj ( )
Returns
ilObjTest

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

84 {
85 return $this->testObj;
86 }

References $testObj.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ getTestSession()

ilTestResultsGUI::getTestSession ( )
Returns
ilTestSession

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

132 {
133 return $this->testSession;
134 }

References $testSession.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ getTestTabs()

ilTestResultsGUI::getTestTabs ( )
Returns
ilTestTabsManager

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

148 {
149 return $this->testTabs;
150 }

References $testTabs.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ setObjectiveParent()

ilTestResultsGUI::setObjectiveParent (   $objectiveParent)
Parameters
ilTestObjectiveOrientedContainer$objectiveParent

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

76 {
77 $this->objectiveParent = $objectiveParent;
78 }

References $objectiveParent.

◆ setQuestionSetConfig()

ilTestResultsGUI::setQuestionSetConfig (   $questionSetConfig)
Parameters
ilTestQuestionSetConfig$questionSetConfig

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

108 {
109 $this->questionSetConfig = $questionSetConfig;
110 }

References $questionSetConfig.

◆ setTestAccess()

ilTestResultsGUI::setTestAccess (   $testAccess)
Parameters
ilTestAccess$testAccess

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

124 {
125 $this->testAccess = $testAccess;
126 }

References $testAccess.

◆ setTestObj()

ilTestResultsGUI::setTestObj (   $testObj)
Parameters
ilObjTest$testObj

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

92 {
93 $this->testObj = $testObj;
94 }

References $testObj.

◆ setTestSession()

ilTestResultsGUI::setTestSession (   $testSession)
Parameters
ilTestSession$testSession

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

140 {
141 $this->testSession = $testSession;
142 }

References $testSession.

◆ setTestTabs()

ilTestResultsGUI::setTestTabs (   $testTabs)
Parameters
ilTestTabsManager$testTabs

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

156 {
157 $this->testTabs = $testTabs;
158 }

References $testTabs.

◆ showCmd()

ilTestResultsGUI::showCmd ( )
protected

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

302 {
303 global $DIC; /* @var ILIAS\DI\Container $DIC */
304
305 if ($this->testObj->canShowTestResults($this->getTestSession())) {
306 if ($this->objectiveParent->isObjectiveOrientedPresentationRequired()) {
307 $DIC->ctrl()->redirectByClass('ilTestEvalObjectiveOrientedGUI');
308 }
309
310 $DIC->ctrl()->redirectByClass(array('ilMyTestResultsGUI', 'ilTestEvaluationGUI'));
311 }
312
313 $toolbar = $DIC->toolbar();
314 $validator = new ilCertificateDownloadValidator();
315 if ($validator->isCertificateDownloadable($DIC->user()->getId(), $this->getTestObj()->getId())) {
316 $button = ilLinkButton::getInstance();
317 $button->setCaption('certificate');
318 $button->setUrl($DIC->ctrl()->getFormActionByClass(ilTestEvaluationGUI::class, 'outCertificate'));
319 $toolbar->addButtonInstance($button);
320 }
321
323 }
Validates if an active certificate is stored in the database and can be downloaded by the user.
static getInstance()
Factory.

References $DIC, ilLinkButton\getInstance(), and showNoResultsReportingMessage().

+ Here is the call graph for this function:

◆ showNoResultsReportingMessage()

ilTestResultsGUI::showNoResultsReportingMessage ( )
protected

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

326 {
327 global $DIC; /* @var ILIAS\DI\Container $DIC */
328
329 $message = $DIC->language()->txt('tst_res_tab_msg_res_after_taking_test');
330
331 switch ($this->testObj->getScoreReporting()) {
333
334 if ($this->testObj->hasAnyTestResult($this->getTestSession())) {
335 $message = $DIC->language()->txt('tst_res_tab_msg_res_after_finish_test');
336 }
337
338 break;
339
341
342 $date = new ilDateTime($this->testObj->getReportingDate(), IL_CAL_TIMESTAMP);
343
344 if (!$this->testObj->hasAnyTestResult($this->getTestSession())) {
345 $message = sprintf(
346 $DIC->language()->txt('tst_res_tab_msg_res_after_date_no_res'),
348 );
349 break;
350 }
351
352 $message = sprintf(
353 $DIC->language()->txt('tst_res_tab_msg_res_after_date'),
355 );
356 break;
357
359 $message = $DIC->language()->txt('tst_res_tab_msg_res_after_test_passed');
360 break;
361 }
362
364 }
const IL_CAL_TIMESTAMP
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date @access public.
@classDescription Date and time handling
const SCORE_REPORTING_FINISHED
const SCORE_REPORTING_AFTER_PASSED
const SCORE_REPORTING_DATE
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
$message
Definition: xapiexit.php:14

References $DIC, $message, ilDatePresentation\formatDate(), IL_CAL_TIMESTAMP, ilObjTest\SCORE_REPORTING_AFTER_PASSED, ilObjTest\SCORE_REPORTING_DATE, ilObjTest\SCORE_REPORTING_FINISHED, and ilUtil\sendInfo().

Referenced by showCmd().

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

Field Documentation

◆ $objectiveParent

ilTestResultsGUI::$objectiveParent
protected

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

Referenced by getObjectiveParent(), and setObjectiveParent().

◆ $questionSetConfig

ilTestResultsGUI::$questionSetConfig
protected

◆ $testAccess

ilTestResultsGUI::$testAccess
protected

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

Referenced by getTestAccess(), and setTestAccess().

◆ $testObj

ilTestResultsGUI::$testObj
protected

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

Referenced by __construct(), getTestObj(), and setTestObj().

◆ $testSession

ilTestResultsGUI::$testSession
protected

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

Referenced by executeCommand(), getTestSession(), and setTestSession().

◆ $testTabs

ilTestResultsGUI::$testTabs
protected

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

Referenced by getTestTabs(), and setTestTabs().

◆ DEFAULT_CMD

const ilTestResultsGUI::DEFAULT_CMD = 'show'

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


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