ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
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 ()
 
- 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 ()
 
 buildQuestionAnswerShuffler (string $question_id, string $active_id, string $active_pass)
 
 buildFixedShufflerSeedFromBasicSeed (string $basic_seed)
 
 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
const FIXED_SHUFFLER_SEED_MIN_LENGTH = 8
 
 $db
 
 $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

Constructor & Destructor Documentation

◆ __construct()

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

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

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

23  {
24  $this->testOutputGUI = $testOutputGUI;
25  $this->testSession = $testSession;
26 
27  parent::__construct($testOBJ);
28  }
__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 226 of file class.ilTestSubmissionReviewGUI.php.

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

227  {
228  global $DIC;
229  $ilSetting = $DIC['ilSetting'];
230 
231  $inst_id = $ilSetting->get('inst_id', null);
232 
233  require_once 'Services/Utilities/classes/class.ilUtil.php';
234 
235  $path = ilUtil::getWebspaceDir() . '/assessment/' . $this->testOutputGUI->object->getId() . '/exam_pdf';
236 
237  if (!is_dir($path)) {
238  ilUtil::makeDirParents($path);
239  }
240 
241  $filename = ilUtil::removeTrailingPathSeparators(ILIAS_ABSOLUTE_PATH) . '/' . $path . '/exam_N';
242  $filename .= $inst_id . '-' . $this->testOutputGUI->object->getId();
243  $filename .= '-' . $this->testSession->getActiveId() . '-';
244  $filename .= $this->testSession->getPass() . '.pdf';
245 
246  return $filename;
247  }
static makeDirParents($a_dir)
Create a new directory and all parent directories.
global $DIC
Definition: goto.php:24
static removeTrailingPathSeparators($path)
$filename
Definition: buildRTE.php:89
global $ilSetting
Definition: privfeed.php:17
static getWebspaceDir($mode="filesystem")
get webspace directory
+ Here is the call graph for this function:

◆ buildToolbar()

ilTestSubmissionReviewGUI::buildToolbar (   $toolbarId)
protected
Returns
ilToolbarGUI

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

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

Referenced by show().

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

◆ buildUserReviewOutput()

ilTestSubmissionReviewGUI::buildUserReviewOutput ( )
protected

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

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

Referenced by pdfDownload(), and show().

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

References pdfDownload(), and show().

Referenced by executeCommand().

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  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilTestSubmissionReviewGUI::executeCommand ( )

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

References dispatchCommand().

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

Referenced by show().

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

◆ pdfDownload()

ilTestSubmissionReviewGUI::pdfDownload ( )
protected

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

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

Referenced by dispatchCommand().

207  {
209 
210  $reviewOutput = $this->buildUserReviewOutput();
211 
212  $filename = $this->testOutputGUI->object->getRefId();
213  $filename .= '-' . $this->testSession->getActiveId() . '-';
214  $filename .= $this->testSession->getPass() . '.pdf';
215 
217 
218  exit;
219  }
exit
Definition: login.php:29
const PDF_USER_RESULT
PDF Purposes.
$filename
Definition: buildRTE.php:89
static generatePDF($pdf_output, $output_mode, $filename=null, $purpose=null)
static prepareGenerationRequest($service, $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 183 of file class.ilTestSubmissionReviewGUI.php.

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

Referenced by dispatchCommand().

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

◆ $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: