ILIAS  release_4-4 Revision
ilTestSubmissionReviewGUI Class Reference

Class ilTestSubmissionReviewGUI. More...

+ Collaboration diagram for ilTestSubmissionReviewGUI:

Public Member Functions

 __construct (ilTestOutputGUI $testOutputGUI, ilObjTest $test)
 
 executeCommand ()
 
 show ()
 

Protected Member Functions

 dispatchCommand ()
 
 getTestEvaluationGUI ()
 

Protected Attributes

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

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 
)

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

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

31  {
32  global $lng, $ilCtrl, $tpl;
33  $this->lng = $lng;
34  $this->ilCtrl = $ilCtrl;
35  $this->tpl = $tpl;
36 
37  $this->testOutputGUI = $testOutputGUI;
38  $this->test = $test;
39  }
This class provides processing control methods.
$test
Definition: Utf8Test.php:85

Member Function Documentation

◆ dispatchCommand()

ilTestSubmissionReviewGUI::dispatchCommand ( )
protected

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

References $cmd, $ret, ilCtrl\getCmd(), and show().

Referenced by executeCommand().

61  {
62  $cmd = $this->ilCtrl->getCmd();
63  switch ($cmd)
64  {
65  default:
66  $ret = $this->show();
67  }
68 
69  return $ret;
70  }
This class provides processing control methods.
$cmd
Definition: sahs_server.php:35
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 41 of file class.ilTestSubmissionReviewGUI.php.

References $ret, dispatchCommand(), ilCtrl\forwardCommand(), ilCtrl\getNextClass(), and getTestEvaluationGUI().

42  {
43  $next_class = $this->ilCtrl->getNextClass($this);
44 
45  switch($next_class)
46  {
47  case 'iltestoutputgui':
48  $this->ilCtrl->forwardCommand($this->testOutputGUI);
49  break;
50  case 'iltestevaluationgui':
51  $this->ilCtrl->forwardCommand($this->getTestEvaluationGUI());
52  break;
53  default:
54  $ret = $this->dispatchCommand();
55  break;
56  }
57  return $ret;
58  }
getNextClass()
Get next class in the control path from the current class to the target command class.
This class provides processing control methods.
& forwardCommand(&$a_gui_object)
Forward flow of control to next gui class this invokes the executeCommand() method of the gui object ...
+ 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 86 of file class.ilTestSubmissionReviewGUI.php.

Referenced by show().

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

◆ getTestEvaluationGUI()

ilTestSubmissionReviewGUI::getTestEvaluationGUI ( )
protected

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

Referenced by executeCommand().

73  {
74  require_once 'class.ilTestEvaluationGUI.php';
75  $eval_gui = new ilTestEvaluationGUI($this->test);
76 
77  return $eval_gui;
78  }
Output class for assessment test evaluation.
+ Here is the caller graph for this function:

◆ show()

ilTestSubmissionReviewGUI::show ( )

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

References $_GET, $filename, $ilSetting, $ilUser, $pass, $path, $results, ilTestPDFGenerator\generatePDF(), getContentBlockName(), ilCtrl\getFormAction(), ilUtil\getHtmlPath(), ilUtil\getImagePath(), ilUtil\getWebspaceDir(), ilUtil\makeDirParents(), ilTestPDFGenerator\PDF_OUTPUT_FILE, and ilCtrl\setParameter().

Referenced by dispatchCommand().

