ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
ilTestSubmissionReviewGUI Class Reference

Class ilTestSubmissionReviewGUI. More...

+ Collaboration diagram for ilTestSubmissionReviewGUI:

Public Member Functions

 __construct (ilTestOutputGUI $testOutputGUI, ilObjTest $test, ilTestSession $testSession)
 
 executeCommand ()
 

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 Attributes

 $testOutputGUI = null
 
 $test = null
 
 $lng
 
 $ilCtrl
 
 $tpl
 
 $testSession
 

Private Member Functions

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

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

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

References $ilCtrl, $lng, $test, $testOutputGUI, $testSession, and $tpl.

33  {
34  global $lng, $ilCtrl, $tpl;
35  $this->lng = $lng;
36  $this->ilCtrl = $ilCtrl;
37  $this->tpl = $tpl;
38 
39  $this->testOutputGUI = $testOutputGUI;
40  $this->test = $test;
41  $this->testSession = $testSession;
42  }
This class provides processing control methods.

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

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

190  {
191  global $ilSetting;
192 
193  $inst_id = $ilSetting->get('inst_id', null);
194 
195  require_once 'Services/Utilities/classes/class.ilUtil.php';
196 
197  $path = ilUtil::getWebspaceDir() . '/assessment/'. $this->test->getId() . '/exam_pdf';
198 
199  if (!is_dir($path))
200  {
202  }
203 
205  $filename .= $inst_id . '-' . $this->test->getId();
206  $filename .= '-' . $this->testSession->getActiveId() . '-';
207  $filename .= $this->testSession->getPass() . '.pdf';
208 
209  return $filename;
210  }
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 104 of file class.ilTestSubmissionReviewGUI.php.

References ilLinkButton\getInstance(), ilCtrl\getLinkTarget(), and ilCtrl\setParameter().

Referenced by show().

105  {
106  require_once 'Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
107  require_once 'Services/UIComponent/Button/classes/class.ilButton.php';
108  require_once 'Services/UIComponent/Button/classes/class.ilLinkButton.php';
109 
110  $toolbar = new ilToolbarGUI();
111  $toolbar->setId($toolbarId);
112 
113  $backUrl = $this->ilCtrl->getLinkTarget($this->testOutputGUI, $this->test->getListOfQuestionsEnd() ?
114  'outQuestionSummary' : 'backFromSummary'
115  );
116 
117  $button = ilLinkButton::getInstance();
118  $button->setCaption('btn_previous');
119  $button->setUrl($backUrl);
120  $toolbar->addButtonInstance($button);
121 
122  if( $this->test->getShowExamviewPdf() )
123  {
124  $pdfUrl = $this->ilCtrl->getLinkTarget($this, 'pdfDownload');
125 
126  $button = ilLinkButton::getInstance();
127  $button->setCaption('pdf_export');
128  $button->setUrl($pdfUrl);
129  $button->setTarget('_blank');
130  $toolbar->addButtonInstance($button);
131  }
132 
133  $this->ilCtrl->setParameter($this->testOutputGUI, 'reviewed', 1);
134  $nextUrl = $this->ilCtrl->getLinkTarget($this->testOutputGUI, 'finishTest');
135  $this->ilCtrl->setParameter($this->testOutputGUI, 'reviewed', 0);
136 
137  $button = ilLinkButton::getInstance();
138  $button->setPrimary(true);
139  $button->setCaption('btn_next');
140  $button->setUrl($nextUrl);
141  $toolbar->addButtonInstance($button);
142 
143  return $toolbar;
144  }
This class provides processing control methods.
getLinkTarget(&$a_gui_obj, $a_cmd="", $a_anchor="", $a_asynch=false, $xml_style=true)
Get link target for command using gui object.
setParameter(&$a_obj, $a_parameter, $a_value)
Set parameters that should be passed a form and link of a gui class.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildUserReviewOutput()

