ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f87
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 $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  {
60  default:
61  $ret = $this->dispatchCommand();
62  break;
63  }
64  return $ret;
65  }
66 
67  protected function dispatchCommand()
68  {
70  global $ilUser;
71  $active = $this->test->getActiveIdOfUser($ilUser->getId());
72  $pass = $this->test->_getMaxPass($active);
73  $key = 'signed_'. $active .'_'. $pass;
74  ilSession::set($key, null);
75 
76  $cmd = $this->ilCtrl->getCmd();
77  switch ($cmd)
78  {
79  default:
80  $ret = $this->plugin->invoke($cmd);
81  }
82  return $ret;
83  }
84 
88  public function setTest($test)
89  {
90  $this->test = $test;
91  }
92 
96  public function getTest()
97  {
98  return $this->test;
99  }
100 
104  public function setTestGUI($testGUI)
105  {
106  $this->testGUI = $testGUI;
107  }
108 
112  public function getTestGUI()
113  {
114  return $this->testGUI;
115  }
116 
120  public function setTestOutputGUI($testOutputGUI)
121  {
122  $this->ilTestOutputGUI = $testOutputGUI;
123  }
124 
128  public function getTestOutputGUI()
129  {
130  return $this->ilTestOutputGUI;
131  }
132 
136  public function redirectToTest($success)
137  {
140  global $ilCtrl, $ilUser;
141  $active = $this->test->getActiveIdOfUser($ilUser->getId());
142  $pass = $this->test->_getMaxPass($active);
143  $key = 'signed_'. $active .'_'. $pass;
144  ilSession::set($key, $success);
145  $ilCtrl->redirect($this->ilTestOutputGUI,'afterTestPassFinished');
146  return;
147  }
148 }
getNextClass()
Get next class in the control path from the current class to the target command class.
This class provides processing control methods.
Signature Plugin Class.
Output class for assessment test execution.
$cmd
Definition: sahs_server.php:35
static set($a_var, $a_val)
Set a value.
__construct(ilTestOutputGUI $testOutputGUI)
$success
Definition: Utf8Test.php:87
getCmd($a_default_cmd="", $a_safe_commands="")
Determines current get/post command.
const IL_COMP_MODULE
static getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get Plugin Object.
global $ilUser
Definition: imgupload.php:15