ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilTestSubmissionReviewGUI Class Reference

Class ilTestSubmissionReviewGUI. More...

+ Inheritance diagram for ilTestSubmissionReviewGUI:
+ Collaboration diagram for ilTestSubmissionReviewGUI:

Public Member Functions

 __construct (protected ilTestPlayerAbstractGUI $test_player_gui, ilObjTest $testOBJ, protected ilTestSession $testSession)
 
 executeCommand ()
 execute command More...
 
- Public Member Functions inherited from ilTestServiceGUI
 isContextResultPresentation ()
 
 setContextResultPresentation (bool $contextResultPresentation)
 
 setParticipantData (ilTestParticipantData $participantData)
 
 getParticipantData ()
 
 getPassOverviewTableData (ilTestSession $test_session, array $passes, bool $with_results)
 
 setObjectiveOrientedContainer (ilTestObjectiveOrientedContainer $objective_oriented_container)
 
 getObjectiveOrientedContainer ()
 
 executeCommand ()
 execute command More...
 
 buildPassOverviewTableGUI (ilTestEvaluationGUI $target_gui)
 
 getPassListOfAnswers (&$result_array, $active_id, $pass, $show_solutions=false, $only_answered_questions=false, $show_question_only=false, $show_reached_points=false, $anchorNav=false, ?ilTestQuestionRelatedObjectivesList $objectives_list=null, ?ResultsTitlesBuilder $testResultHeaderLabelBuilder=null)
 Returns the list of answers of a users test pass. More...
 
 getResultsSignature ()
 Returns HTML code for a signature field. More...
 
 getAdditionalUsrDataHtmlAndPopulateWindowTitle ($testSession, $active_id, $overwrite_anonymity=false)
 Returns the user data for a test results output. More...
 
 getCorrectSolutionOutput ($question_id, $active_id, $pass, ?ilTestQuestionRelatedObjectivesList $objectives_list=null)
 Returns an output of the solution to an answer compared to the correct solution. More...
 
 getObject ()
 

Protected Member Functions

 dispatchCommand ()
 
 buildToolbar ($toolbarId)
 
 buildUserReviewOutput ()
 
 show ()
 
- Protected Member Functions inherited from ilTestServiceGUI
 getPassDetailsOverviewTableGUI (array $result_array, int $active_id, int $pass, ilTestServiceGUI $target_gui, string $target_cmd, ?ilTestQuestionRelatedObjectivesList $objectives_list=null, bool $multiple_objectives_involved=true)
 
 buildPassDetailsOverviewTableGUI (ilTestServiceGUI $target_gui, string $target_cmd)
 
 isGradingMessageRequired ()
 
 getGradingMessageBuilder (int $active_id)
 
 buildQuestionRelatedObjectivesList (ilLOTestQuestionAdapter $objectives_adapter, ilTestQuestionSequence $test_sequence)
 
 populateContent (string $content)
 
 outCorrectSolutionCmd ()
 
 outCorrectSolution ()
 
 populatePassFinishDate (ilTemplate $tpl, ?int $pass_finish_date)
 
 populateExamId (ilTemplate $tpl, int $active_id, int $pass)
 

Private Member Functions

 getContentBlockName ()
 Returns the name of the current content block (depends on the kiosk mode setting) More...
 

Private Attributes

InterruptiveModal $finish_test_modal = null
 

Additional Inherited Members

- Protected Attributes inherited from ilTestServiceGUI
readonly RequestDataCollector $testrequest
 
readonly GeneralQuestionPropertiesRepository $questionrepository
 
readonly TestQuestionsRepository $testquestionsrepository
 
ilTestService $service = null
 
readonly ilDBInterface $db
 
readonly ilLanguage $lng
 
readonly TestLogger $logger
 
readonly ilHelpGUI $help
 
readonly ilRbacSystem $rbac_system
 
ilGlobalTemplateInterface ilTemplate $tpl
 sk 2023-08-01: We need this union type, even if it is wrong! To change this More...
 
readonly ContentStyle $content_style
 
readonly ilErrorHandling $error
 
ilAccess $access
 
readonly HTTPServices $http
 
readonly ilCtrlInterface $ctrl
 
readonly ilToolbarGUI $toolbar
 
readonly ilTabsGUI $tabs
 
readonly ilObjectDataCache $obj_cache
 
readonly ilComponentRepository $component_repository
 
readonly ilObjUser $user
 
readonly ArrayBasedRequestWrapper $post_wrapper
 
readonly ilNavigationHistory $navigation_history
 
readonly Refinery $refinery
 
readonly UIFactory $ui_factory
 
readonly UIRenderer $ui_renderer
 
readonly SkillService $skills_service
 
readonly ilTestShuffler $shuffler
 
readonly ResultsDataFactory $results_data_factory
 
readonly ResultsPresentationFactory $results_presentation_factory
 
readonly ILIAS $ilias
 
