ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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, $targetCmd='')
 
 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)
 

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
 handleTabs ($activeTabId)
 
 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 208 of file class.ilTestSubmissionReviewGUI.php.

209 {
210 global $ilSetting;
211
212 $inst_id = $ilSetting->get('inst_id', null);
213
214 require_once 'Services/Utilities/classes/class.ilUtil.php';
215
216 $path = ilUtil::getWebspaceDir() . '/assessment/' . $this->testOutputGUI->object->getId() . '/exam_pdf';
217
218 if (!is_dir($path)) {
220 }
221
222 $filename = ilUtil::removeTrailingPathSeparators(ILIAS_ABSOLUTE_PATH) . '/' . $path . '/exam_N';
223 $filename .= $inst_id . '-' . $this->testOutputGUI->object->getId();
224 $filename .= '-' . $this->testSession->getActiveId() . '-';
225 $filename .= $this->testSession->getPass() . '.pdf';
226
227 return $filename;
228 }
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

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

References $GLOBALS, $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 190 of file class.ilTestSubmissionReviewGUI.php.

191 {
192 $reviewOutput = $this->buildUserReviewOutput();
193
194 require_once './Services/PDFGeneration/classes/class.ilPDFGeneration.php';
196
197 require_once 'Modules/Test/classes/class.ilTestPDFGenerator.php';
199
200 exit;
201 }
static prepareGeneration()
Prepare the PDF generation This initializes the purpose for MathJax rendering It has to be called bef...
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 ilPDFGeneration\prepareGeneration().

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

182 {
183 $html = $this->buildToolbar('review_nav_top')->getHTML();
184 $html .= $this->buildUserReviewOutput() . '<br />';
185 $html .= $this->buildToolbar('review_nav_bottom')->getHTML();
186
187 $this->tpl->setVariable($this->getContentBlockName(), $html);
188 }
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(), and getContentBlockName().

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: