ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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)
 
 ilTestServiceGUI (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)
 
 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.

References $testOutputGUI, and $testSession.

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

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

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

204  {
205  global $ilSetting;
206 
207  $inst_id = $ilSetting->get('inst_id', null);
208 
209  require_once 'Services/Utilities/classes/class.ilUtil.php';
210 
211  $path = ilUtil::getWebspaceDir() . '/assessment/'. $this->testOutputGUI->object->getId() . '/exam_pdf';
212 
213  if (!is_dir($path))
214  {
216  }
217 
219  $filename .= $inst_id . '-' . $this->testOutputGUI->object->getId();
220  $filename .= '-' . $this->testSession->getActiveId() . '-';
221  $filename .= $this->testSession->getPass() . '.pdf';
222 
223  return $filename;
224  }
static makeDirParents($a_dir)
Create a new directory and all parent directories.
const ILIAS_ABSOLUTE_PATH
static removeTrailingPathSeparators($path)
$filename
Definition: buildRTE.php:89
global $ilSetting
Definition: privfeed.php:40
$path
Definition: index.php:22
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 90 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().

91  {
92  require_once 'Modules/Test/classes/class.ilTestPlayerCommands.php';
93  require_once 'Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
94  require_once 'Services/UIComponent/Button/classes/class.ilButton.php';
95  require_once 'Services/UIComponent/Button/classes/class.ilLinkButton.php';
96 
97  $toolbar = new ilToolbarGUI();
98  $toolbar->setId($toolbarId);
99 
100  $backUrl = $this->ctrl->getLinkTarget($this->testOutputGUI, $this->object->getListOfQuestionsEnd() ?
102  );
103 
104  $button = ilLinkButton::getInstance();
105  $button->setCaption('btn_previous');
106  $button->setUrl($backUrl);
107  $toolbar->addButtonInstance($button);
108 
109  if( $this->object->getShowExamviewPdf() )
110  {
111  $pdfUrl = $this->ctrl->getLinkTarget($this, 'pdfDownload');
112 
113  $button = ilLinkButton::getInstance();
114  $button->setCaption('pdf_export');
115  $button->setUrl($pdfUrl);
116  $button->setTarget(ilButton::FORM_TARGET_BLANK);
117  $toolbar->addButtonInstance($button);
118  }
119 
120  $this->ctrl->setParameter($this->testOutputGUI, 'reviewed', 1);
121  $nextUrl = $this->ctrl->getLinkTarget($this->testOutputGUI, ilTestPlayerCommands::FINISH_TEST);
122  $this->ctrl->setParameter($this->testOutputGUI, 'reviewed', 0);
123 
124  $button = ilLinkButton::getInstance();
125  $button->setPrimary(true);
126  $button->setCaption('btn_next');
127  $button->setUrl($nextUrl);
128  $toolbar->addButtonInstance($button);
129 
130  return $toolbar;
131  }
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 133 of file class.ilTestSubmissionReviewGUI.php.

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

Referenced by pdfDownload(), and show().

134  {
135  $ilObjDataCache = isset($GLOBALS['DIC']) ? $GLOBALS['DIC']['ilObjDataCache'] : $GLOBALS['ilObjDataCache'];
136 
137  require_once 'Modules/Test/classes/class.ilTestResultHeaderLabelBuilder.php';
138  $testResultHeaderLabelBuilder = new ilTestResultHeaderLabelBuilder($this->lng, $ilObjDataCache);
139 
140  $objectivesList = null;
141 
142  if( $this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired() )
143  {
144  $testSequence = $this->testSequenceFactory->getSequenceByActiveIdAndPass($this->testSession->getActiveId(), $this->testSession->getPass());
145  $testSequence->loadFromDb();
146  $testSequence->loadQuestions();
147 
148  require_once 'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
149  $objectivesAdapter = ilLOTestQuestionAdapter::getInstance($this->testSession);
150 
151  $objectivesList = $this->buildQuestionRelatedObjectivesList($objectivesAdapter, $testSequence);
152  $objectivesList->loadObjectivesTitles();
153 
154  $testResultHeaderLabelBuilder->setObjectiveOrientedContainerId($this->testSession->getObjectiveOrientedContainerId());
155  $testResultHeaderLabelBuilder->setUserId($this->testSession->getUserId());
156  $testResultHeaderLabelBuilder->setTestObjId($this->object->getId());
157  $testResultHeaderLabelBuilder->setTestRefId($this->object->getRefId());
158  $testResultHeaderLabelBuilder->initObjectiveOrientedMode();
159  }
160 
161  $results = $this->object->getTestResult(
162  $this->testSession->getActiveId(), $this->testSession->getPass(), false,
163  !$this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()
164  );
165 
166  require_once 'class.ilTestEvaluationGUI.php';
167  $testevaluationgui = new ilTestEvaluationGUI($this->object);
168  $testevaluationgui->setContextResultPresentation(false);
169 
170  $results_output = $testevaluationgui->getPassListOfAnswers( $results,
171  $this->testSession->getActiveId(), $this->testSession->getPass(),
172  false, false, false, false,
173  false, $objectivesList, $testResultHeaderLabelBuilder
174  );
175 
176  return $results_output;
177  }
buildQuestionRelatedObjectivesList(ilLOTestQuestionAdapter $objectivesAdapter, ilTestQuestionSequence $testSequence)
static getInstance(ilTestSession $a_test_session)
Output class for assessment test evaluation.
$results
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.
Definition: CAS.php:276
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dispatchCommand()

ilTestSubmissionReviewGUI::dispatchCommand ( )
protected

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

References pdfDownload(), and show().

Referenced by executeCommand().

48  {
49  switch( $this->ctrl->getCmd() )
50  {
51  case 'pdfDownload':
52 
53  if( $this->object->getShowExamviewPdf() )
54  {
55  $this->pdfDownload();
56  }
57 
58  break;
59 
60  case 'show':
61  default:
62 
63  $this->show();
64  }
65  }
+ 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  {
34  return '';
35  }
36 
37  switch( $this->ctrl->getNextClass($this) )
38  {
39  default:
40  $this->dispatchCommand();
41  break;
42  }
43 
44  return '';
45  }
+ 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 73 of file class.ilTestSubmissionReviewGUI.php.

Referenced by show().

74  {
75  if ($this->object->getKioskMode())
76  {
77  $this->tpl->setBodyClass("kiosk");
78  $this->tpl->setAddFooter(FALSE);
79  return "CONTENT";
80  }
81  else
82  {
83  return "ADM_CONTENT";
84  }
85  }
+ Here is the caller graph for this function:

◆ pdfDownload()

ilTestSubmissionReviewGUI::pdfDownload ( )
protected

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

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

Referenced by dispatchCommand().

189  {
190  $reviewOutput = $this->buildUserReviewOutput();
191 
192  require_once 'class.ilTestPDFGenerator.php';
194 
195  exit;
196  }
exit
Definition: login.php:54
static generatePDF($pdf_output, $output_mode, $filename=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ show()

ilTestSubmissionReviewGUI::show ( )
protected

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

References $html, buildToolbar(), buildUserReviewOutput(), and getContentBlockName().

Referenced by dispatchCommand().

180  {
181  $html = $this->buildToolbar('review_nav_top')->getHTML();
182  $html .= $this->buildUserReviewOutput() . '<br />';
183  $html .= $this->buildToolbar('review_nav_bottom')->getHTML();
184 
185  $this->tpl->setVariable($this->getContentBlockName(), $html);
186  }
getContentBlockName()
Returns the name of the current content block (depends on the kiosk mode setting) ...
$html
Definition: example_001.php:87
+ 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: