ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilTestSubmissionReviewGUI Class Reference

Class ilTestSubmissionReviewGUI. More...

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

Public Member Functions

 __construct (ilTestOutputGUI $testOutputGUI, ilObjTest $testOBJ, ilTestSession $testSession)
 
 executeCommand ()
 execute command More...
 
- Public Member Functions inherited from ilTestServiceGUI
 isContextResultPresentation ()
 
 setContextResultPresentation ($contextResultPresentation)
 
 __construct (ilObjTest $a_object)
 The constructor takes the test object reference as parameter. More...
 
 setParticipantData ($participantData)
 
 getParticipantData ()
 
 getPassOverviewTableData (ilTestSession $testSession, $passes, $withResults)
 
 setObjectiveOrientedContainer (ilTestObjectiveOrientedContainer $objectiveOrientedContainer)
 
 getObjectiveOrientedContainer ()
 
 executeCommand ()
 execute command More...
 
 getCommand ($cmd)
 Retrieves the ilCtrl command. More...
 
 buildPassOverviewTableGUI ($targetGUI)
 
 getPassListOfAnswers (&$result_array, $active_id, $pass, $show_solutions=false, $only_answered_questions=false, $show_question_only=false, $show_reached_points=false, $anchorNav=false, ilTestQuestionRelatedObjectivesList $objectivesList=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 $objectivesList=null)
 Returns an output of the solution to an answer compared to the correct solution. More...
 
 getResultsOfUserOutput ($testSession, $active_id, $pass, $targetGUI, $show_pass_details=true, $show_answers=true, $show_question_only=false, $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 ($question_id, $test_id)
 Creates a HTML representation for the results of a given question in a test. More...
 
 populatePassFinishDate ($tpl, $passFinishDate)
 
 populateExamId (ilTemplate $tpl, int $activeId, int $pass)
 

Protected Member Functions

 dispatchCommand ()
 
 buildToolbar ($toolbarId)
 
 buildUserReviewOutput ()
 
 show ()
 
 pdfDownload ()
 
 buildPdfFilename ()
 not in use, but we keep the code (no archive for every user at end of test !!) More...
 
- Protected Member Functions inherited from ilTestServiceGUI
 isPdfDeliveryRequest ()
 
 getPassDetailsOverviewTableGUI ($result_array, $active_id, $pass, $targetGUI, $targetCMD, $questionDetailsCMD, $questionAnchorNav, ilTestQuestionRelatedObjectivesList $objectivesList=null, $multipleObjectivesInvolved=true)
 
 buildPassDetailsOverviewTableGUI ($targetGUI, $targetCMD)
 
 isGradingMessageRequired ()
 
 getGradingMessageBuilder ($activeId)
 
 buildQuestionRelatedObjectivesList (ilLOTestQuestionAdapter $objectivesAdapter, ilTestQuestionSequence $testSequence)
 
 getFilteredTestResult ($active_id, $pass, $considerHiddenQuestions, $considerOptionalQuestions)
 
 populateContent ($content)
 
 buildUserTestResultsToolbarGUI ()
 
 outCorrectSolutionCmd ()
 
 outCorrectSolution ()
 Creates an output of the solution of an answer compared to the correct solution. More...
 

Protected Attributes

 $testOutputGUI = null
 
 $testSession
 
- Protected Attributes inherited from ilTestServiceGUI
 $db
 
 $tabs
 
 $objCache
 
 $testSessionFactory = null
 
 $testSequenceFactory = null
 
 $participantData
 

Private Member Functions

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

Additional Inherited Members

- Data Fields inherited from ilTestServiceGUI
 $object = null
 
 $service = null
 
 $lng
 
 $tpl
 
 $ctrl
 
 $ilias
 
 $tree
 
 $ref_id
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

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

23 {
24 $this->testOutputGUI = $testOutputGUI;
25 $this->testSession = $testSession;
26
27 parent::__construct($testOBJ);
28 }

References $testOutputGUI, and $testSession.

Member Function Documentation

◆ buildPdfFilename()

ilTestSubmissionReviewGUI::buildPdfFilename ( )
protected

not in use, but we keep the code (no archive for every user at end of test !!)

Returns
string

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

222 {
223 global $DIC;
224 $ilSetting = $DIC['ilSetting'];
225
226 $inst_id = $ilSetting->get('inst_id', null);
227
228 require_once 'Services/Utilities/classes/class.ilUtil.php';
229
230 $path = ilUtil::getWebspaceDir() . '/assessment/' . $this->testOutputGUI->object->getId() . '/exam_pdf';
231
232 if (!is_dir($path)) {
234 }
235
236 $filename = ilUtil::removeTrailingPathSeparators(ILIAS_ABSOLUTE_PATH) . '/' . $path . '/exam_N';
237 $filename .= $inst_id . '-' . $this->testOutputGUI->object->getId();
238 $filename .= '-' . $this->testSession->getActiveId() . '-';
239 $filename .= $this->testSession->getPass() . '.pdf';
240
241 return $filename;
242 }
$path
Definition: aliased.php:25
$filename
Definition: buildRTE.php:89
static getWebspaceDir($mode="filesystem")
get webspace directory
static makeDirParents($a_dir)
Create a new directory and all parent directories.
static removeTrailingPathSeparators($path)
global $ilSetting
Definition: privfeed.php:17
global $DIC
Definition: saml.php:7

References $DIC, $filename, $ilSetting, $path, ilUtil\getWebspaceDir(), ilUtil\makeDirParents(), and ilUtil\removeTrailingPathSeparators().

+ Here is the call graph for this function:

◆ buildToolbar()

ilTestSubmissionReviewGUI::buildToolbar (   $toolbarId)
protected
Returns
ilToolbarGUI

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

84 {
85 require_once 'Modules/Test/classes/class.ilTestPlayerCommands.php';
86 require_once 'Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
87 require_once 'Services/UIComponent/Button/classes/class.ilLinkButton.php';
88 require_once 'Services/UIComponent/Button/classes/class.ilButton.php';
89
90 $toolbar = new ilToolbarGUI();
91 $toolbar->setId($toolbarId);
92
93 $backUrl = $this->ctrl->getLinkTarget(
94 $this->testOutputGUI,
95 $this->object->getListOfQuestionsEnd() ?
97 );
98
99 $button = ilLinkButton::getInstance();
100 $button->setCaption('btn_previous');
101 $button->setUrl($backUrl);
102 $toolbar->addButtonInstance($button);
103
104 if ($this->object->getShowExamviewPdf()) {
105 $pdfUrl = $this->ctrl->getLinkTarget($this, 'pdfDownload');
106
107 $button = ilLinkButton::getInstance();
108 $button->setCaption('pdf_export');
109 $button->setUrl($pdfUrl);
110 $button->setTarget(ilButton::FORM_TARGET_BLANK);
111 $toolbar->addButtonInstance($button);
112 }
113
114 $this->ctrl->setParameter($this->testOutputGUI, 'reviewed', 1);
115 $nextUrl = $this->ctrl->getLinkTarget($this->testOutputGUI, ilTestPlayerCommands::FINISH_TEST);
116 $this->ctrl->setParameter($this->testOutputGUI, 'reviewed', 0);
117
118 $button = ilLinkButton::getInstance();
119 $button->setPrimary(true);
120 $button->setCaption('btn_next');
121 $button->setUrl($nextUrl);
122 $toolbar->addButtonInstance($button);
123
124 return $toolbar;
125 }
const FORM_TARGET_BLANK
static getInstance()
Factory.

References ilTestPlayerCommands\BACK_FROM_FINISHING, ilTestPlayerCommands\FINISH_TEST, ilButton\FORM_TARGET_BLANK, ilLinkButton\getInstance(), and ilTestPlayerCommands\QUESTION_SUMMARY.

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 127 of file class.ilTestSubmissionReviewGUI.php.

128 {
129 global $DIC; /* @var ILIAS\DI\Container $DIC */
130 $ilObjDataCache = $DIC['ilObjDataCache'];
131
132 require_once 'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
133 $testResultHeaderLabelBuilder = new ilTestResultHeaderLabelBuilder($this->lng, $ilObjDataCache);
134
135 $objectivesList = null;
136
137 if ($this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) {
138 $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($this->testSession->getActiveId(), $this->testSession->getPass());
139 $testSequence->loadFromDb();
140 $testSequence->loadQuestions();
141
142 require_once 'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
143 $objectivesAdapter = ilLOTestQuestionAdapter::getInstance($this->testSession);
144
145 $objectivesList = $this->buildQuestionRelatedObjectivesList($objectivesAdapter, $testSequence);
146 $objectivesList->loadObjectivesTitles();
147
148 $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($this->testSession->getObjectiveOrientedContainerId());
149 $testResultHeaderLabelBuilder->setUserId($this->testSession->getUserId());
150 $testResultHeaderLabelBuilder->setTestObjId($this->object->getId());
151 $testResultHeaderLabelBuilder->setTestRefId($this->object->getRefId());
152 $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
153 }
154
155 $results = $this->object->getTestResult(
156 $this->testSession->getActiveId(),
157 $this->testSession->getPass(),
158 false,
159 !$this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()
160 );
161
162 require_once 'class.ilTestEvaluationGUI.php';
163 $testevaluationgui = new ilTestEvaluationGUI($this->object);
164 $testevaluationgui->setContextResultPresentation(false);
165
166 $results_output = $testevaluationgui->getPassListOfAnswers(
167 $results,
168 $this->testSession->getActiveId(),
169 $this->testSession->getPass(),
170 false,
171 false,
172 false,
173 false,
174 false,
175 $objectivesList,
176 $testResultHeaderLabelBuilder
177 );
178
179 return $results_output;
180 }
static getInstance(ilTestSession $a_test_session)
Output class for assessment test evaluation.
buildQuestionRelatedObjectivesList(ilLOTestQuestionAdapter $objectivesAdapter, ilTestQuestionSequence $testSequence)
$results
Definition: svg-scanner.php:47

References $DIC, $results, ilTestServiceGUI\buildQuestionRelatedObjectivesList(), ilLOTestQuestionAdapter\getInstance(), and ilTestServiceGUI\getObjectiveOrientedContainer().

Referenced by pdfDownload(), and show().

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

◆ dispatchCommand()

ilTestSubmissionReviewGUI::dispatchCommand ( )
protected

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

46 {
47 switch ($this->ctrl->getCmd()) {
48 case 'pdfDownload':
49
50 if ($this->object->getShowExamviewPdf()) {
51 $this->pdfDownload();
52 }
53
54 break;
55
56 case 'show':
57 default:
58
59 $this->show();
60 }
61 }

References pdfDownload(), 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 30 of file class.ilTestSubmissionReviewGUI.php.

31 {
32 if (!$this->object->getEnableExamview()) {
33 return '';
34 }
35
36 switch ($this->ctrl->getNextClass($this)) {
37 default:
38 $this->dispatchCommand();
39 break;
40 }
41
42 return '';
43 }

References dispatchCommand().

+ 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 69 of file class.ilTestSubmissionReviewGUI.php.

70 {
71 if ($this->object->getKioskMode()) {
72 $this->tpl->setBodyClass("kiosk");
73 $this->tpl->setAddFooter(false);
74 return "CONTENT";
75 } else {
76 return "ADM_CONTENT";
77 }
78 }

Referenced by show().

+ Here is the caller graph for this function:

◆ pdfDownload()

ilTestSubmissionReviewGUI::pdfDownload ( )
protected

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

205 {
207
208 $reviewOutput = $this->buildUserReviewOutput();
209
210 require_once 'Modules/Test/classes/class.ilTestPDFGenerator.php';
212
213 exit;
214 }
exit
Definition: backend.php:16
static prepareGenerationRequest($service, $purpose)
Prepare the content processing for a PDF generation request This function should be called as in a re...
static generatePDF($pdf_output, $output_mode, $filename=null, $purpose=null)
const PDF_USER_RESULT
PDF Purposes.

References buildUserReviewOutput(), exit, ilTestPDFGenerator\generatePDF(), ilTestPDFGenerator\PDF_OUTPUT_DOWNLOAD, PDF_USER_RESULT, and ilPDFGeneratorUtils\prepareGenerationRequest().

Referenced by dispatchCommand().

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

◆ show()

ilTestSubmissionReviewGUI::show ( )
protected

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

183 {
184 $html = $this->buildToolbar('review_nav_top')->getHTML();
185 $html .= $this->buildUserReviewOutput() . '<br />';
186 $html .= $this->buildToolbar('review_nav_bottom')->getHTML();
187
188 if ($this->object->isShowExamIdInTestPassEnabled() && !$this->object->getKioskMode()) {
189 $examIdTpl = new ilTemplate("tpl.exam_id_block.html", true, true, 'Modules/Test');
190 $examIdTpl->setVariable('EXAM_ID_VAL', ilObjTest::lookupExamId(
191 $this->testSession->getActiveId(),
192 $this->testSession->getPass(),
193 $this->object->getId()
194 ));
195 $examIdTpl->setVariable('EXAM_ID_TXT', $this->lng->txt('exam_id'));
196 $html .= $examIdTpl->get();
197 }
198
199 $this->tpl->setVariable(
200 $this->getContentBlockName(), $html
201 );
202 }
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)
$html
Definition: example_001.php:87

References $html, buildToolbar(), buildUserReviewOutput(), getContentBlockName(), and ilObjTest\lookupExamId().

Referenced by dispatchCommand().

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

Field Documentation

◆ $testOutputGUI

ilTestSubmissionReviewGUI::$testOutputGUI = null
protected

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

Referenced by __construct().

◆ $testSession

ilTestSubmissionReviewGUI::$testSession
protected

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

Referenced by __construct().


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