101  {
102  require_once 'class.ilTestEvaluationGUI.php';
103  require_once './Services/PDFGeneration/classes/class.ilPDFGeneration.php';
104 
105  global $ilUser;
106 
107  if ( ( array_key_exists("pass", $_GET) && (strlen($_GET["pass"]) > 0) ) || (!is_null($pass) ) )
108  {
109  if ( is_null($pass) )
110  {
111  $pass = $_GET["pass"];
112  }
113  }
114 
115  $template = new ilTemplate("tpl.il_as_tst_submission_review.html", TRUE, TRUE, "Modules/Test");
116 
117  $this->ilCtrl->setParameter($this, "skipfinalstatement", 1);
118  $template->setVariable("FORMACTION", $this->ilCtrl->getFormAction($this->testOutputGUI, 'redirectBack').'&reviewed=1');
119 
120  $template->setVariable("BUTTON_CONTINUE", $this->lng->txt("btn_next"));
121  $template->setVariable("BUTTON_BACK", $this->lng->txt("btn_previous"));
122 
123  if($this->test->getListOfQuestionsEnd())
124  {
125  $template->setVariable("CANCEL_CMD", 'outQuestionSummary');
126  }
127  else
128  {
129  $template->setVariable("CANCEL_CMD", 'backFromSummary');
130  }
131 
132  $this->ilCtrl->setParameter($this, "pass", "");
133  $this->ilCtrl->setParameter($this, "pdf", "");
134 
135  $active = $this->test->getActiveIdOfUser($ilUser->getId());
136 
137  $testevaluationgui = new ilTestEvaluationGUI($this->test);
138  $results = $this->test->getTestResult($active,$pass);
139  $results_output = $testevaluationgui->getPassListOfAnswers($results, $active, $pass, false, false, false, false);
140 
141  if ($this->test->getShowExamviewPdf())
142  {
143  $template->setCurrentBlock("pdf_export");
144  $template->setVariable("PDF_TEXT", $this->lng->txt("pdf_export"));
145  $template->setVariable("PDF_IMG_ALT", $this->lng->txt("pdf_export"));
146  $template->setVariable("PDF_IMG_URL", ilUtil::getHtmlPath(ilUtil::getImagePath("application-pdf.png")));
147  global $ilSetting;
148  $inst_id = $ilSetting->get('inst_id', null);
149  $path = ilUtil::getWebspaceDir() . '/assessment/'. $this->testOutputGUI->object->getId() . '/exam_pdf';
150  if (!is_dir($path))
151  {
153  }
154  $filename = $path . '/exam_N' . $inst_id . '-' . $this->testOutputGUI->object->getId() . '-' . $active . '-' . $pass . '.pdf';
155  require_once 'class.ilTestPDFGenerator.php';
157  $template->setVariable("PDF_FILE_LOCATION", $filename);
158  }
159 
160  if ($this->test->getShowExamviewHtml())
161  {
162  $template->setCurrentBlock('html_review');
163  $template->setVariable('HTML_REVIEW', $results_output);
164  }
165 
166  $this->tpl->setVariable($this->getContentBlockName(), $template->get() );
167  }
static makeDirParents($a_dir)
Create a new directory and all parent directories.
This class provides processing control methods.
$_GET["client_id"]
getContentBlockName()
Returns the name of the current content block (depends on the kiosk mode setting) ...
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
special template class to simplify handling of ITX/PEAR
Output class for assessment test evaluation.
$results
static getHtmlPath($relative_path)
get url of path
$filename
Definition: buildRTE.php:89
getFormAction(&$a_gui_obj, $a_fallback_cmd="", $a_anchor="", $a_asynch=false, $xml_style=true)
Get form action url for gui class object.
global $ilUser
Definition: imgupload.php:15
global $ilSetting
Definition: privfeed.php:40
$path
Definition: index.php:22
static generatePDF($pdf_output, $output_mode, $filename=null)
setParameter(&$a_obj, $a_parameter, $a_value)
Set parameters that should be passed a form and link of a gui class.
static getWebspaceDir($mode="filesystem")
get webspace directory
+ 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 25 of file class.ilTestSubmissionReviewGUI.php.

Referenced by __construct().

◆ $lng

ilTestSubmissionReviewGUI::$lng
protected

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

Referenced by __construct().

◆ $testOutputGUI

ilTestSubmissionReviewGUI::$testOutputGUI = null
protected

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

Referenced by __construct().

◆ $testSession

ilTestSubmissionReviewGUI::$testSession = null
protected

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

◆ $tpl

ilTestSubmissionReviewGUI::$tpl
protected

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

Referenced by __construct().


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