ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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 
4 require_once "./Services/Object/classes/class.ilObjectGUI.php";
5 
6 require_once 'Modules/Test/classes/class.ilObjTest.php';
7 require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionProcessLocker.php';
8 
20 {
22 
26  public function ilObjAssessmentFolderGUI($a_data,$a_id,$a_call_by_reference)
27  {
28  global $rbacsystem;
29 
30  $this->type = "assf";
31  $this->ilObjectGUI($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  // question settings
206  $header->setTitle($this->lng->txt("assf_questiontypes"));
207  $form->addItem($header);
208 
209  // available question types
210  $allowed = new ilCheckboxGroupInputGUI($this->lng->txt('assf_allowed_questiontypes'), "chb_allowed_questiontypes");
211  $questiontypes =& ilObjQuestionPool::_getQuestionTypes(TRUE);
212  $forbidden_types = $this->object->_getForbiddenQuestionTypes();
213  $allowedtypes = array();
214  foreach ($questiontypes as $qt)
215  {
216  if (!in_array($qt['question_type_id'], $forbidden_types)) array_push($allowedtypes, $qt['question_type_id']);
217  }
218  $allowed->setValue($allowedtypes);
219  foreach ($questiontypes as $type_name => $qtype)
220  {
221  $allowed->addOption(new ilCheckboxOption($type_name, $qtype["question_type_id"]));
222  }
223  $allowed->setInfo($this->lng->txt('assf_allowed_questiontypes_desc'));
224  $form->addItem($allowed);
225 
226  // manual scoring
227  $manual = new ilCheckboxGroupInputGUI($this->lng->txt('assessment_log_manual_scoring_activate'), "chb_manual_scoring");
228  $manscoring = $this->object->_getManualScoring();
229  $manual->setValue($manscoring);
230  foreach ($questiontypes as $type_name => $qtype)
231  {
232  $manual->addOption(new ilCheckboxOption($type_name, $qtype["question_type_id"]));
233  }
234  $manual->setInfo($this->lng->txt('assessment_log_manual_scoring_desc'));
235  $form->addItem($manual);
236 
237  // scoring adjustment active
238  $scoring_activation = new ilCheckboxInputGUI($this->lng->txt('assessment_scoring_adjust'),'chb_scoring_adjust');
239  $scoring_activation->setChecked($this->object->getScoringAdjustmentEnabled());
240  $scoring_activation->setInfo($this->lng->txt('assessment_scoring_adjust_desc'));
241  $form->addItem($scoring_activation);
242 
243  // scoring adjustment
244  $scoring = new ilCheckboxGroupInputGUI($this->lng->txt('assessment_log_scoring_adjustment_activate'), "chb_scoring_adjustment");
245  $scoring_active = $this->object->getScoringAdjustableQuestions();
246  $scoring->setValue($scoring_active);
247  foreach ($this->object->fetchScoringAdjustableTypes($questiontypes) as $type_name => $qtype)
248  {
249  $scoring->addOption(new ilCheckboxOption($type_name, $qtype["question_type_id"]));
250  }
251  $scoring->setInfo($this->lng->txt('assessment_log_scoring_adjustment_desc'));
252  $form->addItem($scoring);
253 
254  if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
255  {
256  $form->addCommandButton("saveSettings", $this->lng->txt("save"));
257  }
258 
259  return $form;
260  }
261 
265  public function saveSettingsObject()
266  {
267  global $ilAccess;
268  if (!$ilAccess->checkAccess("write", "", $this->object->getRefId())) $this->ctrl->redirect($this,'settings');
269 
270  $form = $this->buildSettingsForm();
271  if(!$form->checkInput())
272  {
273  $form->setValuesByPost();
274  return $this->settingsObject($form);
275  }
276 
277  $this->object->setSkillTriggeringNumAnswersBarrier((int)$_POST['num_req_answers']);
278 
279  $this->object->_setManualScoring($_POST["chb_manual_scoring"]);
280  include_once "./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
281  $questiontypes =& ilObjQuestionPool::_getQuestionTypes(TRUE);
282  $forbidden_types = array();
283  foreach ($questiontypes as $name => $row)
284  {
285  if (!in_array($row["question_type_id"], $_POST["chb_allowed_questiontypes"]))
286  {
287  array_push($forbidden_types, $row["question_type_id"]);
288  }
289  }
290  $this->object->_setForbiddenQuestionTypes($forbidden_types);
291 
292  $this->object->setScoringAdjustmentEnabled($_POST['chb_scoring_adjust']);
293  $scoring_types = array();
294  foreach ($questiontypes as $name => $row)
295  {
296  if (in_array($row["question_type_id"], (array)$_POST["chb_scoring_adjustment"]))
297  {
298  array_push($scoring_types, $row["question_type_id"]);
299  }
300  }
301  $this->object->setScoringAdjustableQuestions($scoring_types);
302 
303  if( !$_POST['ass_process_lock'] )
304  {
305  $this->object->setAssessmentProcessLockMode(ilObjAssessmentFolder::ASS_PROC_LOCK_MODE_NONE);
306  }
307  elseif( in_array($_POST['ass_process_lock_mode'], ilObjAssessmentFolder::getValidAssessmentProcessLockModes()) )
308  {
309  $this->object->setAssessmentProcessLockMode($_POST['ass_process_lock_mode']);
310  }
311 
312  $assessmentSetting = new ilSetting('assessment');
313  $assessmentSetting->set('use_javascript', '1');
314  if(strlen($_POST['imap_line_color']) == 6)
315  {
316  $assessmentSetting->set('imap_line_color', ilUtil::stripSlashes($_POST['imap_line_color']));
317  }
318  $assessmentSetting->set('user_criteria', ilUtil::stripSlashes($_POST['user_criteria']));
319 
320  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"),true);
321 
322  $this->ctrl->redirect($this,'settings');
323  }
324 
328  public function showLogObject()
329  {
330  $from = mktime($_POST['log_from']['time']['h'], $_POST['log_from']['time']['m'], 0, $_POST['log_from']['date']['m'], $_POST['log_from']['date']['d'], $_POST['log_from']['date']['y']);
331  $until = mktime($_POST['log_until']['time']['h'], $_POST['log_until']['time']['m'], 0, $_POST['log_until']['date']['m'], $_POST['log_until']['date']['d'], $_POST['log_until']['date']['y']);
332  $test = $_POST['sel_test'];
333  $this->logsObject($from, $until, $test);
334  }
335 
339  public function exportLogObject()
340  {
341  $from = mktime($_POST['log_from']['time']['h'], $_POST['log_from']['time']['m'], 0, $_POST['log_from']['date']['m'], $_POST['log_from']['date']['d'], $_POST['log_from']['date']['y']);
342  $until = mktime($_POST['log_until']['time']['h'], $_POST['log_until']['time']['m'], 0, $_POST['log_until']['date']['m'], $_POST['log_until']['date']['d'], $_POST['log_until']['date']['y']);
343  $test = $_POST['sel_test'];
344 
345  $csv = array();
346  $separator = ";";
347  $row = array(
348  $this->lng->txt("assessment_log_datetime"),
349  $this->lng->txt("user"),
350  $this->lng->txt("assessment_log_text"),
351  $this->lng->txt("question")
352  );
353  include_once "./Modules/Test/classes/class.ilObjTest.php";
354  include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
355  $available_tests =& ilObjTest::_getAvailableTests(1);
356  array_push($csv, ilUtil::processCSVRow($row, TRUE, $separator));
357  $log_output =& $this->object->getLog($from, $until, $test);
358  $users = array();
359  foreach ($log_output as $key => $log)
360  {
361  if (!array_key_exists($log["user_fi"], $users))
362  {
363  $users[$log["user_fi"]] = ilObjUser::_lookupName($log["user_fi"]);
364  }
365  $title = "";
366  if ($log["question_fi"] || $log["original_fi"])
367  {
368  $title = assQuestion::_getQuestionTitle($log["question_fi"]);
369  if (strlen($title) == 0)
370  {
371  $title = assQuestion::_getQuestionTitle($log["original_fi"]);
372  }
373  $title = $this->lng->txt("assessment_log_question") . ": " . $title;
374  }
375  $csvrow = array();
376  $date = new ilDateTime($log['tstamp'],IL_CAL_UNIX);
377  array_push($csvrow, $date->get(IL_CAL_FKT_DATE,'Y-m-d H:i'));
378  array_push($csvrow, trim($users[$log["user_fi"]]["title"] . " " . $users[$log["user_fi"]]["firstname"] . " " . $users[$log["user_fi"]]["lastname"]));
379  array_push($csvrow, trim($log["logtext"]));
380  array_push($csvrow, $title);
381  array_push($csv, ilUtil::processCSVRow($csvrow, TRUE, $separator));
382  }
383  $csvoutput = "";
384  foreach ($csv as $row)
385  {
386  $csvoutput .= join($row, $separator) . "\n";
387  }
388  ilUtil::deliverData($csvoutput, str_replace(" ", "_", "log_" . $from . "_" . $until . "_" . $available_tests[$test]).".csv");
389  }
390 
394  public function logsObject($p_from = null, $p_until = null, $p_test = null)
395  {
396  global $ilTabs;
397  $ilTabs->activateTab('logs');
398 
399  $template = new ilTemplate("tpl.assessment_logs.html", TRUE, TRUE, "Modules/Test");
400 
401  require_once "./Services/Link/classes/class.ilLink.php";
402  include_once "./Modules/Test/classes/class.ilObjTest.php";
403  include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
404 
405  $available_tests =& ilObjTest::_getAvailableTests(1);
406  if (count($available_tests) == 0)
407  {
408  ilUtil::sendInfo($this->lng->txt('assessment_log_no_data'));
409  return;
410  }
411 
412  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
413  $form = new ilPropertyFormGUI();
414  $form->setFormAction($this->ctrl->getFormAction($this));
415  $form->setTableWidth("100%");
416  $form->setId("logs");
417 
419  $header->setTitle($this->lng->txt("assessment_log"));
420  $form->addItem($header);
421 
422  // from
423  $from = new ilDateTimeInputGUI($this->lng->txt('cal_from'), "log_from");
424  $from->setShowTime(true);
425  $now = getdate();
426  $fromdate = ($p_from) ? $p_from : (($_GET['log_from']) ? $_GET['log_from'] : mktime(0, 0, 0, 1, 1, $now['year']));
427  $from->setDate(new ilDateTime($fromdate, IL_CAL_UNIX));
428  $form->addItem($from);
429 
430  // until
431  $until = new ilDateTimeInputGUI($this->lng->txt('cal_until'), "log_until");
432  $until->setShowTime(true);
433  $untildate = ($p_until) ? $p_until : (($_GET['log_until']) ? $_GET['log_until'] : time());
434  $until->setDate(new ilDateTime($untildate, IL_CAL_UNIX));
435  $form->addItem($until);
436 
437  // tests
438  $fortest = new ilSelectInputGUI($this->lng->txt('assessment_log_for_test'), "sel_test");
439  $sorted_options = array();
440  foreach($available_tests as $key => $value)
441  {
442  $sorted_options[] = array(
443  'title' => ilUtil::prepareFormOutput($value) . " [" . $this->object->getNrOfLogEntries($key) . " " . $this->lng->txt("assessment_log_log_entries") . "]",
444  'key' => $key
445  );
446  }
447  $sorted_options = ilUtil::sortArray($sorted_options, 'title','asc');
448  $options = array();
449  foreach($sorted_options as $option)
450  {
451  $options[$option['key']] = $option['title'];
452  }
453  $fortest->setOptions($options);
454  $p_test = ($p_test) ? $p_test : $_GET['sel_test'];
455  if ($p_test) $fortest->setValue($p_test);
456  $form->addItem($fortest);
457  $this->ctrl->setParameter($this, 'sel_test', $p_test);
458  $this->ctrl->setParameter($this, 'log_until', $untildate);
459  $this->ctrl->setParameter($this, 'log_from', $fromdate);
460  $form->addCommandButton("showLog", $this->lng->txt("show"));
461  $form->addCommandButton("exportLog", $this->lng->txt("export"));
462  $template->setVariable("FORM", $form->getHTML());
463 
464  if ($p_test)
465  {
466  include_once "./Modules/Test/classes/tables/class.ilAssessmentFolderLogTableGUI.php";
467  $table_gui = new ilAssessmentFolderLogTableGUI($this, 'logs');
468  $log_output =& $this->object->getLog($fromdate, $untildate, $p_test);
469 
470  $self = $this;
471  array_walk($log_output, function(&$row) use ($self) {
472  if(is_numeric($row['ref_id']) && $row['ref_id'] > 0)
473  {
474  $row['location_href'] = ilLink::_getLink($row['ref_id'], 'tst');
475  $row['location_txt'] = $self->lng->txt("perma_link");
476  }
477  });
478  $table_gui->setData($log_output);
479  $template->setVariable('LOG', $table_gui->getHTML());
480  }
481  $this->tpl->setVariable("ADM_CONTENT", $template->get());
482  }
483 
487  public function deleteLogObject()
488  {
489  if (is_array($_POST["chb_test"]) && (count($_POST["chb_test"])))
490  {
491  $this->object->deleteLogEntries($_POST["chb_test"]);
492  ilUtil::sendSuccess($this->lng->txt("ass_log_deleted"));
493  }
494  else
495  {
496  ilUtil::sendInfo($this->lng->txt("ass_log_delete_no_selection"));
497  }
498  $this->logAdminObject();
499  }
500 
504  public function logAdminObject()
505  {
506  global $ilAccess, $ilTabs;
507 
508  $ilTabs->activateTab('logs');
509 
510  $a_write_access = ($ilAccess->checkAccess("write", "", $this->object->getRefId())) ? true : false;
511 
512  include_once "./Modules/Test/classes/tables/class.ilAssessmentFolderLogAdministrationTableGUI.php";
513  $table_gui = new ilAssessmentFolderLogAdministrationTableGUI($this, 'logAdmin', $a_write_access);
514  include_once "./Modules/Test/classes/class.ilObjTest.php";
515  require_once "./Services/Link/classes/class.ilLink.php";
516  $available_tests =& ilObjTest::_getAvailableTests(false);
517  $data = array();
518  foreach ($available_tests as $ref_id => $title)
519  {
521  array_push($data, array(
522  "title" => $title,
523  "nr" => $this->object->getNrOfLogEntries($obj_id),
524  "id" => $obj_id,
525  "location_href" => ilLink::_getLink($ref_id, 'tst'),
526  "location_txt" => $this->lng->txt("perma_link")
527  ));
528  }
529  $table_gui->setData($data);
530  $this->tpl->setVariable('ADM_CONTENT', $table_gui->getHTML());
531  }
532 
533  public function getAdminTabs(&$tabs_gui)
534  {
535  $this->getTabs($tabs_gui);
536  }
537 
538  public function getLogdataSubtabs()
539  {
540  global $ilTabs;
541 
542  // log settings
543  $ilTabs->addSubTabTarget("settings",
544  $this->ctrl->getLinkTarget($this, "showLogSettings"),
545  array("saveLogSettings", "showLogSettings")
546  , "");
547 
548  // log output
549  $ilTabs->addSubTabTarget("ass_log_output",
550  $this->ctrl->getLinkTarget($this, "logs"),
551  array("logs", "showLog", "exportLog")
552  , "");
553 
554  // log administration
555  $ilTabs->addSubTabTarget("ass_log_admin",
556  $this->ctrl->getLinkTarget($this, "logAdmin"),
557  array("logAdmin", "deleteLog"),
558  "", "");
559 
560  }
561 
567  public function getTabs(&$tabs_gui)
568  {
569  global $rbacsystem, $lng;
570 
571  switch ($this->ctrl->getCmd())
572  {
573  case "saveLogSettings":
574  case "showLogSettings":
575  case "logs":
576  case "showLog":
577  case "exportLog":
578  case "logAdmin":
579  case "deleteLog":
580  $this->getLogdataSubtabs();
581  break;
582  }
583 
584  if ($rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
585  {
586  $tabs_gui->addTarget("settings",
587  $this->ctrl->getLinkTarget($this, "settings"), array("settings","","view"), "", "");
588 
589  $tabs_gui->addTarget("logs",
590  $this->ctrl->getLinkTarget($this, "showLogSettings"),
591  array('saveLogSettings', 'showLogSettings', "logs","showLog", "exportLog", "logAdmin", "deleteLog"),
592  "", "");
593 
594  $tabs_gui->addTab("templates",
595  $lng->txt("adm_settings_templates"),
596  $this->ctrl->getLinkTargetByClass("ilsettingstemplategui", ""));
597  }
598 
599  if ($rbacsystem->checkAccess("write",$this->object->getRefId()))
600  {
601  $tabs_gui->addTarget('units', $this->ctrl->getLinkTargetByClass('ilGlobalUnitConfigurationGUI', ''), '', 'ilglobalunitconfigurationgui');
602  }
603 
604  if ($rbacsystem->checkAccess('edit_permission',$this->object->getRefId()))
605  {
606  $tabs_gui->addTarget("perm_settings",
607  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"), array("perm","info","owner"), 'ilpermissiongui');
608  }
609  }
610 
614  protected function showLogSettingsObject(ilPropertyFormGUI $form = null)
615  {
616  $this->tabs_gui->activateTab('logs');
617 
618  if(!($form instanceof ilPropertyFormGUI))
619  {
620  $form = $this->getLogSettingsForm();
621  $form->setValuesByArray(array(
622  'chb_assessment_logging' => $this->object->_enabledAssessmentLogging(),
623  'reporting_language' => $this->object->_getLogLanguage()
624  ));
625  }
626 
627  $this->tpl->setContent($form->getHTML());
628  }
629 
633  protected function saveLogSettingsObject()
634  {
638  global $ilAccess;
639 
640  if(!$ilAccess->checkAccess('write', '', $this->object->getRefId()))
641  {
642  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->WARNING);
643  }
644 
645  $form = $this->getLogSettingsForm();
646  if($form->checkInput())
647  {
648  $this->object->_enableAssessmentLogging((int)$form->getInput('chb_assessment_logging'));
649  $this->object->_setLogLanguage($form->getInput('reporting_language'));
650  $this->object->update();
651  ilUtil::sendSuccess($this->lng->txt('saved_successfully'));
652  }
653 
654  $form->setValuesByPost();
655  $this->showLogSettingsObject($form);
656  }
657 
661  protected function getLogSettingsForm()
662  {
666  global $ilAccess;
667 
668  require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
669  $form = new ilPropertyFormGUI();
670  $form->setFormAction($this->ctrl->getFormAction($this, 'saveLogSettings'));
671  $form->setTitle($this->lng->txt('assessment_log_logging'));
672 
673  $logging = new ilCheckboxInputGUI('', 'chb_assessment_logging');
674  $logging->setValue(1);
675  $logging->setOptionTitle($this->lng->txt('activate_assessment_logging'));
676  $form->addItem($logging);
677 
678  $reporting = new ilSelectInputGUI($this->lng->txt('assessment_settings_reporting_language'), 'reporting_language');
679  $languages = $this->lng->getInstalledLanguages();
680  $this->lng->loadLanguageModule('meta');
681  $options = array();
682  foreach($languages as $lang)
683  {
684  $options[$lang] = $this->lng->txt('meta_l_' . $lang);
685  }
686  $reporting->setOptions($options);
687  $form->addItem($reporting);
688 
689  if($ilAccess->checkAccess('write', '', $this->object->getRefId()))
690  {
691  $form->addCommandButton('saveLogSettings', $this->lng->txt('save'));
692  }
693 
694  return $form;
695  }
696 
697  private function forwardToSettingsTemplateGUI()
698  {
699  global $ilTabs;
700 
701  $ilTabs->setTabActive('templates');
702 
703  require_once 'Services/Administration/classes/class.ilSettingsTemplateGUI.php';
704  $gui = new ilSettingsTemplateGUI(self::getSettingsTemplateConfig());
705 
706  $this->ctrl->forwardCommand($gui);
707  }
708 
712  public static function getSettingsTemplateConfig()
713  {
714  global $lng;
715 
716  require_once 'Modules/Test/classes/class.ilTestSettingsTemplateConfig.php';
717  $config = new ilTestSettingsTemplateConfig($lng);
718  $config->init();
719 
720  return $config;
721  }
722 }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static _lookupName($a_user_id)
lookup user name
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
This class represents an option in a radio group.
ILIAS Setting Class.
static deliverData($a_data, $a_filename, $mime="application/octet-stream", $charset="")
deliver data for download via browser.
$separator
$_POST['username']
Definition: cron.php:12
This class represents an option in a checkbox group.
This class represents a selection list property in a property form.
This class represents a property form user interface.
settingsObject(ilPropertyFormGUI $form=null)
display assessment folder settings form
$_GET["client_id"]
This class represents a section header in a property form.
Class ilObjAssessmentFolderGUI.
Color picker form for selecting color hexcodes using yui library.
$cmd
Definition: sahs_server.php:35
Class ilGlobalUnitConfigurationGUI.
Class ilUnitConfigurationRepository.
This class represents a checkbox property in a property form.
ilObjectGUI($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
Constructor public.
ilObjAssessmentFolderGUI($a_data, $a_id, $a_call_by_reference)
Constructor.
_getQuestionTitle($question_id)
Returns the question title of a question with a given id.
const IL_CAL_UNIX
setInfo($a_info)
Set Info.
static sortArray($array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
& _getQuestionTypes($all_tags=FALSE, $fixOrder=false)
This class represents a date/time property in a property form.
static _lookupObjectId($a_ref_id)
lookup object id
setInfo($a_info)
Set Information Text.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
logAdminObject()
Administration output for assessment log files.
setChecked($a_checked)
Set Checked.
This class represents a property in a property form.
if(!is_array($argv)) $options
& executeCommand()
execute command
$header
saveSettingsObject()
Save Assessment settings.
This class represents a number property in a property form.
Class ilObjectGUI Basic methods of all Output classes.
special template class to simplify handling of ITX/PEAR
& _getAvailableTests($use_object_id=FALSE)
Returns the available tests for the active user.
const IL_CAL_FKT_DATE
Date and time handling
redirection script todo: (a better solution should control the processing via a xml file) ...
This class represents a property in a property form.
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.
showLogSettingsObject(ilPropertyFormGUI $form=null)
prepareOutput()
prepare output
logsObject($p_from=null, $p_until=null, $p_test=null)
display assessment folder logs form
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
showLogObject()
Called when the a log should be shown.
exportLogObject()
Called when the a log should be exported.
setRequired($a_required)
Set Required.
deleteLogObject()
Deletes the log entries for one or more tests.
setShowTime($a_showtime)
Set Show Time Information.
$test
Definition: Utf8Test.php:85