readonly ilSetting $settings
 
readonly GlobalScreenServices $global_screen
 
readonly ilTree $tree
 
int $ref_id
 
ilTestSessionFactory $test_session_factory = null
 
ilTestSequenceFactory $test_sequence_factory = null
 
ilTestParticipantData $participantData = null
 
TestResultRepository $test_result_repository
 
ilTestParticipantAccessFilterFactory $participant_access_filter
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilTestSubmissionReviewGUI::__construct ( protected ilTestPlayerAbstractGUI  $test_player_gui,
ilObjTest  $testOBJ,
protected ilTestSession  $testSession 
)

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

41 {
42 parent::__construct($testOBJ);
43 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Member Function Documentation

◆ buildToolbar()

ilTestSubmissionReviewGUI::buildToolbar (   $toolbarId)
protected
Returns
ilToolbarGUI

Definition at line 90 of file class.ilTestSubmissionReviewGUI.php.

91 {
92 $toolbar = new ilToolbarGUI();
93 $toolbar->setId($toolbarId);
94
95 $back_url = $this->ctrl->getLinkTarget(
96 $this->test_player_gui,
97 $this->object->getListOfQuestionsEnd() ?
99 );
100
102 $this->ui_factory->button()->standard($this->lng->txt('tst_resume_test'), $back_url)
103 );
104
105 if ($this->finish_test_modal === null) {
106 $class = get_class($this->test_player_gui);
107 $this->ctrl->setParameterByClass($class, 'reviewed', 1);
108 $this->finish_test_modal = $this->test_player_gui->buildFinishTestModal();
109 $this->ctrl->setParameterByClass($class, 'reviewed', 0);
110 }
111
113 $this->ui_factory->button()->primary($this->lng->txt('finish_test'), $this->finish_test_modal->getShowSignal())
114 );
115
116 return $toolbar;
117 }
readonly ilToolbarGUI $toolbar
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setId(string $a_val)
addComponent(\ILIAS\UI\Component\Component $a_comp)

References ilTestServiceGUI\$toolbar, ilToolbarGUI\addComponent(), ilTestPlayerCommands\BACK_FROM_FINISHING, ILIAS\Repository\ctrl(), ILIAS\Repository\object(), ilTestPlayerCommands\QUESTION_SUMMARY, and ilToolbarGUI\setId().

Referenced by show().

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

◆ buildUserReviewOutput()

ilTestSubmissionReviewGUI::buildUserReviewOutput ( )
protected

Definition at line 119 of file class.ilTestSubmissionReviewGUI.php.

119 : string
120 {
121 $testResultHeaderLabelBuilder = new ResultsTitlesBuilder($this->lng, $this->obj_cache);
122
123 $objectivesList = null;
124
125 if ($this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) {
126 $testSequence = $this->test_sequence_factory->getSequenceByActiveIdAndPass($this->testSession->getActiveId(), $this->testSession->getPass());
127 $testSequence->loadFromDb();
128 $testSequence->loadQuestions();
129
130 $objectivesAdapter = ilLOTestQuestionAdapter::getInstance($this->testSession);
131
132 $objectivesList = $this->buildQuestionRelatedObjectivesList($objectivesAdapter, $testSequence);
133 $objectivesList->loadObjectivesTitles();
134
135 $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($this->testSession->getObjectiveOrientedContainerId());
136 $testResultHeaderLabelBuilder->setUserId($this->testSession->getUserId());
137 $testResultHeaderLabelBuilder->setTestObjId($this->object->getId());
138 $testResultHeaderLabelBuilder->setTestRefId($this->object->getRefId());
139 $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
140 }
141
142 $results = $this->object->getTestResult(
143 $this->testSession->getActiveId(),
144 $this->testSession->getPass(),
145 false,
146 !$this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()
147 );
148
149 $testevaluationgui = new ilTestEvaluationGUI($this->object);
150 $testevaluationgui->setContextResultPresentation(false);
151
152 $results_output = $testevaluationgui->getPassListOfAnswers(
153 $results,
154 $this->testSession->getActiveId(),
155 $this->testSession->getPass(),
156 false,
157 false,
158 false,
159 false,
160 false,
161 $objectivesList,
162 $testResultHeaderLabelBuilder
163 );
164
165 return $results_output;
166 }
static getInstance(ilTestSession $a_test_session)
Output class for assessment test evaluation.
buildQuestionRelatedObjectivesList(ilLOTestQuestionAdapter $objectives_adapter, ilTestQuestionSequence $test_sequence)
$results

References $results, ilTestServiceGUI\buildQuestionRelatedObjectivesList(), ilLOTestQuestionAdapter\getInstance(), ilTestServiceGUI\getObjectiveOrientedContainer(), ILIAS\Repository\lng(), and ILIAS\Repository\object().

Referenced by show().

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

◆ dispatchCommand()

ilTestSubmissionReviewGUI::dispatchCommand ( )
protected

