ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilTestSubmissionReviewGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

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

Public Member Functions

 __construct (ilTestOutputGUI $testOutputGUI, ilObjTest $testOBJ, ilTestSession $testSession)
 
 executeCommand ()
 
- 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)
 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 $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)
 
 getObject ()
 

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 ()
 
 buildQuestionAnswerShuffler (int $question_id, int $active_id, int $pass_id)
 
 buildFixedShufflerSeed (int $question_id, int $pass_id, int $active_id)
 
 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
ILIAS Test InternalRequestService $testrequest
 
 $db
 
Refinery $refinery
 
 $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

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class ilTestSubmissionReviewGUI

Author
Maximilian Becker mbeck.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de
Version
$Id$

ilTestSubmissionReviewGUI: ilAssQuestionPageGUI

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

Constructor & Destructor Documentation

◆ __construct()

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

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

References $testOutputGUI, $testSession, and ILIAS\GlobalScreen\Provider\__construct().

36  {
37  $this->testOutputGUI = $testOutputGUI;
38  $this->testSession = $testSession;
39 
40  parent::__construct($testOBJ);
41  }
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

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

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

245  : string
246  {
247  global $DIC;
248  $ilSetting = $DIC['ilSetting'];
249 
250  $inst_id = $ilSetting->get('inst_id', null);
251 
252  require_once 'Services/Utilities/classes/class.ilUtil.php';
253 
254  $path = ilFileUtils::getWebspaceDir() . '/assessment/' . $this->testOutputGUI->object->getId() . '/exam_pdf';
255 
256  if (!is_dir($path)) {
258  }
259 
260  $filename = ilFileUtils::removeTrailingPathSeparators(ILIAS_ABSOLUTE_PATH) . '/' . $path . '/exam_N';
261  $filename .= $inst_id . '-' . $this->testOutputGUI->object->getId();
262  $filename .= '-' . $this->testSession->getActiveId() . '-';
263  $filename .= $this->testSession->getPass() . '.pdf';
264 
265  return $filename;
266  }
static getWebspaceDir(string $mode="filesystem")
get webspace directory
static makeDirParents(string $a_dir)
Create a new directory and all parent directories.
$path
Definition: ltiservices.php:32
static removeTrailingPathSeparators(string $path)
global $DIC
Definition: feed.php:28
$filename
Definition: buildRTE.php:78
global $ilSetting
Definition: privfeed.php:17
+ Here is the call graph for this function:

◆ buildToolbar()

ilTestSubmissionReviewGUI::buildToolbar (   $toolbarId)
protected
Returns
ilToolbarGUI

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

References ilTestPlayerCommands\BACK_FROM_FINISHING, ILIAS\Repository\ctrl(), ilTestPlayerCommands\FINISH_TEST, ilButton\FORM_TARGET_BLANK, ilLinkButton\getInstance(), ILIAS\Repository\object(), and ilTestPlayerCommands\QUESTION_SUMMARY.

Referenced by show().

97  : ilToolbarGUI
98  {
99  require_once 'Modules/Test/classes/class.ilTestPlayerCommands.php';
100  require_once 'Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
101  require_once 'Services/UIComponent/Button/classes/class.ilLinkButton.php';
102  require_once 'Services/UIComponent/Button/classes/class.ilButton.php';
103 
104  $toolbar = new ilToolbarGUI();
105  $toolbar->setId($toolbarId);
106 
107  $backUrl = $this->ctrl->getLinkTarget(
108  $this->testOutputGUI,
109  $this->object->getListOfQuestionsEnd() ?
111  );
112 
113  $button = ilLinkButton::getInstance();
114  $button->setCaption('btn_previous');
115  $button->setUrl($backUrl);
116  $toolbar->addButtonInstance($button);
117 
118  if ($this->object->getShowExamviewPdf()) {
119  $pdfUrl = $this->ctrl->getLinkTarget($this, 'pdfDownload');
120 
121  $button = ilLinkButton::getInstance();
122  $button->setCaption('pdf_export');
123  $button->setUrl($pdfUrl);
124  $button->setTarget(ilButton::FORM_TARGET_BLANK);
125  $toolbar->addButtonInstance($button);
126  }
127 
128  $this->ctrl->setParameter($this->testOutputGUI, 'reviewed', 1);
129  $nextUrl = $this->ctrl->getLinkTarget($this->testOutputGUI, ilTestPlayerCommands::FINISH_TEST);
130  $this->ctrl->setParameter($this->testOutputGUI, 'reviewed', 0);
131 
132  $button = ilLinkButton::getInstance();
133  $button->setPrimary(true);
134  $button->setCaption('btn_next');
135  $button->setUrl($nextUrl);
136  $toolbar->addButtonInstance($button);
137 
138  return $toolbar;
139  }
const FORM_TARGET_BLANK
Load the response into a new unnamed browsing context.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildUserReviewOutput()

ilTestSubmissionReviewGUI::buildUserReviewOutput ( )
protected

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

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

Referenced by pdfDownload(), and show().

