ILIAS  release_8 Revision v8.24
class.ilTestSignatureGUI.php
Go to the documentation of this file.
1<?php
2
28{
30 protected $lng;
31
33 protected $ilCtrl;
34
36 protected $tpl;
37
39 protected $testGUI;
40
43
45 protected $test;
46
48 protected $plugin;
49
50 public function __construct(ilTestOutputGUI $testOutputGUI)
51 {
52 global $DIC;
53 $lng = $DIC['lng'];
54 $ilCtrl = $DIC['ilCtrl'];
55 $tpl = $DIC['tpl'];
56 $component_factory = $DIC["component.factory"];
57
58 $this->lng = $lng;
59 $this->ilCtrl = $ilCtrl;
60 $this->tpl = $tpl;
61
62 $this->ilTestOutputGUI = $testOutputGUI;
63 $this->test = $this->ilTestOutputGUI->object;
64
65 $plugins = $component_factory->getActivePluginsInSlot("tsig");
66 $this->plugin = current($plugins);
67 $this->plugin->setGUIObject($this);
68 }
69
70 public function executeCommand()
71 {
72 $next_class = $this->ilCtrl->getNextClass($this);
73
74 switch ($next_class) {
75 default:
76 $ret = $this->dispatchCommand();
77 break;
78 }
79 return $ret;
80 }
81
82 protected function dispatchCommand()
83 {
85 global $DIC;
86 $ilUser = $DIC['ilUser'];
87 $active = $this->test->getActiveIdOfUser($ilUser->getId());
88 $pass = $this->test->_getMaxPass($active);
89 $key = 'signed_' . $active . '_' . $pass;
90 ilSession::set($key, null);
91
92 $cmd = $this->ilCtrl->getCmd();
93 switch ($cmd) {
94 default:
95 $ret = $this->plugin->invoke($cmd);
96 }
97 return $ret;
98 }
99
103 public function setTest($test)
104 {
105 $this->test = $test;
106 }
107
111 public function getTest(): ilObjTest
112 {
113 return $this->test;
114 }
115
119 public function setTestGUI($testGUI)
120 {
121 $this->testGUI = $testGUI;
122 }
123
127 public function getTestGUI(): ilObjTestGUI
128 {
129 return $this->testGUI;
130 }
131
135 public function setTestOutputGUI($testOutputGUI)
136 {
137 $this->ilTestOutputGUI = $testOutputGUI;
138 }
139
144 {
146 }
147
151 public function redirectToTest($success)
152 {
155 global $DIC;
156 $ilCtrl = $DIC['ilCtrl'];
157 $ilUser = $DIC['ilUser'];
158 $active = $this->test->getActiveIdOfUser($ilUser->getId());
159 $pass = $this->test->_getMaxPass($active);
160 $key = 'signed_' . $active . '_' . $pass;
161 ilSession::set($key, $success);
162 $ilCtrl->redirect($this->ilTestOutputGUI, 'afterTestPassFinished');
163 return;
164 }
165}
Class ilCtrl provides processing control methods.
getNextClass($a_gui_class=null)
@inheritDoc
getCmd(string $fallback_command=null)
@inheritDoc
Class ilObjTestGUI.
static set(string $a_var, $a_val)
Set a value.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(ilTestOutputGUI $testOutputGUI)
global $DIC
Definition: feed.php:28
$ilUser
Definition: imgupload.php:34
string $key
Consumer key/client ID value.
Definition: System.php:193