ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 
4 require_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 
29  protected $ilTestOutputGUI;
30 
32  protected $test;
33 
35  protected $plugin;
36 
37  public function __construct(ilTestOutputGUI $testOutputGUI)
38  {
39  global $DIC;
40  $lng = $DIC['lng'];
41  $ilCtrl = $DIC['ilCtrl'];
42  $tpl = $DIC['tpl'];
43  $ilPluginAdmin = $DIC['ilPluginAdmin'];
44 
45  $this->lng = $lng;
46  $this->ilCtrl = $ilCtrl;
47  $this->tpl = $tpl;
48 
49  $this->ilTestOutputGUI = $testOutputGUI;
50  $this->test = $this->ilTestOutputGUI->object;
51 
52  $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_MODULE, 'Test', 'tsig');
53  $pl = current($pl_names);
54  $this->plugin = ilPluginAdmin::getPluginObject(IL_COMP_MODULE, 'Test', 'tsig', $pl);
55  $this->plugin->setGUIObject($this);
56  }
57 
58  public function executeCommand()
59  {
60  $next_class = $this->ilCtrl->getNextClass($this);
61 
62  switch ($next_class) {
63  default:
64  $ret = $this->dispatchCommand();
65  break;
66  }
67  return $ret;
68  }
69 
70  protected function dispatchCommand()
71  {
73  global $DIC;
74  $ilUser = $DIC['ilUser'];
75  $active = $this->test->getActiveIdOfUser($ilUser->getId());
76  $pass = $this->test->_getMaxPass($active);
77  $key = 'signed_' . $active . '_' . $pass;
78  ilSession::set($key, null);
79 
80  $cmd = $this->ilCtrl->getCmd();
81  switch ($cmd) {
82  default:
83  $ret = $this->plugin->invoke($cmd);
84  }
85  return $ret;
86  }
87 
91  public function setTest($test)
92  {
93  $this->test = $test;
94  }
95 
99  public function getTest()
100  {
101  return $this->test;
102  }
103 
107  public function setTestGUI($testGUI)
108  {
109  $this->testGUI = $testGUI;
110  }
111 
115  public function getTestGUI()
116  {
117  return $this->testGUI;
118  }
119 
123  public function setTestOutputGUI($testOutputGUI)
124  {
125  $this->ilTestOutputGUI = $testOutputGUI;
126  }
127 
131  public function getTestOutputGUI()
132  {
133  return $this->ilTestOutputGUI;
134  }
135 
139  public function redirectToTest($success)
140  {
143  global $DIC;
144  $ilCtrl = $DIC['ilCtrl'];
145  $ilUser = $DIC['ilUser'];
146  $active = $this->test->getActiveIdOfUser($ilUser->getId());
147  $pass = $this->test->_getMaxPass($active);
148  $key = 'signed_' . $active . '_' . $pass;
150  $ilCtrl->redirect($this->ilTestOutputGUI, 'afterTestPassFinished');
151  return;
152  }
153 }
This class provides processing control methods.
Signature Plugin Class.
global $DIC
Definition: saml.php:7
Output class for assessment test execution.
static set($a_var, $a_val)
Set a value.
__construct(ilTestOutputGUI $testOutputGUI)
getNextClass($a_gui_class=null)
Get next class in the control path from the current class to the target command class.
$success
Definition: Utf8Test.php:86
getCmd($a_default_cmd="", $a_safe_commands="")
Determines current get/post command.
const IL_COMP_MODULE
$ilUser
Definition: imgupload.php:18
static getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get Plugin Object.
test()
Definition: build.php:107
$ret
Definition: parser.php:6
$key
Definition: croninfo.php:18