ilTestSubmissionReviewGUI::buildUserReviewOutput ( )
protected

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

References $results.

Referenced by pdfDownload(), and show().

147  {
148  $results = $this->test->getTestResult(
149  $this->testSession->getActiveId(), $this->testSession->getPass(), false
150  );
151 
152  require_once 'class.ilTestEvaluationGUI.php';
153  $testevaluationgui = new ilTestEvaluationGUI($this->test);
154  $testevaluationgui->setContextWithinTestPass(true);
155 
156  $results_output = $testevaluationgui->getPassListOfAnswers( $results,
157  $this->testSession->getActiveId(), $this->testSession->getPass(),
158  false, false, false, false,
159  false
160  );
161 
162  return $results_output;
163  }
Output class for assessment test evaluation.
$results
+ Here is the caller graph for this function:

◆ dispatchCommand()

ilTestSubmissionReviewGUI::dispatchCommand ( )
protected

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

References ilCtrl\getCmd(), pdfDownload(), and show().

Referenced by executeCommand().

62  {
63  switch( $this->ilCtrl->getCmd() )
64  {
65  case 'pdfDownload':
66 
67  if( $this->test->getShowExamviewPdf() )
68  {
69  $this->pdfDownload();
70  }
71 
72  break;
73 
74  case 'show':
75  default:
76 
77  $this->show();
78  }
79  }
This class provides processing control methods.
getCmd($a_default_cmd="", $a_safe_commands="")
Determines current get/post command.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilTestSubmissionReviewGUI::executeCommand ( )

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

References dispatchCommand(), and ilCtrl\getNextClass().

45  {
46  if( !$this->test->getEnableExamview() )
47  {
48  return '';
49  }
50 
51  switch( $this->ilCtrl->getNextClass($this) )
52  {
53  default:
54  $this->dispatchCommand();
55  break;
56  }
57 
58  return '';
59  }
getNextClass()
Get next class in the control path from the current class to the target command class.
This class provides processing control methods.
+ 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 87 of file class.ilTestSubmissionReviewGUI.php.

Referenced by show().

88  {
89  if ($this->test->getKioskMode())
90  {
91  $this->tpl->setBodyClass("kiosk");
92  $this->tpl->setAddFooter(FALSE);
93  return "CONTENT";
94  }
95  else
96  {
97  return "ADM_CONTENT";
98  }
99  }
+ Here is the caller graph for this function:

◆ pdfDownload()

ilTestSubmissionReviewGUI::pdfDownload ( )
protected

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

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

Referenced by dispatchCommand().

175  {
176  $reviewOutput = $this->buildUserReviewOutput();
177 
178  require_once 'class.ilTestPDFGenerator.php';
180 
181  exit;
182  }
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 165 of file class.ilTestSubmissionReviewGUI.php.

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

Referenced by dispatchCommand().

166  {
167  $html = $this->buildToolbar('review_nav_top')->getHTML();
168  $html .= $this->buildUserReviewOutput() . '<br />';
169  $html .= $this->buildToolbar('review_nav_bottom')->getHTML();
170 
171  $this->tpl->setVariable($this->getContentBlockName(), $html);
172  }
getContentBlockName()
Returns the name of the current content block (depends on the kiosk mode setting) ...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $ilCtrl

ilTestSubmissionReviewGUI::$ilCtrl
protected

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

Referenced by __construct().

◆ $lng

ilTestSubmissionReviewGUI::$lng
protected

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

Referenced by __construct().

◆ $test

ilTestSubmissionReviewGUI::$test = null
protected

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

Referenced by __construct().

◆ $testOutputGUI

ilTestSubmissionReviewGUI::$testOutputGUI = null
protected

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

Referenced by __construct().

◆ $testSession

ilTestSubmissionReviewGUI::$testSession
protected

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

Referenced by __construct().

◆ $tpl

ilTestSubmissionReviewGUI::$tpl
protected

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

Referenced by __construct().


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