141  : string
142  {
143  global $DIC; /* @var ILIAS\DI\Container $DIC */
144  $ilObjDataCache = $DIC['ilObjDataCache'];
145 
146  require_once 'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
147  $testResultHeaderLabelBuilder = new ilTestResultHeaderLabelBuilder($this->lng, $ilObjDataCache);
148 
149  $objectivesList = null;
150 
151  if ($this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) {
152  $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($this->testSession->getActiveId(), $this->testSession->getPass());
153  $testSequence->loadFromDb();
154  $testSequence->loadQuestions();
155 
156  require_once 'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
157  $objectivesAdapter = ilLOTestQuestionAdapter::getInstance($this->testSession);
158 
159  $objectivesList = $this->buildQuestionRelatedObjectivesList($objectivesAdapter, $testSequence);
160  $objectivesList->loadObjectivesTitles();
161 
162  $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($this->testSession->getObjectiveOrientedContainerId());
163  $testResultHeaderLabelBuilder->setUserId($this->testSession->getUserId());
164  $testResultHeaderLabelBuilder->setTestObjId($this->object->getId());
165  $testResultHeaderLabelBuilder->setTestRefId($this->object->getRefId());
166  $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
167  }
168 
169  $results = $this->object->getTestResult(
170  $this->testSession->getActiveId(),
171  $this->testSession->getPass(),
172  false,
173  !$this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()
174  );
175 
176  require_once 'class.ilTestEvaluationGUI.php';
177  $testevaluationgui = new ilTestEvaluationGUI($this->object);
178  $testevaluationgui->setContextResultPresentation(false);
179 
180  $results_output = $testevaluationgui->getPassListOfAnswers(
181  $results,
182  $this->testSession->getActiveId(),
183  $this->testSession->getPass(),
184  false,
185  false,
186  false,
187  false,
188  false,
189  $objectivesList,
190  $testResultHeaderLabelBuilder
191  );
192 
193  return $results_output;
194  }
global $DIC
Definition: feed.php:28
buildQuestionRelatedObjectivesList(ilLOTestQuestionAdapter $objectivesAdapter, ilTestQuestionSequence $testSequence)
static getInstance(ilTestSession $a_test_session)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$results
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dispatchCommand()

ilTestSubmissionReviewGUI::dispatchCommand ( )
protected

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

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

Referenced by executeCommand().

59  {
60  switch ($this->ctrl->getCmd()) {
61  case 'pdfDownload':
62 
63  if ($this->object->getShowExamviewPdf()) {
64  $this->pdfDownload();
65  }
66 
67  break;
68 
69  case 'show':
70  default:
71 
72  $this->show();
73  }
74  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilTestSubmissionReviewGUI::executeCommand ( )

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

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

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

References ILIAS\Repository\object().

Referenced by show().

82  : string
83  {
84  if ($this->object->getKioskMode()) {
85  // See: https://mantis.ilias.de/view.php?id=27784
86  //$this->tpl->setBodyClass("kiosk");
87  $this->tpl->hideFooter();
88  return "CONTENT";
89  } else {
90  return "ADM_CONTENT";
91  }
92  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pdfDownload()

ilTestSubmissionReviewGUI::pdfDownload ( )
protected

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

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

Referenced by dispatchCommand().

226  {
228 
229  $reviewOutput = $this->buildUserReviewOutput();
230 
231  $filename = $this->testOutputGUI->object->getRefId();
232  $filename .= '-' . $this->testSession->getActiveId() . '-';
233  $filename .= $this->testSession->getPass() . '.pdf';
234 
236 
237  exit;
238  }
exit
Definition: login.php:28
const PDF_USER_RESULT
PDF Purposes.
$filename
Definition: buildRTE.php:78
static generatePDF($pdf_output, $output_mode, $filename=null, $purpose=null)
static prepareGenerationRequest(string $service, string $purpose)
Prepare the content processing for a PDF generation request This function should be called as in a re...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ show()

ilTestSubmissionReviewGUI::show ( )
protected

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

References $DIC, buildToolbar(), buildUserReviewOutput(), getContentBlockName(), ILIAS\Repository\lng(), ilObjTest\lookupExamId(), ILIAS\Repository\object(), and ilTestPlayerLayoutProvider\TEST_PLAYER_TITLE.

Referenced by dispatchCommand().

197  {
198  global $DIC;
199  $DIC->globalScreen()->tool()->context()->current()->getAdditionalData()->replace(
201  $this->object->getTitle() . ' - ' . $this->lng->txt('tst_results_overview')
202  );
203 
204  $html = $this->buildToolbar('review_nav_top')->getHTML();
205  $html .= $this->buildUserReviewOutput() . '<br />';
206  $html .= $this->buildToolbar('review_nav_bottom')->getHTML();
207 
208  if ($this->object->isShowExamIdInTestPassEnabled() && !$this->object->getKioskMode()) {
209  $examIdTpl = new ilTemplate("tpl.exam_id_block.html", true, true, 'Modules/Test');
210  $examIdTpl->setVariable('EXAM_ID_VAL', ilObjTest::lookupExamId(
211  $this->testSession->getActiveId(),
212  $this->testSession->getPass(),
213  $this->object->getId()
214  ));
215  $examIdTpl->setVariable('EXAM_ID_TXT', $this->lng->txt('exam_id'));
216  $html .= $examIdTpl->get();
217  }
218 
219  $this->tpl->setVariable(
220  $this->getContentBlockName(),
221  $html
222  );
223  }
getContentBlockName()
Returns the name of the current content block (depends on the kiosk mode setting) ...
global $DIC
Definition: feed.php:28
static lookupExamId($active_id, $pass)
+ 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 30 of file class.ilTestSubmissionReviewGUI.php.

Referenced by __construct().

◆ $testSession

ilTestSubmissionReviewGUI::$testSession
protected

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

Referenced by __construct().


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