ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilTestSignatureGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4require_once 'Services/Export/classes/class.ilExportGUI.php';
5
15{
17 protected $lng;
18
20 protected $ilCtrl;
21
23 protected $tpl;
24
26 protected $testGUI;
27
30
32 protected $test;
33
35 protected $plugin;
36
37 public function __construct(ilTestOutputGUI $testOutputGUI)
38 {
39 global $lng, $ilCtrl, $tpl, $ilPluginAdmin;
40
41 $this->lng = $lng;
42 $this->ilCtrl = $ilCtrl;
43 $this->tpl = $tpl;
44
45 $this->ilTestOutputGUI = $testOutputGUI;
46 $this->test = $this->ilTestOutputGUI->object;
47
48 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_MODULE, 'Test', 'tsig');
49 $pl = current($pl_names);
50 $this->plugin = ilPluginAdmin::getPluginObject(IL_COMP_MODULE, 'Test', 'tsig', $pl);
51 $this->plugin->setGUIObject($this);
52 }
53
54 public function executeCommand()
55 {
56 $next_class = $this->ilCtrl->getNextClass($this);
57
58 switch ($next_class) {
59 default:
60 $ret = $this->dispatchCommand();
61 break;
62 }
63 return $ret;
64 }
65
66 protected function dispatchCommand()
67 {
69 global $ilUser;
70 $active = $this->test->getActiveIdOfUser($ilUser->getId());
71 $pass = $this->test->_getMaxPass($active);
72 $key = 'signed_' . $active . '_' . $pass;
73 ilSession::set($key, null);
74
75 $cmd = $this->ilCtrl->getCmd();
76 switch ($cmd) {
77 default:
78 $ret = $this->plugin->invoke($cmd);
79 }
80 return $ret;
81 }
82
86 public function setTest($test)
87 {
88 $this->test = $test;
89 }
90
94 public function getTest()
95 {
96 return $this->test;
97 }
98
102 public function setTestGUI($testGUI)
103 {
104 $this->testGUI = $testGUI;
105 }
106
110 public function getTestGUI()
111 {
112 return $this->testGUI;
113 }
114
118 public function setTestOutputGUI($testOutputGUI)
119 {
120 $this->ilTestOutputGUI = $testOutputGUI;
121 }
122
126 public function getTestOutputGUI()
127 {
129 }
130
134 public function redirectToTest($success)
135 {
138 global $ilCtrl, $ilUser;
139 $active = $this->test->getActiveIdOfUser($ilUser->getId());
140 $pass = $this->test->_getMaxPass($active);
141 $key = 'signed_' . $active . '_' . $pass;
143 $ilCtrl->redirect($this->ilTestOutputGUI, 'afterTestPassFinished');
144 return;
145 }
146}
$success
Definition: Utf8Test.php:86
An exception for terminatinating execution or to throw for unit testing.
const IL_COMP_MODULE
This class provides processing control methods.
getCmd($a_default_cmd="", $a_safe_commands="")
Determines current get/post command.
getNextClass($a_gui_class=null)
Get next class in the control path from the current class to the target command class.
static getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get Plugin Object.
static set($a_var, $a_val)
Set a value.
Output class for assessment test execution.
Signature Plugin Class.
__construct(ilTestOutputGUI $testOutputGUI)
$key
Definition: croninfo.php:18
$ret
Definition: parser.php:6
$ilUser
Definition: imgupload.php:18