4 require_once
"./Services/Object/classes/class.ilObjectGUI.php";
6 require_once
'Modules/Test/classes/class.ilObjTest.php';
7 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionProcessLocker.php';
31 $this->
ilObjectGUI($a_data,$a_id,$a_call_by_reference,
false);
33 if (!$rbacsystem->checkAccess(
'read',$this->object->getRefId()))
35 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_read_assf"),$this->
ilias->error_obj->WARNING);
38 $this->lng->loadLanguageModule(
'assessment');
47 global $rbacsystem, $ilTabs;
49 $next_class = $this->ctrl->getNextClass($this);
50 $cmd = $this->ctrl->getCmd();
55 case 'ilpermissiongui':
56 $ilTabs->activateTab(
'perm_settings');
57 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
59 $ret =& $this->ctrl->forwardCommand($perm_gui);
62 case 'ilsettingstemplategui':
66 case 'ilglobalunitconfigurationgui':
67 if(!$rbacsystem->checkAccess(
'write', $this->object->getRefId()))
69 $this->
ilias->raiseError($this->lng->txt(
'permission_denied'), $this->
ilias->error_obj->WARNING);
72 $ilTabs->setTabActive(
'units');
74 require_once
'Modules/TestQuestionPool/classes/class.ilGlobalUnitConfigurationGUI.php';
75 require_once
'Modules/TestQuestionPool/classes/class.ilUnitConfigurationRepository.php';
79 $this->ctrl->forwardCommand($gui);
105 $newObj = parent::saveObject();
112 $this->ctrl->redirect($this);
123 $ilTabs->setTabActive(
'settings');
127 $form = $this->buildSettingsForm();
130 $this->tpl->setVariable(
"ADM_CONTENT", $form->getHTML());
133 private function buildSettingsForm()
140 include_once
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
141 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
143 $form->setFormAction($this->ctrl->getFormAction($this));
144 $form->setTableWidth(
"100%");
145 $form->setId(
"settings");
148 $header->setTitle($this->lng->txt(
'settings'));
152 $chb =
new ilCheckboxInputGUI($this->lng->txt(
'ass_process_lock'),
'ass_process_lock');
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');
159 $opt->
setInfo($this->lng->txt(
'ass_process_lock_mode_file_desc'));
160 $rg->addOption($opt);
162 $opt->
setInfo($this->lng->txt(
'ass_process_lock_mode_db_desc'));
163 $rg->addOption($opt);
166 $rg->setValue($this->object->getAssessmentProcessLockMode());
168 $chb->addSubItem($rg);
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';
174 $linepicker =
new ilColorPickerInputGUI($this->lng->txt(
'assessment_imap_line_color'),
'imap_line_color');
175 $linepicker->
setValue($imap_line_color);
176 $form->addItem($linepicker);
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);
183 $fields = array(
'usr_id',
'login',
'email',
'matriculation',
'ext_account');
184 $usr_fields = array();
185 foreach($fields as $field)
187 $usr_fields[$field] = $field;
189 $userCriteria->setOptions($usr_fields);
190 $userCriteria->setValue($user_criteria);
191 $form->addItem($userCriteria);
194 $this->lng->txt(
'tst_skill_triggerings_num_req_answers'),
'num_req_answers' 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);
206 $header->setTitle($this->lng->txt(
"assf_questiontypes"));
210 $allowed =
new ilCheckboxGroupInputGUI($this->lng->txt(
'assf_allowed_questiontypes'),
"chb_allowed_questiontypes");
212 $forbidden_types = $this->
object->_getForbiddenQuestionTypes();
213 $allowedtypes = array();
214 foreach ($questiontypes as $qt)
216 if (!in_array($qt[
'question_type_id'], $forbidden_types)) array_push($allowedtypes, $qt[
'question_type_id']);
218 $allowed->setValue($allowedtypes);
219 foreach ($questiontypes as $type_name => $qtype)
221 $allowed->addOption(
new ilCheckboxOption($type_name, $qtype[
"question_type_id"]));
223 $allowed->setInfo($this->lng->txt(
'assf_allowed_questiontypes_desc'));
224 $form->addItem($allowed);
227 $manual =
new ilCheckboxGroupInputGUI($this->lng->txt(
'assessment_log_manual_scoring_activate'),
"chb_manual_scoring");
228 $manscoring = $this->
object->_getManualScoring();
230 foreach ($questiontypes as $type_name => $qtype)
232 $manual->addOption(
new ilCheckboxOption($type_name, $qtype[
"question_type_id"]));
234 $manual->setInfo($this->lng->txt(
'assessment_log_manual_scoring_desc'));
235 $form->addItem($manual);
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);
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)
249 $scoring->addOption(
new ilCheckboxOption($type_name, $qtype[
"question_type_id"]));
251 $scoring->setInfo($this->lng->txt(
'assessment_log_scoring_adjustment_desc'));
252 $form->addItem($scoring);
254 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
256 $form->addCommandButton(
"saveSettings", $this->lng->txt(
"save"));
268 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) $this->ctrl->redirect($this,
'settings');
270 $form = $this->buildSettingsForm();
271 if(!$form->checkInput())
273 $form->setValuesByPost();
277 $this->
object->setSkillTriggeringNumAnswersBarrier((
int)
$_POST[
'num_req_answers']);
279 $this->
object->_setManualScoring($_POST[
"chb_manual_scoring"]);
280 include_once
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
282 $forbidden_types = array();
283 foreach ($questiontypes as $name =>
$row)
285 if (!in_array(
$row[
"question_type_id"], $_POST[
"chb_allowed_questiontypes"]))
287 array_push($forbidden_types,
$row[
"question_type_id"]);
290 $this->
object->_setForbiddenQuestionTypes($forbidden_types);
292 $this->
object->setScoringAdjustmentEnabled($_POST[
'chb_scoring_adjust']);
293 $scoring_types = array();
294 foreach ($questiontypes as $name =>
$row)
296 if (in_array(
$row[
"question_type_id"], (array)$_POST[
"chb_scoring_adjustment"]))
298 array_push($scoring_types,
$row[
"question_type_id"]);
301 $this->
object->setScoringAdjustableQuestions($scoring_types);
303 if( !$_POST[
'ass_process_lock'] )
309 $this->
object->setAssessmentProcessLockMode($_POST[
'ass_process_lock_mode']);
312 $assessmentSetting =
new ilSetting(
'assessment');
313 $assessmentSetting->set(
'use_javascript',
'1');
314 if(strlen($_POST[
'imap_line_color']) == 6)
322 $this->ctrl->redirect($this,
'settings');
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']);
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']);
348 $this->lng->txt(
"assessment_log_datetime"),
349 $this->lng->txt(
"user"),
350 $this->lng->txt(
"assessment_log_text"),
351 $this->lng->txt(
"question")
353 include_once
"./Modules/Test/classes/class.ilObjTest.php";
354 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
357 $log_output =& $this->
object->getLog($from, $until,
$test);
359 foreach ($log_output as $key =>
$log)
361 if (!array_key_exists(
$log[
"user_fi"], $users))
366 if (
$log[
"question_fi"] ||
$log[
"original_fi"])
369 if (strlen($title) == 0)
373 $title = $this->lng->txt(
"assessment_log_question") .
": " . $title;
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);
384 foreach ($csv as
$row)
388 ilUtil::deliverData($csvoutput, str_replace(
" ",
"_",
"log_" . $from .
"_" . $until .
"_" . $available_tests[
$test]).
".csv");
394 public function logsObject($p_from = null, $p_until = null, $p_test = null)
397 $ilTabs->activateTab(
'logs');
399 $template =
new ilTemplate(
"tpl.assessment_logs.html", TRUE, TRUE,
"Modules/Test");
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";
406 if (count($available_tests) == 0)
412 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
414 $form->setFormAction($this->ctrl->getFormAction($this));
415 $form->setTableWidth(
"100%");
416 $form->setId(
"logs");
419 $header->setTitle($this->lng->txt(
"assessment_log"));
426 $fromdate = ($p_from) ? $p_from : ((
$_GET[
'log_from']) ?
$_GET[
'log_from'] : mktime(0, 0, 0, 1, 1, $now[
'year']));
428 $form->addItem($from);
433 $untildate = ($p_until) ? $p_until : ((
$_GET[
'log_until']) ?
$_GET[
'log_until'] : time());
435 $form->addItem($until);
438 $fortest =
new ilSelectInputGUI($this->lng->txt(
'assessment_log_for_test'),
"sel_test");
439 $sorted_options = array();
440 foreach($available_tests as $key => $value)
442 $sorted_options[] = array(
443 'title' =>
ilUtil::prepareFormOutput($value) .
" [" . $this->object->getNrOfLogEntries($key) .
" " . $this->lng->txt(
"assessment_log_log_entries") .
"]",
449 foreach($sorted_options as $option)
451 $options[$option[
'key']] = $option[
'title'];
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());
466 include_once
"./Modules/Test/classes/tables/class.ilAssessmentFolderLogTableGUI.php";
468 $log_output =& $this->
object->getLog($fromdate, $untildate, $p_test);
471 array_walk($log_output,
function(&
$row) use ($self) {
472 if(is_numeric(
$row[
'ref_id']) &&
$row[
'ref_id'] > 0)
475 $row[
'location_txt'] = $self->lng->txt(
"perma_link");
478 $table_gui->setData($log_output);
479 $template->setVariable(
'LOG', $table_gui->getHTML());
481 $this->tpl->setVariable(
"ADM_CONTENT", $template->get());
489 if (is_array(
$_POST[
"chb_test"]) && (count(
$_POST[
"chb_test"])))
491 $this->
object->deleteLogEntries(
$_POST[
"chb_test"]);
506 global $ilAccess, $ilTabs;
508 $ilTabs->activateTab(
'logs');
510 $a_write_access = ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) ? true :
false;
512 include_once
"./Modules/Test/classes/tables/class.ilAssessmentFolderLogAdministrationTableGUI.php";
514 include_once
"./Modules/Test/classes/class.ilObjTest.php";
515 require_once
"./Services/Link/classes/class.ilLink.php";
518 foreach ($available_tests as
$ref_id => $title)
521 array_push(
$data, array(
523 "nr" => $this->object->getNrOfLogEntries(
$obj_id),
526 "location_txt" => $this->lng->txt(
"perma_link")
529 $table_gui->setData(
$data);
530 $this->tpl->setVariable(
'ADM_CONTENT', $table_gui->getHTML());
543 $ilTabs->addSubTabTarget(
"settings",
544 $this->ctrl->getLinkTarget($this,
"showLogSettings"),
545 array(
"saveLogSettings",
"showLogSettings")
549 $ilTabs->addSubTabTarget(
"ass_log_output",
550 $this->ctrl->getLinkTarget($this,
"logs"),
551 array(
"logs",
"showLog",
"exportLog")
555 $ilTabs->addSubTabTarget(
"ass_log_admin",
556 $this->ctrl->getLinkTarget($this,
"logAdmin"),
557 array(
"logAdmin",
"deleteLog"),
569 global $rbacsystem,
$lng;
571 switch ($this->ctrl->getCmd())
573 case "saveLogSettings":
574 case "showLogSettings":
584 if ($rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
586 $tabs_gui->addTarget(
"settings",
587 $this->ctrl->getLinkTarget($this,
"settings"), array(
"settings",
"",
"view"),
"",
"");
589 $tabs_gui->addTarget(
"logs",
590 $this->ctrl->getLinkTarget($this,
"showLogSettings"),
591 array(
'saveLogSettings',
'showLogSettings',
"logs",
"showLog",
"exportLog",
"logAdmin",
"deleteLog"),
594 $tabs_gui->addTab(
"templates",
595 $lng->txt(
"adm_settings_templates"),
596 $this->ctrl->getLinkTargetByClass(
"ilsettingstemplategui",
""));
599 if ($rbacsystem->checkAccess(
"write",$this->object->getRefId()))
601 $tabs_gui->addTarget(
'units', $this->ctrl->getLinkTargetByClass(
'ilGlobalUnitConfigurationGUI',
''),
'',
'ilglobalunitconfigurationgui');
604 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
606 $tabs_gui->addTarget(
"perm_settings",
607 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');
616 $this->tabs_gui->activateTab(
'logs');
620 $form = $this->getLogSettingsForm();
621 $form->setValuesByArray(array(
622 'chb_assessment_logging' => $this->object->_enabledAssessmentLogging(),
623 'reporting_language' => $this->
object->_getLogLanguage()
627 $this->tpl->setContent($form->getHTML());
633 protected function saveLogSettingsObject()
640 if(!$ilAccess->checkAccess(
'write',
'', $this->object->getRefId()))
642 $this->
ilias->raiseError($this->lng->txt(
"permission_denied"),$this->
ilias->error_obj->WARNING);
645 $form = $this->getLogSettingsForm();
646 if($form->checkInput())
648 $this->
object->_enableAssessmentLogging((
int)$form->getInput(
'chb_assessment_logging'));
649 $this->
object->_setLogLanguage($form->getInput(
'reporting_language'));
650 $this->
object->update();
654 $form->setValuesByPost();
661 protected function getLogSettingsForm()
668 require_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
670 $form->setFormAction($this->ctrl->getFormAction($this,
'saveLogSettings'));
671 $form->setTitle($this->lng->txt(
'assessment_log_logging'));
674 $logging->setValue(1);
675 $logging->setOptionTitle($this->lng->txt(
'activate_assessment_logging'));
676 $form->addItem($logging);
678 $reporting =
new ilSelectInputGUI($this->lng->txt(
'assessment_settings_reporting_language'),
'reporting_language');
679 $languages = $this->lng->getInstalledLanguages();
680 $this->lng->loadLanguageModule(
'meta');
682 foreach($languages as
$lang)
687 $form->addItem($reporting);
689 if($ilAccess->checkAccess(
'write',
'', $this->object->getRefId()))
691 $form->addCommandButton(
'saveLogSettings', $this->lng->txt(
'save'));
701 $ilTabs->setTabActive(
'templates');
703 require_once
'Services/Administration/classes/class.ilSettingsTemplateGUI.php';
706 $this->ctrl->forwardCommand($gui);
716 require_once
'Modules/Test/classes/class.ilTestSettingsTemplateConfig.php';
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static _lookupName($a_user_id)
lookup user name
static getSettingsTemplateConfig()
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
This class represents an option in a radio group.
static deliverData($a_data, $a_filename, $mime="application/octet-stream", $charset="")
deliver data for download via browser.
This class represents an option in a checkbox group.
saveObject()
save object public
settingsObject(ilPropertyFormGUI $form=null)
display assessment folder settings form
const ASS_PROC_LOCK_MODE_DB
Class ilObjAssessmentFolderGUI.
Class ilGlobalUnitConfigurationGUI.
Class ilUnitConfigurationRepository.
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.
static getValidAssessmentProcessLockModes()
setInfo($a_info)
Set Info.
static sortArray($array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
const ASS_PROC_LOCK_MODE_NONE
& _getQuestionTypes($all_tags=FALSE, $fixOrder=false)
static _lookupObjectId($a_ref_id)
lookup object id
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
logAdminObject()
Administration output for assessment log files.
const ASS_PROC_LOCK_MODE_FILE
if(!is_array($argv)) $options
& executeCommand()
execute command
saveSettingsObject()
Save Assessment settings.
Class ilObjectGUI Basic methods of all Output classes.
special template class to simplify handling of ITX/PEAR
getTabs(&$tabs_gui)
get tabs
& _getAvailableTests($use_object_id=FALSE)
Returns the available tests for the active user.
redirection script todo: (a better solution should control the processing via a xml file) ...
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.
forwardToSettingsTemplateGUI()
showLogObject()
Called when the a log should be shown.
exportLogObject()
Called when the a log should be exported.
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
deleteLogObject()
Deletes the log entries for one or more tests.