46 $this->
ctrl = $DIC[
'ilCtrl'];
47 $this->
lng = $DIC[
'lng'];
48 $this->main_tpl = $DIC->ui()->mainTemplate();
65 $this->
getTestObj()->getProcessingTimeInSeconds() > 0
76 switch ($this->
ctrl->getNextClass($this)) {
79 $command = $this->
ctrl->getCmd(self::CMD_SHOW_LIST) .
'Cmd';
88 $tableGUI->addCommandButton(self::CMD_SHOW_FORM, $this->
lng->txt(
'timing'));
91 $participantList->initializeFromDbRows($this->
getTestObj()->getTestParticipants());
93 $participantList = $participantList->getAccessFilteredList(
97 $addons = $this->
getTestObj()->getTimeExtensionsOfParticipants();
100 foreach ($participantList as $participant) {
104 'login' => $participant->getLogin(),
105 'name' => $this->
lng->txt(
"anonymous")
108 $time = $this->
getTestObj()->getStartingTimeOfUser($participant->getActiveId());
114 $tblRow[
'started'] = $started;
117 $participant_id = $participant->getActiveId();
118 if (array_key_exists($participant_id, $addons) && $addons[$participant_id] > 0) {
119 $tblRow[
'extratime'] = $addons[$participant_id];
123 $tblRow[
'name'] = $participant->getLastname() .
', ' . $participant->getFirstname();
126 $tableData[] = $tblRow;
129 $tableGUI->setData($tableData);
131 $this->main_tpl->setContent($this->
ctrl->getHTML($tableGUI));
143 $form->setFormAction($this->
ctrl->getFormAction($this));
144 $form->setTableWidth(
"100%");
145 $form->setId(
"tst_change_workingtime");
146 $form->setTitle($this->
lng->txt(
"tst_change_workingtime"));
149 require_once
'Modules/Test/classes/class.ilTestParticipantList.php';
151 $participantList->initializeFromDbRows($this->
getTestObj()->getTestParticipants());
153 $participantList = $participantList->getAccessFilteredList(
157 $addons = $this->
getTestObj()->getTimeExtensionsOfParticipants();
162 '' => $this->
lng->txt(
'please_select'),
163 '0' => $this->
lng->txt(
'all_participants')
166 foreach ($participantList as $participant) {
170 $name = $this->
lng->txt(
"anonymous");
172 $name = $participant->getLastname() .
', ' . $participant->getFirstname();
175 $time = $this->
getTestObj()->getStartingTimeOfUser($participant->getActiveId());
180 $participant_id = $participant->getActiveId();
181 if (array_key_exists($participant_id, $addons) && $addons[$participant_id] > 0) {
182 $started .=
", " . $this->
lng->txt(
'extratime') .
': ' . $addons[$participant_id] .
' ' . $this->
lng->txt(
'minutes');
185 $options[$participant->getActiveId()] = $participant->getLogin() .
' (' .
$name .
')' . $started;
188 $participantslist->setRequired(
true);
189 $participantslist->setOptions($options);
190 $form->addItem($participantslist);
194 $extratime->
setInfo($this->
lng->txt(
'tst_extratime_info'));
195 $extratime->setRequired(
true);
196 $extratime->setMinValue(0);
197 $extratime->setMinvalueShouldBeGreater(
false);
198 $extratime->setSuffix($this->
lng->txt(
'minutes'));
199 $extratime->setSize(5);
200 $form->addItem($extratime);
202 if (is_array($_POST) && isset($_POST[
'cmd'][
'timing']) && $_POST[
'cmd'][
'timing'] !=
'') {
203 $form->setValuesByArray($_POST);
206 $form->addCommandButton(self::CMD_SET_TIMING, $this->
lng->txt(
"save"));
207 $form->addCommandButton(self::CMD_SHOW_LIST, $this->
lng->txt(
"cancel"));
216 if ($form->checkInput()) {
218 $form->getInput(
'participant'),
219 $form->getInput(
'extratime')
222 $this->main_tpl->setOnScreenMessage(
'success', sprintf($this->
lng->txt(
'tst_extratime_added'), $form->getInput(
'extratime')),
true);
223 $this->
ctrl->redirect($this, self::CMD_SHOW_LIST);
226 $this->main_tpl->setVariable(
"ADM_CONTENT", $form->getHTML());
const CMD_SHOW_LIST
Command Constants.
isExtraTimeFeatureAvailable()
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
static accessViolationRedirect()
ilGlobalTemplateInterface $main_tpl
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setTestObj(ilObjTest $testObj)
static getManageParticipantsUserFilter($refId)
__construct(ilObjTest $testObj)