ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilObjAssessmentFolderGUI.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/Object/classes/class.ilObjectGUI.php";
5
6require_once 'Modules/Test/classes/class.ilObjTest.php';
7require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionProcessLocker.php';
8
20{
22
26 public function __construct($a_data, $a_id = 0, $a_call_by_reference = true, $a_prepare_output = true)
27 {
28 global $rbacsystem;
29
30 $this->type = "assf";
31 parent::__construct($a_data,$a_id,$a_call_by_reference,false);
32
33 if (!$rbacsystem->checkAccess('read',$this->object->getRefId()))
34 {
35 $this->ilias->raiseError($this->lng->txt("msg_no_perm_read_assf"),$this->ilias->error_obj->WARNING);
36 }
37
38 $this->lng->loadLanguageModule('assessment');
39 }
40
41 public function executeCommand()
42 {
47 global $rbacsystem, $ilTabs;
48
49 $next_class = $this->ctrl->getNextClass($this);
50 $cmd = $this->ctrl->getCmd();
51 $this->prepareOutput();
52
53 switch($next_class)
54 {
55 case 'ilpermissiongui':
56 $ilTabs->activateTab('perm_settings');
57 include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
58 $perm_gui = new ilPermissionGUI($this);
59 $ret =& $this->ctrl->forwardCommand($perm_gui);
60 break;
61
62 case 'ilsettingstemplategui':
64 break;
65
66 case 'ilglobalunitconfigurationgui':
67 if(!$rbacsystem->checkAccess('write', $this->object->getRefId()))
68 {
69 $this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->WARNING);
70 }
71
72 $ilTabs->setTabActive('units');
73
74 require_once 'Modules/TestQuestionPool/classes/class.ilGlobalUnitConfigurationGUI.php';
75 require_once 'Modules/TestQuestionPool/classes/class.ilUnitConfigurationRepository.php';
78 );
79 $this->ctrl->forwardCommand($gui);
80 break;
81
82 default:
83 if($cmd == "" || $cmd == "view")
84 {
85 $cmd = "settings";
86 }
87 $cmd .= "Object";
88 $this->$cmd();
89
90 break;
91 }
92 return true;
93 }
94
95
100 public function saveObject()
101 {
102 global $rbacadmin;
103
104 // create and insert forum in objecttree
105 $newObj = parent::saveObject();
106
107 // put here object specific stuff
108
109 // always send a message
110 ilUtil::sendSuccess($this->lng->txt("object_added"),true);
111
112 $this->ctrl->redirect($this);
113 }
114
115
119 public function settingsObject(ilPropertyFormGUI $form = null)
120 {
121 global $ilTabs;
122
123 $ilTabs->setTabActive('settings');
124
125 if($form === null)
126 {
127 $form = $this->buildSettingsForm();
128 }
129
130 $this->tpl->setVariable("ADM_CONTENT", $form->getHTML());
131 }
132
133 private function buildSettingsForm()
134 {
138 global $ilAccess;
139
140 include_once "./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
141 include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
142 $form = new ilPropertyFormGUI();
143 $form->setFormAction($this->ctrl->getFormAction($this));
144 $form->setTableWidth("100%");
145 $form->setId("settings");
146
148 $header->setTitle($this->lng->txt('settings'));
149 $form->addItem($header);
150
151 // question process locking behaviour (e.g. on saving users working data)
152 $chb = new ilCheckboxInputGUI($this->lng->txt('ass_process_lock'), 'ass_process_lock');
153 $chb->setChecked($this->object->getAssessmentProcessLockMode() != ilObjAssessmentFolder::ASS_PROC_LOCK_MODE_NONE);
154 $chb->setInfo($this->lng->txt('ass_process_lock_desc'));
155 $form->addItem($chb);
156 $rg = new ilRadioGroupInputGUI($this->lng->txt('ass_process_lock_mode'), 'ass_process_lock_mode');
157 $rg->setRequired(true);
158 $opt = new ilRadioOption($this->lng->txt('ass_process_lock_mode_file'), ilObjAssessmentFolder::ASS_PROC_LOCK_MODE_FILE);
159 $opt->setInfo($this->lng->txt('ass_process_lock_mode_file_desc'));
160 $rg->addOption($opt);
161 $opt = new ilRadioOption($this->lng->txt('ass_process_lock_mode_db'), ilObjAssessmentFolder::ASS_PROC_LOCK_MODE_DB);
162 $opt->setInfo($this->lng->txt('ass_process_lock_mode_db_desc'));
163 $rg->addOption($opt);
164 if($this->object->getAssessmentProcessLockMode() != ilObjAssessmentFolder::ASS_PROC_LOCK_MODE_NONE)
165 {
166 $rg->setValue($this->object->getAssessmentProcessLockMode());
167 }
168 $chb->addSubItem($rg);
169
170 $assessmentSetting = new ilSetting('assessment');
171 $imap_line_color = array_key_exists('imap_line_color', $_GET) ? $_GET['imap_line_color'] : $assessmentSetting->get('imap_line_color');
172 if(strlen($imap_line_color) == 0) $imap_line_color = 'FF0000';
173
174 $linepicker = new ilColorPickerInputGUI($this->lng->txt('assessment_imap_line_color'), 'imap_line_color');
175 $linepicker->setValue($imap_line_color);
176 $form->addItem($linepicker);
177
178 $user_criteria = array_key_exists('user_criteria', $_GET) ? $_GET['user_criteria'] : $assessmentSetting->get('user_criteria');
179 $userCriteria = new ilSelectInputGUI($this->lng->txt('user_criteria'), 'user_criteria');
180 $userCriteria->setInfo($this->lng->txt('user_criteria_desc'));
181 $userCriteria->setRequired(true);
182
183 $fields = array('usr_id', 'login', 'email', 'matriculation', 'ext_account');
184 $usr_fields = array();
185 foreach($fields as $field)
186 {
187 $usr_fields[$field] = $field;
188 }
189 $userCriteria->setOptions($usr_fields);
190 $userCriteria->setValue($user_criteria);
191 $form->addItem($userCriteria);
192
193 $numRequiredAnswers = new ilNumberInputGUI(
194 $this->lng->txt('tst_skill_triggerings_num_req_answers'), 'num_req_answers'
195 );
196 $numRequiredAnswers->setInfo($this->lng->txt('tst_skill_triggerings_num_req_answers_desc'));
197 $numRequiredAnswers->setSize(4);
198 $numRequiredAnswers->allowDecimals(false);
199 $numRequiredAnswers->setMinValue(1);
200 $numRequiredAnswers->setMinvalueShouldBeGreater(false);
201 $numRequiredAnswers->setValue($this->object->getSkillTriggeringNumAnswersBarrier());
202 $form->addItem($numRequiredAnswers);
203
204 $ceeqwh = new ilCheckboxInputGUI($this->lng->txt('export_essay_qst_with_html'), 'export_essay_qst_with_html');
205 $ceeqwh->setChecked($this->object->getExportEssayQuestionsWithHtml());
206 $ceeqwh->setInfo($this->lng->txt('export_essay_qst_with_html_desc'));
207 $form->addItem($ceeqwh);
208
209 // question settings
211 $header->setTitle($this->lng->txt("assf_questiontypes"));
212 $form->addItem($header);
213
214 // available question types
215 $allowed = new ilCheckboxGroupInputGUI($this->lng->txt('assf_allowed_questiontypes'), "chb_allowed_questiontypes");
216 $questiontypes =& ilObjQuestionPool::_getQuestionTypes(TRUE);
218 $allowedtypes = array();
219 foreach ($questiontypes as $qt)
220 {
221 if (!in_array($qt['question_type_id'], $forbidden_types)) array_push($allowedtypes, $qt['question_type_id']);
222 }
223 $allowed->setValue($allowedtypes);
224 foreach ($questiontypes as $type_name => $qtype)
225 {
226 $allowed->addOption(new ilCheckboxOption($type_name, $qtype["question_type_id"]));
227 }
228 $allowed->setInfo($this->lng->txt('assf_allowed_questiontypes_desc'));
229 $form->addItem($allowed);
230
231 // manual scoring
232 $manual = new ilCheckboxGroupInputGUI($this->lng->txt('assessment_log_manual_scoring_activate'), "chb_manual_scoring");
234 $manual->setValue($manscoring);
235 foreach ($questiontypes as $type_name => $qtype)
236 {
237 $manual->addOption(new ilCheckboxOption($type_name, $qtype["question_type_id"]));
238 }
239 $manual->setInfo($this->lng->txt('assessment_log_manual_scoring_desc'));
240 $form->addItem($manual);
241
242 // scoring adjustment active
243 $scoring_activation = new ilCheckboxInputGUI($this->lng->txt('assessment_scoring_adjust'),'chb_scoring_adjust');
244 $scoring_activation->setChecked($this->object->getScoringAdjustmentEnabled());
245 $scoring_activation->setInfo($this->lng->txt('assessment_scoring_adjust_desc'));
246 $form->addItem($scoring_activation);
247
248 // scoring adjustment
249 $scoring = new ilCheckboxGroupInputGUI($this->lng->txt('assessment_log_scoring_adjustment_activate'), "chb_scoring_adjustment");
250 $scoring_active = $this->object->getScoringAdjustableQuestions();
251 $scoring->setValue($scoring_active);
252 foreach ($this->object->fetchScoringAdjustableTypes($questiontypes) as $type_name => $qtype)
253 {
254 $scoring->addOption(new ilCheckboxOption($type_name, $qtype["question_type_id"]));
255 }
256 $scoring->setInfo($this->lng->txt('assessment_log_scoring_adjustment_desc'));
257 $form->addItem($scoring);
258
259 if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
260 {
261 $form->addCommandButton("saveSettings", $this->lng->txt("save"));
262 }
263
264 return $form;
265 }
266
270 public function saveSettingsObject()
271 {
272 global $ilAccess;
273 if (!$ilAccess->checkAccess("write", "", $this->object->getRefId())) $this->ctrl->redirect($this,'settings');
274
275 $form = $this->buildSettingsForm();
276 if(!$form->checkInput())
277 {
278 $form->setValuesByPost();
279 return $this->settingsObject($form);
280 }
281
282 $this->object->setSkillTriggeringNumAnswersBarrier((int)$_POST['num_req_answers']);
283 $this->object->setExportEssayQuestionsWithHtml((int) $_POST["export_essay_qst_with_html"] == 1);
284 $this->object->_setManualScoring($_POST["chb_manual_scoring"]);
285 include_once "./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
286 $questiontypes =& ilObjQuestionPool::_getQuestionTypes(TRUE);
287 $forbidden_types = array();
288 foreach ($questiontypes as $name => $row)
289 {
290 if (!in_array($row["question_type_id"], $_POST["chb_allowed_questiontypes"]))
291 {
292 array_push($forbidden_types, $row["question_type_id"]);
293 }
294 }
295 $this->object->_setForbiddenQuestionTypes($forbidden_types);
296
297 $this->object->setScoringAdjustmentEnabled($_POST['chb_scoring_adjust']);
298 $scoring_types = array();
299 foreach ($questiontypes as $name => $row)
300 {
301 if (in_array($row["question_type_id"], (array)$_POST["chb_scoring_adjustment"]))
302 {
303 array_push($scoring_types, $row["question_type_id"]);
304 }
305 }
306 $this->object->setScoringAdjustableQuestions($scoring_types);
307
308 if( !$_POST['ass_process_lock'] )
309 {
310 $this->object->setAssessmentProcessLockMode(ilObjAssessmentFolder::ASS_PROC_LOCK_MODE_NONE);
311 }
312 elseif( in_array($_POST['ass_process_lock_mode'], ilObjAssessmentFolder::getValidAssessmentProcessLockModes()) )
313 {
314 $this->object->setAssessmentProcessLockMode($_POST['ass_process_lock_mode']);
315 }
316
317 $assessmentSetting = new ilSetting('assessment');
318 $assessmentSetting->set('use_javascript', '1');
319 if(strlen($_POST['imap_line_color']) == 6)
320 {
321 $assessmentSetting->set('imap_line_color', ilUtil::stripSlashes($_POST['imap_line_color']));
322 }
323 $assessmentSetting->set('user_criteria', ilUtil::stripSlashes($_POST['user_criteria']));
324
325 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"),true);
326
327 $this->ctrl->redirect($this,'settings');
328 }
329
333 public function showLogObject()
334 {
335 $form = $this->getLogDataOutputForm();
336 $form->checkInput();
337
338 $form->setValuesByPost();
339 $this->logsObject($form);
340 }
341
345 public function exportLogObject()
346 {
347 $form = $this->getLogDataOutputForm();
348 if(!$form->checkInput())
349 {
350 $form->setValuesByPost();
351 $this->logsObject($form);
352 return;
353 }
354
355 $test = $form->getInput('sel_test');
356 $from = $form->getItemByPostVar('log_from')->getDate()->get(IL_CAL_UNIX);
357 $until = $form->getItemByPostVar('log_until')->getDate()->get(IL_CAL_UNIX);
358
359 $csv = array();
360 $separator = ";";
361 $row = array(
362 $this->lng->txt("assessment_log_datetime"),
363 $this->lng->txt("user"),
364 $this->lng->txt("assessment_log_text"),
365 $this->lng->txt("question")
366 );
367 include_once "./Modules/Test/classes/class.ilObjTest.php";
368 include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
369 $available_tests =& ilObjTest::_getAvailableTests(1);
370 array_push($csv, ilUtil::processCSVRow($row, TRUE, $separator));
371 $log_output = ilObjAssessmentFolder::getLog($from, $until, $test);
372 $users = array();
373 foreach ($log_output as $key => $log)
374 {
375 if (!array_key_exists($log["user_fi"], $users))
376 {
377 $users[$log["user_fi"]] = ilObjUser::_lookupName($log["user_fi"]);
378 }
379 $title = "";
380 if ($log["question_fi"] || $log["original_fi"])
381 {
383 if (strlen($title) == 0)
384 {
386 }
387 $title = $this->lng->txt("assessment_log_question") . ": " . $title;
388 }
389 $csvrow = array();
390 $date = new ilDateTime($log['tstamp'],IL_CAL_UNIX);
391 array_push($csvrow, $date->get(IL_CAL_FKT_DATE,'Y-m-d H:i'));
392 array_push($csvrow, trim($users[$log["user_fi"]]["title"] . " " . $users[$log["user_fi"]]["firstname"] . " " . $users[$log["user_fi"]]["lastname"]));
393 array_push($csvrow, trim($log["logtext"]));
394 array_push($csvrow, $title);
395 array_push($csv, ilUtil::processCSVRow($csvrow, TRUE, $separator));
396 }
397 $csvoutput = "";
398 foreach ($csv as $row)
399 {
400 $csvoutput .= join($row, $separator) . "\n";
401 }
402 ilUtil::deliverData($csvoutput, str_replace(" ", "_", "log_" . $from . "_" . $until . "_" . $available_tests[$test]).".csv");
403 }
404
408 protected function getLogDataOutputForm()
409 {
410 require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
411 $form = new ilPropertyFormGUI();
412 $form->setPreventDoubleSubmission(false);
413 $form->setFormAction($this->ctrl->getFormAction($this));
414 $form->setTableWidth("100%");
415 $form->setId("logs");
416
418 $header->setTitle($this->lng->txt("assessment_log"));
419 $form->addItem($header);
420
421 // from
422 $from = new ilDateTimeInputGUI($this->lng->txt('cal_from'), "log_from");
423 $from->setShowTime(true);
424 $from->setRequired(true);
425 $form->addItem($from);
426
427 // until
428 $until = new ilDateTimeInputGUI($this->lng->txt('cal_until'), "log_until");
429 $until->setShowTime(true);
430 $until->setRequired(true);
431 $form->addItem($until);
432
433 require_once 'Modules/Test/classes/class.ilObjTest.php';
434 require_once 'Modules/TestQuestionPool/classes/class.assQuestion.php';
435 $available_tests = ilObjTest::_getAvailableTests(1);
436
437 // tests
438 $fortest = new ilSelectInputGUI($this->lng->txt('assessment_log_for_test'), "sel_test");
439 $fortest->setRequired(true);
440 $sorted_options = array();
441 foreach($available_tests as $key => $value)
442 {
443 $sorted_options[] = array(
444 'title' => ilUtil::prepareFormOutput($value) . " [" . $this->object->getNrOfLogEntries($key) . " " . $this->lng->txt("assessment_log_log_entries") . "]",
445 'key' => $key
446 );
447 }
448 $sorted_options = ilUtil::sortArray($sorted_options, 'title','asc');
449 $options = array('' => $this->lng->txt('please_choose'));
450 foreach($sorted_options as $option)
451 {
452 $options[$option['key']] = $option['title'];
453 }
454 $fortest->setOptions($options);
455 $form->addItem($fortest);
456
457 $form->addCommandButton('showLog', $this->lng->txt('show'));
458 $form->addCommandButton('exportLog', $this->lng->txt('export'));
459
460 return $form;
461 }
462
466 public function logsObject(ilPropertyFormGUI $form = null)
467 {
471 global $ilTabs;
472
473 $ilTabs->activateTab('logs');
474
475 $template = new ilTemplate("tpl.assessment_logs.html", TRUE, TRUE, "Modules/Test");
476
477 $p_test = 0;
478 $fromdate = 0;
479 $untildate = 0;
480
481 if(!($form instanceof ilPropertyFormGUI))
482 {
483 $form = $this->getLogDataOutputForm();
484
485 $values = array();
486 if(isset($_GET['sel_test']))
487 {
488 $p_test = $values['sel_test'] = (int)$_GET['sel_test'];
489 }
490
491 if(isset($_GET['log_from']))
492 {
493 $fromdate = (int)$_GET['log_from'];
494 }
495 else
496 {
497 $fromdate = mktime(0, 0, 0, 1, 1, date('Y'));
498 }
499
500 if(isset($_GET['log_until']))
501 {
502 $untildate = (int)$_GET['log_until'];
503 }
504 else
505 {
506 $untildate = time();
507 }
508
509 $values['log_from'] = new ilDateTime($fromdate, IL_CAL_UNIX);
510 $values['log_until'] = new ilDateTime($untildate, IL_CAL_UNIX);
511
512 $form->setValuesByArray($values);
513 }
514 else
515 {
516 $fromdate_input = $form->getItemByPostVar('log_from')->getDate();
517 $untildate_input = $form->getItemByPostVar('log_until')->getDate();
518 if($fromdate_input instanceof ilDateTime && $untildate_input instanceof ilDateTime)
519 {
520 $p_test = $form->getInput('sel_test');
521
522 $fromdate = $fromdate_input->get(IL_CAL_UNIX);
523 $untildate = $untildate_input->get(IL_CAL_UNIX);
524 }
525 }
526
527 $this->ctrl->setParameter($this, 'sel_test', (int)$p_test);
528 $this->ctrl->setParameter($this, 'log_until', (int)$untildate);
529 $this->ctrl->setParameter($this, 'log_from', (int)$fromdate);
530
531 $template->setVariable("FORM", $form->getHTML());
532
533 if($p_test)
534 {
535 require_once "Services/Link/classes/class.ilLink.php";
536 include_once "./Modules/Test/classes/tables/class.ilAssessmentFolderLogTableGUI.php";
537 $table_gui = new ilAssessmentFolderLogTableGUI($this, 'logs');
538 $log_output = ilObjAssessmentFolder::getLog($fromdate, $untildate, $p_test);
539
540 $self = $this;
541 array_walk($log_output, function(&$row) use ($self) {
542 if(is_numeric($row['ref_id']) && $row['ref_id'] > 0)
543 {
544 $row['location_href'] = ilLink::_getLink($row['ref_id'], 'tst');
545 $row['location_txt'] = $self->lng->txt("perma_link");
546 }
547 });
548
549 $table_gui->setData($log_output);
550 $template->setVariable('LOG', $table_gui->getHTML());
551 }
552 $this->tpl->setVariable("ADM_CONTENT", $template->get());
553 }
554
558 public function deleteLogObject()
559 {
560 if (is_array($_POST["chb_test"]) && (count($_POST["chb_test"])))
561 {
562 $this->object->deleteLogEntries($_POST["chb_test"]);
563 ilUtil::sendSuccess($this->lng->txt("ass_log_deleted"));
564 }
565 else
566 {
567 ilUtil::sendInfo($this->lng->txt("ass_log_delete_no_selection"));
568 }
569 $this->logAdminObject();
570 }
571
575 public function logAdminObject()
576 {
577 global $ilAccess, $ilTabs;
578
579 $ilTabs->activateTab('logs');
580
581 $a_write_access = ($ilAccess->checkAccess("write", "", $this->object->getRefId())) ? true : false;
582
583 include_once "./Modules/Test/classes/tables/class.ilAssessmentFolderLogAdministrationTableGUI.php";
584 $table_gui = new ilAssessmentFolderLogAdministrationTableGUI($this, 'logAdmin', $a_write_access);
585 include_once "./Modules/Test/classes/class.ilObjTest.php";
586 require_once "./Services/Link/classes/class.ilLink.php";
587 $available_tests = ilObjTest::_getAvailableTests(false);
588 $data = array();
589 foreach ($available_tests as $ref_id => $title)
590 {
592 array_push($data, array(
593 "title" => $title,
594 "nr" => $this->object->getNrOfLogEntries($obj_id),
595 "id" => $obj_id,
596 "location_href" => ilLink::_getLink($ref_id, 'tst'),
597 "location_txt" => $this->lng->txt("perma_link")
598 ));
599 }
600 $table_gui->setData($data);
601 $this->tpl->setVariable('ADM_CONTENT', $table_gui->getHTML());
602 }
603
604 public function getAdminTabs()
605 {
606 $this->getTabs();
607 }
608
609 public function getLogdataSubtabs()
610 {
611 global $ilTabs;
612
613 // log settings
614 $ilTabs->addSubTabTarget("settings",
615 $this->ctrl->getLinkTarget($this, "showLogSettings"),
616 array("saveLogSettings", "showLogSettings")
617 , "");
618
619 // log output
620 $ilTabs->addSubTabTarget("ass_log_output",
621 $this->ctrl->getLinkTarget($this, "logs"),
622 array("logs", "showLog", "exportLog")
623 , "");
624
625 // log administration
626 $ilTabs->addSubTabTarget("ass_log_admin",
627 $this->ctrl->getLinkTarget($this, "logAdmin"),
628 array("logAdmin", "deleteLog"),
629 "", "");
630
631 }
632
638 public function getTabs()
639 {
640 global $rbacsystem, $lng;
641
642 switch ($this->ctrl->getCmd())
643 {
644 case "saveLogSettings":
645 case "showLogSettings":
646 case "logs":
647 case "showLog":
648 case "exportLog":
649 case "logAdmin":
650 case "deleteLog":
651 $this->getLogdataSubtabs();
652 break;
653 }
654
655 if ($rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
656 {
657 $this->tabs_gui->addTarget("settings",
658 $this->ctrl->getLinkTarget($this, "settings"), array("settings","","view"), "", "");
659
660 $this->tabs_gui->addTarget("logs",
661 $this->ctrl->getLinkTarget($this, "showLogSettings"),
662 array('saveLogSettings', 'showLogSettings', "logs","showLog", "exportLog", "logAdmin", "deleteLog"),
663 "", "");
664
665 $this->tabs_gui->addTab("templates",
666 $lng->txt("adm_settings_templates"),
667 $this->ctrl->getLinkTargetByClass("ilsettingstemplategui", ""));
668 }
669
670 if ($rbacsystem->checkAccess("write",$this->object->getRefId()))
671 {
672 $this->tabs_gui->addTarget('units', $this->ctrl->getLinkTargetByClass('ilGlobalUnitConfigurationGUI', ''), '', 'ilglobalunitconfigurationgui');
673 }
674
675 if ($rbacsystem->checkAccess('edit_permission',$this->object->getRefId()))
676 {
677 $this->tabs_gui->addTarget("perm_settings",
678 $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"), array("perm","info","owner"), 'ilpermissiongui');
679 }
680 }
681
685 protected function showLogSettingsObject(ilPropertyFormGUI $form = null)
686 {
687 $this->tabs_gui->activateTab('logs');
688
689 if(!($form instanceof ilPropertyFormGUI))
690 {
691 $form = $this->getLogSettingsForm();
692 $form->setValuesByArray(array(
693 'chb_assessment_logging' => ilObjAssessmentFolder::_enabledAssessmentLogging(),
694 'reporting_language' => ilObjAssessmentFolder::_getLogLanguage()
695 ));
696 }
697
698 $this->tpl->setContent($form->getHTML());
699 }
700
704 protected function saveLogSettingsObject()
705 {
709 global $ilAccess;
710
711 if(!$ilAccess->checkAccess('write', '', $this->object->getRefId()))
712 {
713 $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->WARNING);
714 }
715
716 $form = $this->getLogSettingsForm();
717 if($form->checkInput())
718 {
719 $this->object->_enableAssessmentLogging((int)$form->getInput('chb_assessment_logging'));
720 $this->object->_setLogLanguage($form->getInput('reporting_language'));
721 $this->object->update();
722 ilUtil::sendSuccess($this->lng->txt('saved_successfully'));
723 }
724
725 $form->setValuesByPost();
726 $this->showLogSettingsObject($form);
727 }
728
732 protected function getLogSettingsForm()
733 {
737 global $ilAccess;
738
739 require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
740 $form = new ilPropertyFormGUI();
741 $form->setFormAction($this->ctrl->getFormAction($this, 'saveLogSettings'));
742 $form->setTitle($this->lng->txt('assessment_log_logging'));
743
744 $logging = new ilCheckboxInputGUI('', 'chb_assessment_logging');
745 $logging->setValue(1);
746 $logging->setOptionTitle($this->lng->txt('activate_assessment_logging'));
747 $form->addItem($logging);
748
749 $reporting = new ilSelectInputGUI($this->lng->txt('assessment_settings_reporting_language'), 'reporting_language');
750 $languages = $this->lng->getInstalledLanguages();
751 $this->lng->loadLanguageModule('meta');
752 $options = array();
753 foreach($languages as $lang)
754 {
755 $options[$lang] = $this->lng->txt('meta_l_' . $lang);
756 }
757 $reporting->setOptions($options);
758 $form->addItem($reporting);
759
760 if($ilAccess->checkAccess('write', '', $this->object->getRefId()))
761 {
762 $form->addCommandButton('saveLogSettings', $this->lng->txt('save'));
763 }
764
765 return $form;
766 }
767
769 {
770 global $ilTabs;
771
772 $ilTabs->setTabActive('templates');
773
774 require_once 'Services/Administration/classes/class.ilSettingsTemplateGUI.php';
775 $gui = new ilSettingsTemplateGUI(self::getSettingsTemplateConfig());
776
777 $this->ctrl->forwardCommand($gui);
778 }
779
783 public static function getSettingsTemplateConfig()
784 {
785 global $lng;
786
787 require_once 'Modules/Test/classes/class.ilTestSettingsTemplateConfig.php';
789 $config->init();
790
791 return $config;
792 }
793}
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
$test
Definition: Utf8Test.php:84
$_GET["client_id"]
$_POST["username"]
An exception for terminatinating execution or to throw for unit testing.
const IL_CAL_UNIX
const IL_CAL_FKT_DATE
static _getQuestionTitle($question_id)
Returns the question title of a question with a given id.
This class represents a property in a property form.
This class represents a checkbox property in a property form.
This class represents an option in a checkbox group.
Color picker form for selecting color hexcodes using yui library.
This class represents a date/time property in a property form.
@classDescription Date and time handling
This class represents a section header in a property form.
Class ilGlobalUnitConfigurationGUI.
This class represents a number property in a property form.
Class ilObjAssessmentFolderGUI.
__construct($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
Constructor.
settingsObject(ilPropertyFormGUI $form=null)
display assessment folder settings form
logAdminObject()
Administration output for assessment log files.
getAdminTabs()
administration tabs show only permissions and trash folder
saveSettingsObject()
Save Assessment settings.
deleteLogObject()
Deletes the log entries for one or more tests.
showLogSettingsObject(ilPropertyFormGUI $form=null)
exportLogObject()
Called when the a log should be exported.
showLogObject()
Called when the a log should be shown.
saveObject()
save object @access public
static _getLogLanguage()
retrieve the log language for assessment logging
static _getManualScoring()
Retrieve the manual scoring settings.
static getLog($ts_from, $ts_to, $test_id, $test_only=FALSE)
Retrieve assessment log datasets from the database.
static _getForbiddenQuestionTypes()
Returns the forbidden questiontypes for ILIAS.
static _enabledAssessmentLogging()
check wether assessment logging is enabled or not
static _getQuestionTypes($all_tags=FALSE, $fixOrder=false)
static _getAvailableTests($use_object_id=FALSE)
Returns the available tests for the active user.
static _lookupName($a_user_id)
lookup user name
Class ilObjectGUI Basic methods of all Output classes.
prepareOutput($a_show_subobjects=true)
prepare output
executeCommand()
execute command
static _lookupObjectId($a_ref_id)
lookup object id
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
This class represents a property form user interface.
This class represents a property in a property form.
This class represents an option in a radio group.
This class represents a selection list property in a property form.
ILIAS Setting Class.
special template class to simplify handling of ITX/PEAR
Class ilUnitConfigurationRepository.
static sortArray($array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static deliverData($a_data, $a_filename, $mime="application/octet-stream", $charset="")
deliver data for download via browser.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static & processCSVRow(&$row, $quoteAll=FALSE, $separator=";", $outUTF8=FALSE, $compatibleWithMSExcel=TRUE)
Convertes an array for CSV usage.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms @access public
$languages
Definition: cssgen2.php:34
$header
for($i=1; $i<=count($kw_cases_sel); $i+=1) $lang
Definition: langwiz.php:349
redirection script todo: (a better solution should control the processing via a xml file)
$ret
Definition: parser.php:6
$cmd
Definition: sahs_server.php:35
if(!is_array($argv)) $options