24 include_once
"./classes/class.ilObjectGUI.php";
49 $this->
ilObjectGUI($a_data,$a_id,$a_call_by_reference,
false);
51 if (!$rbacsystem->checkAccess(
'read',$this->object->getRefId()))
53 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read_assf"),$this->ilias->error_obj->WARNING);
59 $next_class = $this->ctrl->getNextClass($this);
60 $cmd = $this->ctrl->getCmd();
67 case 'ilpermissiongui':
68 $ilTabs->activateTab(
'perm_settings');
69 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
71 $ret =& $this->ctrl->forwardCommand($perm_gui);
74 case 'ilsettingstemplategui':
75 $ilTabs->setTabActive(
"templates");
76 include_once(
"./Services/Administration/classes/class.ilSettingsTemplateGUI.php");
78 $this->ctrl->forwardCommand($set_tpl_gui);
111 $this->ctrl->redirect($this);
123 $ilTabs->setTabActive(
'settings');
125 include_once
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
126 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
128 $form->setFormAction($this->ctrl->getFormAction($this));
129 $form->setTableWidth(
"100%");
130 $form->setId(
"settings");
134 $header->setTitle($this->lng->txt(
"assessment_log_logging"));
135 $form->addItem($header);
139 $logging->setValue(1);
140 $logging->setChecked($this->object->_enabledAssessmentLogging());
141 $logging->setOptionTitle($this->lng->txt(
"activate_assessment_logging"));
142 $form->addItem($logging);
145 $reporting =
new ilSelectInputGUI($this->lng->txt(
'assessment_settings_reporting_language'),
"reporting_language");
146 $languages = $this->lng->getInstalledLanguages();
148 foreach ($languages as
$lang)
150 $options[
$lang] = $this->lng->txt(
"lang_" . $lang);
152 $reporting->setOptions($options);
153 $reporting->setValue($this->object->_getLogLanguage());
154 $form->addItem($reporting);
158 $header->setTitle($this->lng->txt(
"assf_questiontypes"));
159 $form->addItem($header);
162 $allowed =
new ilCheckboxGroupInputGUI($this->lng->txt(
'assf_allowed_questiontypes'),
"chb_allowed_questiontypes");
164 $forbidden_types = $this->
object->_getForbiddenQuestionTypes();
165 $allowedtypes = array();
166 foreach ($questiontypes as $qt)
168 if (!in_array($qt[
'question_type_id'], $forbidden_types)) array_push($allowedtypes, $qt[
'question_type_id']);
170 $allowed->setValue($allowedtypes);
171 foreach ($questiontypes as $type_name => $qtype)
173 $allowed->addOption(
new ilCheckboxOption($type_name, $qtype[
"question_type_id"]));
175 $allowed->setInfo($this->lng->txt(
'assf_allowed_questiontypes_desc'));
176 $form->addItem($allowed);
179 $manual =
new ilCheckboxGroupInputGUI($this->lng->txt(
'assessment_log_manual_scoring_activate'),
"chb_manual_scoring");
180 $manscoring = $this->
object->_getManualScoring();
182 foreach ($questiontypes as $type_name => $qtype)
184 $manual->addOption(
new ilCheckboxOption($type_name, $qtype[
"question_type_id"]));
186 $manual->setInfo($this->lng->txt(
'assessment_log_manual_scoring_desc'));
187 $form->addItem($manual);
189 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
191 $form->addCommandButton(
"saveSettings", $this->lng->txt(
"save"));
193 $this->tpl->setVariable(
"ADM_CONTENT", $form->getHTML());
202 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) $this->ctrl->redirect($this,
'settings');
204 if (
$_POST[
"chb_assessment_logging"] == 1)
206 $this->
object->_enableAssessmentLogging(1);
210 $this->
object->_enableAssessmentLogging(0);
212 $this->
object->_setLogLanguage(
$_POST[
"reporting_language"]);
213 $this->
object->_setManualScoring(
$_POST[
"chb_manual_scoring"]);
214 include_once
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
216 $forbidden_types = array();
217 foreach ($questiontypes as $name =>
$row)
219 if (!in_array(
$row[
"question_type_id"],
$_POST[
"chb_allowed_questiontypes"]))
221 array_push($forbidden_types,
$row[
"question_type_id"]);
224 $this->
object->_setForbiddenQuestionTypes($forbidden_types);
227 $this->ctrl->redirect($this,
'settings');
235 $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']);
236 $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']);
246 $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']);
247 $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']);
253 $this->lng->txt(
"assessment_log_datetime"),
254 $this->lng->txt(
"user"),
255 $this->lng->txt(
"assessment_log_text"),
256 $this->lng->txt(
"question")
258 include_once
"./Modules/Test/classes/class.ilObjTest.php";
259 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
262 $log_output =& $this->
object->getLog($from, $until,
$test);
264 foreach ($log_output as $key =>
$log)
266 if (!array_key_exists(
$log[
"user_fi"], $users))
271 if (
$log[
"question_fi"] ||
$log[
"original_fi"])
278 $title = $this->lng->txt(
"assessment_log_question") .
": " .
$title;
283 array_push($csvrow, trim($users[
$log[
"user_fi"]][
"title"] .
" " . $users[
$log[
"user_fi"]][
"firstname"] .
" " . $users[
$log[
"user_fi"]][
"lastname"]));
284 array_push($csvrow, trim($log[
"logtext"]));
285 array_push($csvrow,
$title);
289 foreach ($csv as
$row)
293 ilUtil::deliverData($csvoutput, str_replace(
" ",
"_",
"log_" . $from .
"_" . $until .
"_" . $available_tests[
$test]).
".csv");
299 public function logsObject($p_from = null, $p_until = null, $p_test = null)
302 $ilTabs->activateTab(
'logs');
304 $template =
new ilTemplate(
"tpl.assessment_logs.html", TRUE, TRUE,
"Modules/Test");
306 include_once
"./Modules/Test/classes/class.ilObjTest.php";
307 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
309 if (count($available_tests) == 0)
315 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
317 $form->setFormAction($this->ctrl->getFormAction($this));
318 $form->setTableWidth(
"100%");
319 $form->setId(
"logs");
322 $header->setTitle($this->lng->txt(
"assessment_log"));
323 $form->addItem($header);
328 $from->setShowTime(
true);
330 $fromdate = ($p_from) ? $p_from : ((
$_GET[
'log_from']) ?
$_GET[
'log_from'] : mktime(0, 0, 0, 1, 1, $now[
'year']));
332 $form->addItem($from);
337 $until->setShowTime(
true);
338 $untildate = ($p_until) ? $p_until : ((
$_GET[
'log_until']) ?
$_GET[
'log_until'] : time());
340 $form->addItem($until);
343 $fortest =
new ilSelectInputGUI($this->lng->txt(
'assessment_log_for_test'),
"sel_test");
345 foreach ($available_tests as $key => $value)
347 $options[$key] =
ilUtil::prepareFormOutput($value) .
" [" . $this->
object->getNrOfLogEntries($key) .
" " . $this->lng->txt(
"assessment_log_log_entries") .
"]";
349 $fortest->setOptions($options);
350 $p_test = ($p_test) ? $p_test :
$_GET[
'sel_test'];
351 if ($p_test) $fortest->setValue($p_test);
352 $form->addItem($fortest);
353 $this->ctrl->setParameter($this,
'sel_test', $p_test);
354 $this->ctrl->setParameter($this,
'log_until', $untildate);
355 $this->ctrl->setParameter($this,
'log_from', $fromdate);
356 $form->addCommandButton(
"showLog", $this->lng->txt(
"show"));
357 $form->addCommandButton(
"exportLog", $this->lng->txt(
"export"));
358 $template->setVariable(
"FORM", $form->getHTML());
362 include_once
"./Modules/Test/classes/tables/class.ilAssessmentFolderLogTableGUI.php";
364 $log_output =& $this->
object->getLog($fromdate, $untildate, $p_test);
365 $table_gui->setData($log_output);
366 $template->setVariable(
'LOG', $table_gui->getHTML());
368 $this->tpl->setVariable(
"ADM_CONTENT", $template->get());
376 if (is_array(
$_POST[
"chb_test"]) && (count(
$_POST[
"chb_test"])))
378 $this->
object->deleteLogEntries(
$_POST[
"chb_test"]);
393 global $ilAccess, $ilTabs;
395 $ilTabs->activateTab(
'logs');
397 $a_write_access = ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) ?
true :
false;
399 include_once
"./Modules/Test/classes/tables/class.ilAssessmentFolderLogAdministrationTableGUI.php";
401 include_once
"./Modules/Test/classes/class.ilObjTest.php";
406 $nr = $this->
object->getNrOfLogEntries(
$obj_id);
409 $table_gui->setData(
$data);
410 $this->tpl->setVariable(
'ADM_CONTENT', $table_gui->getHTML());
423 $ilTabs->addSubTabTarget(
"ass_log_output",
424 $this->ctrl->getLinkTarget($this,
"logs"),
425 array(
"logs",
"showLog",
"exportLog")
429 $ilTabs->addSubTabTarget(
"ass_log_admin",
430 $this->ctrl->getLinkTarget($this,
"logAdmin"),
431 array(
"logAdmin",
"deleteLog"),
443 $ilTabs->activateTab(
'defaults');
445 $assessmentSetting =
new ilSetting(
"assessment");
446 $use_javascript = array_key_exists(
"use_javascript",
$_GET) ?
$_GET[
"use_javascript"] : $assessmentSetting->get(
"use_javascript");
447 $imap_line_color = array_key_exists(
"imap_line_color",
$_GET) ?
$_GET[
"imap_line_color"] : $assessmentSetting->get(
"imap_line_color");
448 if (strlen($imap_line_color) == 0) $imap_line_color =
"FF0000";
450 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
452 $form->setFormAction($ilCtrl->getFormAction($this));
453 $form->setTitle($lng->txt(
"assessment_defaults"));
456 $enable =
new ilCheckboxInputGUI($lng->txt(
"assessment_use_javascript"),
"use_javascript");
458 $enable->setInfo($lng->txt(
"assessment_use_javascript_desc"));
459 $form->addItem($enable);
462 $linepicker->
setValue($imap_line_color);
463 $form->addItem($linepicker);
465 if (@file_exists(
"./Modules/Test/classes/class.ilTestResultsToXML.php"))
468 $user_criteria = array_key_exists(
"user_criteria",
$_GET) ?
$_GET[
"user_criteria"] : $assessmentSetting->get(
"user_criteria");
469 $userCriteria =
new ilSelectInputGUI($this->lng->txt(
"user_criteria"),
"user_criteria");
470 $userCriteria->
setInfo($this->lng->txt(
"user_criteria_desc"));
471 $userCriteria->setRequired(
true);
472 $userCriteria->setValue(($isSingleline) ? 0 : 1);
474 $manager = $ilDB->db->loadModule(
'Manager');
475 $fields = $manager->listTableFields(
'usr_data');
476 $usr_fields = array();
477 foreach ($fields as $field)
479 $usr_fields[$field] = $field;
481 $userCriteria->setOptions($usr_fields);
482 $userCriteria->setValue($user_criteria);
483 $form->addItem($userCriteria);
486 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
488 $form->addCommandButton(
"saveDefaults", $lng->txt(
"save"));
492 $tpl->setVariable(
"ADM_CONTENT", $form->getHTML());
502 $assessmentSetting =
new ilSetting(
"assessment");
503 if (
$_POST[
"use_javascript"])
505 $assessmentSetting->set(
"use_javascript",
"1");
509 $assessmentSetting->set(
"use_javascript",
"0");
511 if (strlen(
$_POST[
"imap_line_color"]) == 6)
513 $assessmentSetting->set(
"imap_line_color",
$_POST[
"imap_line_color"]);
515 if (@file_exists(
"./Modules/Test/classes/class.ilTestResultsToXML.php"))
517 $assessmentSetting->set(
"user_criteria",
$_POST[
"user_criteria"]);
520 $ilCtrl->redirect($this,
"defaults");
531 global $rbacsystem,
$lng;
533 switch ($this->ctrl->getCmd())
544 if ($rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
546 $tabs_gui->addTarget(
"settings",
547 $this->ctrl->getLinkTarget($this,
"settings"), array(
"settings",
"",
"view"),
"",
"");
549 $tabs_gui->addTarget(
"logs",
550 $this->ctrl->getLinkTarget($this,
"logs"),
551 array(
"logs",
"showLog",
"exportLog",
"logAdmin",
"deleteLog"),
554 $tabs_gui->addTarget(
"defaults",
555 $this->ctrl->getLinkTarget($this,
"defaults"), array(
"defaults",
"saveDefaults"),
"",
"");
557 $tabs_gui->addTab(
"templates",
558 $lng->txt(
"adm_settings_templates"),
559 $this->ctrl->getLinkTargetByClass(
"ilsettingstemplategui",
""));
562 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
564 $tabs_gui->addTarget(
"perm_settings",
565 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');
579 $lng->loadLanguageModule(
"tst");
580 $lng->loadLanguageModule(
"assessment");
582 include_once(
"./Services/Administration/classes/class.ilSettingsTemplateConfig.php");
585 $config->addHidableTab(
"questions", $lng->txt(
'edit_test_questions'));
586 $config->addHidableTab(
"mark_schema", $lng->txt(
'settings') .
' - ' . $lng->txt(
"mark_schema"));
587 $config->addHidableTab(
"certificate", $lng->txt(
'settings') .
' - ' . $lng->txt(
"certificate"));
588 $config->addHidableTab(
"defaults", $lng->txt(
'settings') .
' - ' . $lng->txt(
"defaults"));
590 $config->addHidableTab(
"learning_progress", $lng->txt(
"learning_progress"));
591 $config->addHidableTab(
"manscoring", $lng->txt(
"manscoring"));
592 $config->addHidableTab(
"history", $lng->txt(
"history"));
593 $config->addHidableTab(
"meta_data", $lng->txt(
"meta_data"));
594 $config->addHidableTab(
"export", $lng->txt(
"export"));
595 $config->addHidableTab(
"permissions", $lng->txt(
"permission"));
605 $lng->txt(
"tst_anonymity"),
609 '0' => $lng->txt(
"tst_anonymity_no_anonymization"),
610 '1' => $lng->txt(
"tst_anonymity_anonymous_test"),
617 $lng->txt(
"tst_title_output"),
621 '0' => $lng->txt(
"test_enable_view_table"),
622 '1' => $lng->txt(
"test_enable_view_express"),
623 '2' => $lng->txt(
"test_enable_view_both"),
629 $lng->txt(
"tst_random_selection"),
636 $lng->txt(
"test_question_pool_usage"),
644 $lng->txt(
"showinfo"),
649 "showfinalstatement",
651 $lng->txt(
"final_statement_show"),
659 $lng->txt(
"tst_nr_of_tries"),
666 "chb_processing_time",
668 $lng->txt(
"tst_processing_time"),
675 $lng->txt(
"tst_starting_time"),
682 $lng->txt(
"tst_ending_time"),
689 $lng->txt(
"tst_password"),
697 "chb_use_previous_answers",
699 $lng->txt(
"tst_use_previous_answers"),
705 $lng->txt(
"forcejs_short"),
712 $lng->txt(
"tst_title_output"),
716 '0' => $lng->txt(
"test_enable_view_table"),
717 '1' => $lng->txt(
"test_enable_view_express"),
718 '2' => $lng->txt(
"test_enable_view_both"),
727 $lng->txt(
"tst_postpone"),
731 "chb_shuffle_questions",
733 $lng->txt(
"tst_shuffle_questions"),
739 $lng->txt(
"tst_show_summary"),
746 $lng->txt(
"question_marking"),
752 $lng->txt(
"tst_show_cancel"),
761 $lng->txt(
"tst_finish_notification"),
765 '0' => $lng->txt(
"tst_finish_notification_no"),
766 '1' => $lng->txt(
"tst_finish_notification_simple"),
767 '2' => $lng->txt(
"tst_finish_notification_advanced"),
774 $lng->txt(
"mailnottype"),
793 $lng->txt(
"participants_invitation"),
800 $lng->txt(
"tst_allowed_users"),
806 "allowedUsersTimeGap",
808 $lng->txt(
"tst_allowed_users_time_gap"),
820 $lng->txt(
"tst_text_count_system"),
824 '0' => $lng->txt(
"tst_count_partial_solutions"),
825 '1' => $lng->txt(
"tst_count_correct_solutions"),
832 $lng->txt(
"tst_score_mcmr_questions"),
836 '0' => $lng->txt(
"tst_score_mcmr_zero_points_when_unanswered"),
837 '1' => $lng->txt(
"tst_score_mcmr_use_scoring_system"),
844 $lng->txt(
"tst_score_cutting"),
848 '0' => $lng->txt(
"tst_score_cut_question"),
849 '1' => $lng->txt(
"tst_score_cut_test"),
856 $lng->txt(
"tst_score_cutting"),
860 '0' => $lng->txt(
"tst_pass_last_pass"),
861 '1' => $lng->txt(
"tst_pass_best_pass"),
868 $lng->txt(
"tst_instant_feedback"),
872 'instant_feedback_answer' => $lng->txt(
"tst_instant_feedback_answer_specific"),
873 'instant_feedback_points' => $lng->txt(
"tst_instant_feedback_results"),
874 'instant_feedback_solution' => $lng->txt(
"tst_instant_feedback_solution"),
881 $lng->txt(
"tst_results_access"),
885 '1' => $lng->txt(
"tst_results_access_finished"),
886 '2' => $lng->txt(
"tst_results_access_always"),
887 '3' => $lng->txt(
"tst_results_access_never"),
888 '4' => $lng->txt(
"tst_results_access_date"),
893 "results_presentation",
895 $lng->txt(
"tst_results_presentation"),
899 'pass_details' => $lng->txt(
"tst_show_pass_details"),
900 'solution_details' => $lng->txt(
"tst_show_solution_details"),
901 'solution_printview' => $lng->txt(
"tst_show_solution_printview"),
902 'solution_feedback' => $lng->txt(
"tst_show_solution_feedback"),
903 'solution_answers_only' => $lng->txt(
"tst_show_solution_answers_only"),
904 'solution_signature' => $lng->txt(
"tst_show_solution_signature"),
905 'solution_suggested' => $lng->txt(
"tst_show_solution_suggested"),
912 $lng->txt(
"tst_export_settings"),