ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilTestSubmissionReviewGUI Class Reference

Class ilTestSubmissionReviewGUI. More...

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

Public Member Functions

 __construct (protected ilTestOutputGUI $test_output_gui, ilObjTest $testOBJ, protected ilTestSession $testSession)
 
 executeCommand ()
 
- Public Member Functions inherited from ilTestServiceGUI
 isContextResultPresentation ()
 
 setContextResultPresentation (bool $contextResultPresentation)
 
 setParticipantData (ilTestParticipantData $participantData)
 
 getParticipantData ()
 
 getPassOverviewTableData (ilTestSession $testSession, $passes, $withResults)
 This method uses the data of a given test pass to create an evaluation for displaying into a table used in the ilTestEvaluationGUI. More...
 
 setObjectiveOrientedContainer (ilTestObjectiveOrientedContainer $objective_oriented_container)
 
 getObjectiveOrientedContainer ()
 
 executeCommand ()
 execute command More...
 
 getCommand ($cmd)
 Retrieves the ilCtrl 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, ilTestResultHeaderLabelBuilder $testResultHeaderLabelBuilder=null)
 Returns the list of answers of a users test pass. More...
 
 getPassListOfAnswersWithScoring (&$result_array, $active_id, $pass, $show_solutions=false)
 Returns the list of answers of a users test pass and offers a scoring option. 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...
 
 getResultsOfUserOutput (ilTestSession $testSession, int $active_id, int $pass, ilParticipantsTestResultsGUI $target_gui, bool $show_pass_details=true, bool $show_answers=true, bool $show_question_only=false, bool $show_reached_points=false)
 Output of the pass overview for a test called by a test participant. More...
 
 getResultsHeadUserAndPass ($active_id, $pass)
 Returns the user and pass data for a test results output. More...
 
 getQuestionResultForTestUsers (int $question_id, int $test_id)
 
 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|ilParticipantsTestResultsGUI $target_gui, string $target_cmd, ilTestQuestionRelatedObjectivesList $objectives_list=null, bool $multiple_objectives_involved=true)
 
 buildPassDetailsOverviewTableGUI (ilTestServiceGUI|ilParticipantsTestResultsGUI $target_gui, string $target_cmd)
 
 isGradingMessageRequired ()
 
 getGradingMessageBuilder (int $active_id)
 
 buildQuestionRelatedObjectivesList (ilLOTestQuestionAdapter $objectives_adapter, ilTestQuestionSequence $test_sequence)
 
 getFilteredTestResult (int $active_id, int $pass, bool $considerHiddenQuestions, bool $considerOptionalQuestions)
 
 populateContent ($content)
 
 buildUserTestResultsToolbarGUI ()
 
 outCorrectSolutionCmd ()
 
 outCorrectSolution ()
 Creates an output of the solution of an answer compared to the correct solution. More...
 
 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
InternalRequestService $testrequest
 
ILIAS TestQuestionPool QuestionInfoService $questioninfo
 
ilTestService $service = null
 
ilDBInterface $db
 
ilLanguage $lng
 
LoggingServices $logging_services
 
ilHelpGUI $help
 
ilRbacSystem $rbac_system
 
ilGlobalTemplateInterface ilTemplate $tpl
 sk 2023-08-01: We need this union type, even if it is wrong! To change this More...
 
ContentStyle $content_style
 
ilErrorHandling $error
 
ilAccess $access
 
HTTPServices $http
 
ilCtrl $ctrl
 
ilToolbarGUI $toolbar
 
ilTabsGUI $tabs
 
ilObjectDataCache $obj_cache
 
ilComponentRepository $component_repository
 
ilObjUser $user
 
ArrayBasedRequestWrapper $post_wrapper
 
ilNavigationHistory $navigation_history
 
Refinery $refinery
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 
SkillService $skills_service
 
ilTestShuffler $shuffler
 
ilTestResultsFactory $results_factory
 
ilTestResultsPresentationFactory $results_presentation_factory
 
ILIAS $ilias
 
ilSetting $settings
 
GlobalScreenServices $global_screen
 
ilTree $tree
 
int $ref_id
 
ilTestSessionFactory $testSessionFactory = null
 
ilTestSequenceFactory $testSequenceFactory = null
 
ilTestParticipantData $participantData = null
 
ilTestParticipantAccessFilterFactory $participant_access_filter
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilTestSubmissionReviewGUI::__construct ( protected ilTestOutputGUI  $test_output_gui,
ilObjTest  $testOBJ,
protected ilTestSession  $testSession 
)

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

References ILIAS\MetaData\Repository\Validation\Data\__construct().

40  {
41  parent::__construct($testOBJ);
42  }
__construct(VocabulariesInterface $vocabularies)
+ Here is the call graph for this function:

Member Function Documentation

◆ buildToolbar()

ilTestSubmissionReviewGUI::buildToolbar (   $toolbarId)
protected
Returns
ilToolbarGUI

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

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

Referenced by show().

89  : ilToolbarGUI
90  {
91  $toolbar = new ilToolbarGUI();
92  $toolbar->setId($toolbarId);
93 
94  $back_url = $this->ctrl->getLinkTarget(
95  $this->test_output_gui,
96  $this->object->getListOfQuestionsEnd() ?
98  );
99 
101  $this->ui_factory->button()->standard($this->lng->txt('tst_resume_test'), $back_url)
102  );
103 
104  if ($this->finish_test_modal === null) {
105  $class = get_class($this->test_output_gui);
106  $this->ctrl->setParameterByClass($class, 'reviewed', 1);
107  $this->finish_test_modal = $this->test_output_gui->buildFinishTestModal();
108  $this->ctrl->setParameterByClass($class, 'reviewed', 0);
109  }
110 
112  $this->ui_factory->button()->primary($this->lng->txt('finish_test'), $this->finish_test_modal->getShowSignal())
113  );
114 
115  return $toolbar;
116  }
addComponent(\ILIAS\UI\Component\Component $a_comp)
setId(string $a_val)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildUserReviewOutput()

ilTestSubmissionReviewGUI::buildUserReviewOutput ( )
protected

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

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

Referenced by show().

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

◆ dispatchCommand()

ilTestSubmissionReviewGUI::dispatchCommand ( )
protected

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

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

Referenced by executeCommand().

60  {
61  switch ($this->ctrl->getCmd()) {
62  case 'show':
63  default:
64  $this->show();
65  }
66  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilTestSubmissionReviewGUI::executeCommand ( )

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

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

44  : string
45  {
46  if (!$this->object->getEnableExamview()) {
47  return '';
48  }
49 
50  switch ($this->ctrl->getNextClass($this)) {
51  default:
52  $this->dispatchCommand();
53  break;
54  }
55 
56  return '';
57  }
+ 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 public

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

References ILIAS\Repository\object().

Referenced by show().

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

◆ show()

ilTestSubmissionReviewGUI::show ( )
protected

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

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

Referenced by dispatchCommand().

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


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