24 include_once
"./Services/Object/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(
"assf_questiontypes"));
135 $form->addItem($header);
138 $allowed =
new ilCheckboxGroupInputGUI($this->lng->txt(
'assf_allowed_questiontypes'),
"chb_allowed_questiontypes");
140 $forbidden_types = $this->
object->_getForbiddenQuestionTypes();
141 $allowedtypes = array();
142 foreach ($questiontypes as $qt)
144 if (!in_array($qt[
'question_type_id'], $forbidden_types)) array_push($allowedtypes, $qt[
'question_type_id']);
146 $allowed->setValue($allowedtypes);
147 foreach ($questiontypes as $type_name => $qtype)
149 $allowed->addOption(
new ilCheckboxOption($type_name, $qtype[
"question_type_id"]));
151 $allowed->setInfo($this->lng->txt(
'assf_allowed_questiontypes_desc'));
152 $form->addItem($allowed);
155 $manual =
new ilCheckboxGroupInputGUI($this->lng->txt(
'assessment_log_manual_scoring_activate'),
"chb_manual_scoring");
156 $manscoring = $this->
object->_getManualScoring();
158 foreach ($questiontypes as $type_name => $qtype)
160 $manual->addOption(
new ilCheckboxOption($type_name, $qtype[
"question_type_id"]));
162 $manual->setInfo($this->lng->txt(
'assessment_log_manual_scoring_desc'));
163 $form->addItem($manual);
165 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
167 $form->addCommandButton(
"saveSettings", $this->lng->txt(
"save"));
169 $this->tpl->setVariable(
"ADM_CONTENT", $form->getHTML());
178 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) $this->ctrl->redirect($this,
'settings');
180 $this->
object->_setManualScoring(
$_POST[
"chb_manual_scoring"]);
181 include_once
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
183 $forbidden_types = array();
184 foreach ($questiontypes as $name =>
$row)
186 if (!in_array(
$row[
"question_type_id"],
$_POST[
"chb_allowed_questiontypes"]))
188 array_push($forbidden_types,
$row[
"question_type_id"]);
191 $this->
object->_setForbiddenQuestionTypes($forbidden_types);
194 $this->ctrl->redirect($this,
'settings');
202 $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']);
203 $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']);
213 $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']);
214 $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']);
220 $this->lng->txt(
"assessment_log_datetime"),
221 $this->lng->txt(
"user"),
222 $this->lng->txt(
"assessment_log_text"),
223 $this->lng->txt(
"question")
225 include_once
"./Modules/Test/classes/class.ilObjTest.php";
226 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
229 $log_output =& $this->
object->getLog($from, $until,
$test);
231 foreach ($log_output as $key =>
$log)
233 if (!array_key_exists(
$log[
"user_fi"], $users))
238 if (
$log[
"question_fi"] ||
$log[
"original_fi"])
245 $title = $this->lng->txt(
"assessment_log_question") .
": " .
$title;
250 array_push($csvrow, trim($users[
$log[
"user_fi"]][
"title"] .
" " . $users[
$log[
"user_fi"]][
"firstname"] .
" " . $users[
$log[
"user_fi"]][
"lastname"]));
251 array_push($csvrow, trim($log[
"logtext"]));
252 array_push($csvrow,
$title);
256 foreach ($csv as
$row)
260 ilUtil::deliverData($csvoutput, str_replace(
" ",
"_",
"log_" . $from .
"_" . $until .
"_" . $available_tests[
$test]).
".csv");
266 public function logsObject($p_from = null, $p_until = null, $p_test = null)
269 $ilTabs->activateTab(
'logs');
271 $template =
new ilTemplate(
"tpl.assessment_logs.html", TRUE, TRUE,
"Modules/Test");
273 include_once
"./Modules/Test/classes/class.ilObjTest.php";
274 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
276 if (count($available_tests) == 0)
282 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
284 $form->setFormAction($this->ctrl->getFormAction($this));
285 $form->setTableWidth(
"100%");
286 $form->setId(
"logs");
289 $header->setTitle($this->lng->txt(
"assessment_log"));
290 $form->addItem($header);
295 $from->setShowTime(
true);
297 $fromdate = ($p_from) ? $p_from : ((
$_GET[
'log_from']) ?
$_GET[
'log_from'] : mktime(0, 0, 0, 1, 1, $now[
'year']));
299 $form->addItem($from);
304 $until->setShowTime(
true);
305 $untildate = ($p_until) ? $p_until : ((
$_GET[
'log_until']) ?
$_GET[
'log_until'] : time());
307 $form->addItem($until);
310 $fortest =
new ilSelectInputGUI($this->lng->txt(
'assessment_log_for_test'),
"sel_test");
311 $sorted_options = array();
312 foreach($available_tests as $key => $value)
314 $sorted_options[] = array(
315 'title' =>
ilUtil::prepareFormOutput($value) .
" [" . $this->object->getNrOfLogEntries($key) .
" " . $this->lng->txt(
"assessment_log_log_entries") .
"]",
321 foreach($sorted_options as $option)
323 $options[$option[
'key']] = $option[
'title'];
325 $fortest->setOptions($options);
326 $p_test = ($p_test) ? $p_test :
$_GET[
'sel_test'];
327 if ($p_test) $fortest->setValue($p_test);
328 $form->addItem($fortest);
329 $this->ctrl->setParameter($this,
'sel_test', $p_test);
330 $this->ctrl->setParameter($this,
'log_until', $untildate);
331 $this->ctrl->setParameter($this,
'log_from', $fromdate);
332 $form->addCommandButton(
"showLog", $this->lng->txt(
"show"));
333 $form->addCommandButton(
"exportLog", $this->lng->txt(
"export"));
334 $template->setVariable(
"FORM", $form->getHTML());
338 include_once
"./Modules/Test/classes/tables/class.ilAssessmentFolderLogTableGUI.php";
340 $log_output =& $this->
object->getLog($fromdate, $untildate, $p_test);
341 $table_gui->setData($log_output);
342 $template->setVariable(
'LOG', $table_gui->getHTML());
344 $this->tpl->setVariable(
"ADM_CONTENT", $template->get());
352 if (is_array(
$_POST[
"chb_test"]) && (count(
$_POST[
"chb_test"])))
354 $this->
object->deleteLogEntries(
$_POST[
"chb_test"]);
369 global $ilAccess, $ilTabs;
371 $ilTabs->activateTab(
'logs');
373 $a_write_access = ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) ?
true :
false;
375 include_once
"./Modules/Test/classes/tables/class.ilAssessmentFolderLogAdministrationTableGUI.php";
377 include_once
"./Modules/Test/classes/class.ilObjTest.php";
382 $nr = $this->
object->getNrOfLogEntries(
$obj_id);
385 $table_gui->setData(
$data);
386 $this->tpl->setVariable(
'ADM_CONTENT', $table_gui->getHTML());
399 $ilTabs->addSubTabTarget(
"settings",
400 $this->ctrl->getLinkTarget($this,
"showLogSettings"),
401 array(
"saveLogSettings",
"showLogSettings")
405 $ilTabs->addSubTabTarget(
"ass_log_output",
406 $this->ctrl->getLinkTarget($this,
"logs"),
407 array(
"logs",
"showLog",
"exportLog")
411 $ilTabs->addSubTabTarget(
"ass_log_admin",
412 $this->ctrl->getLinkTarget($this,
"logAdmin"),
413 array(
"logAdmin",
"deleteLog"),
425 $ilTabs->activateTab(
'defaults');
427 $assessmentSetting =
new ilSetting(
"assessment");
428 $use_javascript = array_key_exists(
"use_javascript",
$_GET) ?
$_GET[
"use_javascript"] : $assessmentSetting->get(
"use_javascript");
429 $imap_line_color = array_key_exists(
"imap_line_color",
$_GET) ?
$_GET[
"imap_line_color"] : $assessmentSetting->get(
"imap_line_color");
430 if (strlen($imap_line_color) == 0) $imap_line_color =
"FF0000";
432 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
434 $form->setFormAction($ilCtrl->getFormAction($this));
435 $form->setTitle($lng->txt(
"assessment_defaults"));
438 $enable =
new ilCheckboxInputGUI($lng->txt(
"assessment_use_javascript"),
"use_javascript");
440 $enable->setInfo($lng->txt(
"assessment_use_javascript_desc"));
441 $form->addItem($enable);
444 $linepicker->
setValue($imap_line_color);
445 $form->addItem($linepicker);
447 if (@file_exists(
"./Modules/Test/classes/class.ilTestResultsToXML.php"))
450 $user_criteria = array_key_exists(
"user_criteria",
$_GET) ?
$_GET[
"user_criteria"] : $assessmentSetting->get(
"user_criteria");
451 $userCriteria =
new ilSelectInputGUI($this->lng->txt(
"user_criteria"),
"user_criteria");
452 $userCriteria->
setInfo($this->lng->txt(
"user_criteria_desc"));
453 $userCriteria->setRequired(
true);
454 $userCriteria->setValue(($isSingleline) ? 0 : 1);
456 $manager = $ilDB->db->loadModule(
'Manager');
457 $fields = $manager->listTableFields(
'usr_data');
458 $usr_fields = array();
459 foreach ($fields as $field)
461 $usr_fields[$field] = $field;
463 $userCriteria->setOptions($usr_fields);
464 $userCriteria->setValue($user_criteria);
465 $form->addItem($userCriteria);
468 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
470 $form->addCommandButton(
"saveDefaults", $lng->txt(
"save"));
474 $tpl->setVariable(
"ADM_CONTENT", $form->getHTML());
484 $assessmentSetting =
new ilSetting(
"assessment");
485 if (
$_POST[
"use_javascript"])
487 $assessmentSetting->set(
"use_javascript",
"1");
491 $assessmentSetting->set(
"use_javascript",
"0");
493 if (strlen(
$_POST[
"imap_line_color"]) == 6)
495 $assessmentSetting->set(
"imap_line_color",
$_POST[
"imap_line_color"]);
497 if (@file_exists(
"./Modules/Test/classes/class.ilTestResultsToXML.php"))
499 $assessmentSetting->set(
"user_criteria",
$_POST[
"user_criteria"]);
502 $ilCtrl->redirect($this,
"defaults");
513 global $rbacsystem,
$lng;
515 switch ($this->ctrl->getCmd())
517 case "saveLogSettings":
518 case "showLogSettings":
528 if ($rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
530 $tabs_gui->addTarget(
"settings",
531 $this->ctrl->getLinkTarget($this,
"settings"), array(
"settings",
"",
"view"),
"",
"");
533 $tabs_gui->addTarget(
"logs",
534 $this->ctrl->getLinkTarget($this,
"showLogSettings"),
535 array(
'saveLogSettings',
'showLogSettings',
"logs",
"showLog",
"exportLog",
"logAdmin",
"deleteLog"),
538 $tabs_gui->addTarget(
"defaults",
539 $this->ctrl->getLinkTarget($this,
"defaults"), array(
"defaults",
"saveDefaults"),
"",
"");
541 $tabs_gui->addTab(
"templates",
542 $lng->txt(
"adm_settings_templates"),
543 $this->ctrl->getLinkTargetByClass(
"ilsettingstemplategui",
""));
546 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
548 $tabs_gui->addTarget(
"perm_settings",
549 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');
563 $lng->loadLanguageModule(
"tst");
564 $lng->loadLanguageModule(
"assessment");
566 include_once(
"./Services/Administration/classes/class.ilSettingsTemplateConfig.php");
569 $config->addHidableTab(
"questions", $lng->txt(
'edit_test_questions'));
570 $config->addHidableTab(
"mark_schema", $lng->txt(
'settings') .
' - ' . $lng->txt(
"mark_schema"));
571 $config->addHidableTab(
"certificate", $lng->txt(
'settings') .
' - ' . $lng->txt(
"certificate"));
572 $config->addHidableTab(
"defaults", $lng->txt(
'settings') .
' - ' . $lng->txt(
"defaults"));
574 $config->addHidableTab(
"learning_progress", $lng->txt(
"learning_progress"));
575 $config->addHidableTab(
"manscoring", $lng->txt(
"manscoring"));
576 $config->addHidableTab(
"history", $lng->txt(
"history"));
577 $config->addHidableTab(
"meta_data", $lng->txt(
"meta_data"));
578 $config->addHidableTab(
"export", $lng->txt(
"export"));
579 $config->addHidableTab(
"permissions", $lng->txt(
"permission"));
589 $lng->txt(
"tst_anonymity"),
593 '0' => $lng->txt(
"tst_anonymity_no_anonymization"),
594 '1' => $lng->txt(
"tst_anonymity_anonymous_test"),
601 $lng->txt(
"tst_title_output"),
605 '0' => $lng->txt(
"test_enable_view_table"),
606 '1' => $lng->txt(
"test_enable_view_express"),
607 '2' => $lng->txt(
"test_enable_view_both"),
613 $lng->txt(
"tst_random_selection"),
620 $lng->txt(
"test_question_pool_usage"),
628 $lng->txt(
"showinfo"),
633 "showfinalstatement",
635 $lng->txt(
"final_statement_show"),
643 $lng->txt(
"tst_nr_of_tries"),
650 "chb_processing_time",
652 $lng->txt(
"tst_processing_time"),
659 $lng->txt(
"tst_starting_time"),
666 $lng->txt(
"tst_ending_time"),
673 $lng->txt(
"tst_password"),
681 "chb_use_previous_answers",
683 $lng->txt(
"tst_use_previous_answers"),
689 $lng->txt(
"forcejs_short"),
696 $lng->txt(
"tst_title_output"),
700 '0' => $lng->txt(
"test_enable_view_table"),
701 '1' => $lng->txt(
"test_enable_view_express"),
702 '2' => $lng->txt(
"test_enable_view_both"),
711 $lng->txt(
"tst_postpone"),
715 "chb_shuffle_questions",
717 $lng->txt(
"tst_shuffle_questions"),
723 $lng->txt(
"tst_show_summary"),
730 $lng->txt(
"question_marking"),
736 $lng->txt(
"tst_show_cancel"),
745 $lng->txt(
"tst_finish_notification"),
749 '0' => $lng->txt(
"tst_finish_notification_no"),
750 '1' => $lng->txt(
"tst_finish_notification_simple"),
751 '2' => $lng->txt(
"tst_finish_notification_advanced"),
758 $lng->txt(
"mailnottype"),
777 $lng->txt(
"participants_invitation"),
784 $lng->txt(
"tst_allowed_users"),
790 "allowedUsersTimeGap",
792 $lng->txt(
"tst_allowed_users_time_gap"),
804 $lng->txt(
"tst_text_count_system"),
808 '0' => $lng->txt(
"tst_count_partial_solutions"),
809 '1' => $lng->txt(
"tst_count_correct_solutions"),
816 $lng->txt(
"tst_score_mcmr_questions"),
820 '0' => $lng->txt(
"tst_score_mcmr_zero_points_when_unanswered"),
821 '1' => $lng->txt(
"tst_score_mcmr_use_scoring_system"),
828 $lng->txt(
"tst_score_cutting"),
832 '0' => $lng->txt(
"tst_score_cut_question"),
833 '1' => $lng->txt(
"tst_score_cut_test"),
840 $lng->txt(
"tst_pass_scoring"),
844 '0' => $lng->txt(
"tst_pass_last_pass"),
845 '1' => $lng->txt(
"tst_pass_best_pass"),
852 $lng->txt(
"tst_instant_feedback"),
856 'instant_feedback_answer' => $lng->txt(
"tst_instant_feedback_answer_specific"),
857 'instant_feedback_points' => $lng->txt(
"tst_instant_feedback_results"),
858 'instant_feedback_solution' => $lng->txt(
"tst_instant_feedback_solution"),
865 $lng->txt(
"tst_results_access"),
869 '1' => $lng->txt(
"tst_results_access_finished"),
870 '2' => $lng->txt(
"tst_results_access_always"),
871 '3' => $lng->txt(
"tst_results_access_never"),
872 '4' => $lng->txt(
"tst_results_access_date"),
879 $lng->txt(
"tst_results_print_best_solution"),
884 "results_presentation",
886 $lng->txt(
"tst_results_presentation"),
890 'pass_details' => $lng->txt(
"tst_show_pass_details"),
891 'solution_details' => $lng->txt(
"tst_show_solution_details"),
892 'solution_printview' => $lng->txt(
"tst_show_solution_printview"),
893 'solution_feedback' => $lng->txt(
"tst_show_solution_feedback"),
894 'solution_answers_only' => $lng->txt(
"tst_show_solution_answers_only"),
895 'solution_signature' => $lng->txt(
"tst_show_solution_signature"),
896 'solution_suggested' => $lng->txt(
"tst_show_solution_suggested"),
903 $lng->txt(
"tst_export_settings"),
914 $this->tabs_gui->activateTab(
'logs');
918 $form = $this->getLogSettingsForm();
919 $form->setValuesByArray(array(
920 'chb_assessment_logging' => $this->object->_enabledAssessmentLogging(),
921 'reporting_language' => $this->
object->_getLogLanguage()
925 $this->tpl->setContent($form->getHTML());
931 protected function saveLogSettingsObject()
938 if(!$ilAccess->checkAccess(
'write',
'', $this->object->getRefId()))
940 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->WARNING);
943 $form = $this->getLogSettingsForm();
944 if($form->checkInput())
946 $this->
object->_enableAssessmentLogging((
int)$form->getInput(
'chb_assessment_logging'));
947 $this->
object->_setLogLanguage($form->getInput(
'reporting_language'));
948 $this->
object->update();
952 $form->setValuesByPost();
959 protected function getLogSettingsForm()
966 require_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
968 $form->setFormAction($this->ctrl->getFormAction($this,
'saveLogSettings'));
969 $form->setTitle($this->lng->txt(
'assessment_log_logging'));
972 $logging->setValue(1);
973 $logging->setOptionTitle($this->lng->txt(
'activate_assessment_logging'));
974 $form->addItem($logging);
976 $reporting =
new ilSelectInputGUI($this->lng->txt(
'assessment_settings_reporting_language'),
'reporting_language');
977 $languages = $this->lng->getInstalledLanguages();
978 $this->lng->loadLanguageModule(
'meta');
980 foreach($languages as
$lang)
982 $options[
$lang] = $this->lng->txt(
'meta_l_' . $lang);
984 $reporting->setOptions($options);
985 $form->addItem($reporting);
987 if($ilAccess->checkAccess(
'write',
'', $this->object->getRefId()))
989 $form->addCommandButton(
'saveLogSettings', $this->lng->txt(
'save'));