Definition at line 60 of file class.ilTestSubmissionReviewGUI.php.

61 {
62 switch ($this->ctrl->getCmd()) {
63 case 'show':
64 default:
65 $this->show();
66 }
67 }

References ILIAS\Repository\ctrl(), and show().

Referenced by executeCommand().

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

◆ executeCommand()

ilTestSubmissionReviewGUI::executeCommand ( )

execute command

Reimplemented from ilTestServiceGUI.

Definition at line 45 of file class.ilTestSubmissionReviewGUI.php.

45 : string
46 {
47 if (!$this->object->getEnableExamview()) {
48 return '';
49 }
50
51 switch ($this->ctrl->getNextClass($this)) {
52 default:
53 $this->dispatchCommand();
54 break;
55 }
56
57 return '';
58 }

References ILIAS\Repository\ctrl(), dispatchCommand(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ getContentBlockName()

ilTestSubmissionReviewGUI::getContentBlockName ( )
private

Returns the name of the current content block (depends on the kiosk mode setting)

Returns
string The name of the content block @access public

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

75 : string
76 {
77 if ($this->object->getKioskMode()) {
78 // See: https://mantis.ilias.de/view.php?id=27784
79 //$this->tpl->setBodyClass("kiosk");
80 $this->tpl->hideFooter();
81 return "CONTENT";
82 } else {
83 return "ADM_CONTENT";
84 }
85 }

References ILIAS\Repository\object().

Referenced by show().

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

◆ show()

ilTestSubmissionReviewGUI::show ( )
protected

Definition at line 168 of file class.ilTestSubmissionReviewGUI.php.

168 : void
169 {
170 $this->global_screen->tool()->context()->current()->getAdditionalData()->replace(
172 $this->object->getTitle() . ' - ' . $this->lng->txt('tst_results_overview')
173 );
174
175 $html = '';
176 if ($this->object->getEnableProcessingTime()) {
177 $active_id = $this->testSession->getActiveId();
178 $starting_time = $this->object->getStartingTimeOfUser($active_id);
179 $working_time = new WorkingTime(
180 $this->lng,
181 $this->ui_factory,
182 $this->ui_renderer,
183 $starting_time,
184 $this->object->getProcessingTimeInSeconds($active_id)
185 );
186
187 $html .= $working_time->getMessageBox(true);
188
189 $class = $this->getObject()->isFixedTest()
190 ? ilTestPlayerFixedQuestionSetGUI::class
191 : ilTestPlayerRandomQuestionSetGUI::class;
192
193 $working_time_js_template = $working_time->prepareWorkingTimeJsTemplate(
194 $this->getObject(),
195 getdate($starting_time),
196 $this->ctrl->getLinkTargetByClass($class, 'checkWorkingTime', '', true),
197 $this->ctrl->getFormActionByClass($class, ilTestPlayerCommands::REDIRECT_AFTER_QUESTION_LIST)
198 );
199
200 $this->tpl->addOnLoadCode($working_time_js_template->get());
201 }
202
203 $html .= $this->buildToolbar('review_nav_top')->getHTML();
204 $html .= $this->buildUserReviewOutput() . '<br />';
205 $html .= $this->buildToolbar('review_nav_bottom')->getHTML();
206
207 if ($this->object->isShowExamIdInTestPassEnabled() && !$this->object->getKioskMode()) {
208 $examIdTpl = new ilTemplate('tpl.exam_id_block.html', true, true, 'components/ILIAS/Test');
209 $examIdTpl->setVariable('EXAM_ID_VAL', ilObjTest::lookupExamId(
210 $this->testSession->getActiveId(),
211 $this->testSession->getPass(),
212 ));
213 $examIdTpl->setVariable('EXAM_ID_TXT', $this->lng->txt('exam_id'));
214 $html .= $examIdTpl->get();
215 }
216
217 $html .= $this->ui_renderer->render($this->finish_test_modal);
218
219 $this->tpl->setVariable($this->getContentBlockName(), $html);
220 }
static lookupExamId($active_id, $pass)
special template class to simplify handling of ITX/PEAR
getContentBlockName()
Returns the name of the current content block (depends on the kiosk mode setting)

References buildToolbar(), buildUserReviewOutput(), ILIAS\Repository\ctrl(), getContentBlockName(), ilTestServiceGUI\getObject(), ILIAS\Repository\lng(), ilObjTest\lookupExamId(), ILIAS\Repository\object(), ilTestPlayerCommands\REDIRECT_AFTER_QUESTION_LIST, and ilTestPlayerLayoutProvider\TEST_PLAYER_VIEW_TITLE.

Referenced by dispatchCommand().

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

Field Documentation

◆ $finish_test_modal

InterruptiveModal ilTestSubmissionReviewGUI::$finish_test_modal = null
private

Definition at line 35 of file class.ilTestSubmissionReviewGUI.php.


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