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';
26 public function __construct($a_data, $a_id = 0, $a_call_by_reference =
true, $a_prepare_output =
true)
31 parent::__construct($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);
204 $ceeqwh =
new ilCheckboxInputGUI($this->lng->txt(
'export_essay_qst_with_html'),
'export_essay_qst_with_html');
206 $ceeqwh->setInfo($this->lng->txt(
'export_essay_qst_with_html_desc'));
207 $form->addItem($ceeqwh);
211 $header->setTitle($this->lng->txt(
"assf_questiontypes"));
215 $allowed =
new ilCheckboxGroupInputGUI($this->lng->txt(
'assf_allowed_questiontypes'),
"chb_allowed_questiontypes");
218 $allowedtypes =
array();
219 foreach ($questiontypes as $qt)
221 if (!in_array($qt[
'question_type_id'], $forbidden_types)) array_push($allowedtypes, $qt[
'question_type_id']);
223 $allowed->setValue($allowedtypes);
224 foreach ($questiontypes as $type_name => $qtype)
226 $allowed->addOption(
new ilCheckboxOption($type_name, $qtype[
"question_type_id"]));
228 $allowed->setInfo($this->lng->txt(
'assf_allowed_questiontypes_desc'));
229 $form->addItem($allowed);
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)
237 $manual->addOption(
new ilCheckboxOption($type_name, $qtype[
"question_type_id"]));
239 $manual->setInfo($this->lng->txt(
'assessment_log_manual_scoring_desc'));
240 $form->addItem($manual);
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);
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)
254 $scoring->addOption(
new ilCheckboxOption($type_name, $qtype[
"question_type_id"]));
256 $scoring->setInfo($this->lng->txt(
'assessment_log_scoring_adjustment_desc'));
257 $form->addItem($scoring);
259 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
261 $form->addCommandButton(
"saveSettings", $this->lng->txt(
"save"));
273 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) $this->ctrl->redirect($this,
'settings');
275 $form = $this->buildSettingsForm();
276 if(!$form->checkInput())
278 $form->setValuesByPost();
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";
287 $forbidden_types =
array();
288 foreach ($questiontypes as $name =>
$row)
290 if (!in_array(
$row[
"question_type_id"], $_POST[
"chb_allowed_questiontypes"]))
292 array_push($forbidden_types,
$row[
"question_type_id"]);
295 $this->
object->_setForbiddenQuestionTypes($forbidden_types);
297 $this->
object->setScoringAdjustmentEnabled($_POST[
'chb_scoring_adjust']);
298 $scoring_types =
array();
299 foreach ($questiontypes as $name =>
$row)
301 if (in_array(
$row[
"question_type_id"], (
array)$_POST[
"chb_scoring_adjustment"]))
303 array_push($scoring_types,
$row[
"question_type_id"]);
306 $this->
object->setScoringAdjustableQuestions($scoring_types);
308 if( !$_POST[
'ass_process_lock'] )
314 $this->
object->setAssessmentProcessLockMode($_POST[
'ass_process_lock_mode']);
317 $assessmentSetting =
new ilSetting(
'assessment');
318 $assessmentSetting->set(
'use_javascript',
'1');
319 if(strlen($_POST[
'imap_line_color']) == 6)
327 $this->ctrl->redirect($this,
'settings');
338 $form->setValuesByPost();
339 $this->logsObject($form);
348 if(!$form->checkInput())
350 $form->setValuesByPost();
351 $this->logsObject($form);
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);
362 $this->lng->txt(
"assessment_log_datetime"),
363 $this->lng->txt(
"user"),
364 $this->lng->txt(
"assessment_log_text"),
365 $this->lng->txt(
"question")
367 include_once
"./Modules/Test/classes/class.ilObjTest.php";
368 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
373 foreach ($log_output as $key =>
$log)
375 if (!array_key_exists(
$log[
"user_fi"], $users))
380 if (
$log[
"question_fi"] ||
$log[
"original_fi"])
387 $title = $this->lng->txt(
"assessment_log_question") .
": " .
$title;
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);
398 foreach ($csv as
$row)
400 $csvoutput .= join($row, $separator) .
"\n";
402 ilUtil::deliverData($csvoutput, str_replace(
" ",
"_",
"log_" . $from .
"_" . $until .
"_" . $available_tests[
$test]).
".csv");
410 require_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
412 $form->setPreventDoubleSubmission(
false);
413 $form->setFormAction($this->ctrl->getFormAction($this));
414 $form->setTableWidth(
"100%");
415 $form->setId(
"logs");
418 $header->setTitle($this->lng->txt(
"assessment_log"));
424 $from->setRequired(
true);
425 $form->addItem($from);
430 $until->setRequired(
true);
431 $form->addItem($until);
433 require_once
'Modules/Test/classes/class.ilObjTest.php';
434 require_once
'Modules/TestQuestionPool/classes/class.assQuestion.php';
438 $fortest =
new ilSelectInputGUI($this->lng->txt(
'assessment_log_for_test'),
"sel_test");
440 $sorted_options =
array();
441 foreach($available_tests as $key => $value)
443 $sorted_options[] =
array(
444 'title' =>
ilUtil::prepareFormOutput($value) .
" [" . $this->
object->getNrOfLogEntries($key) .
" " . $this->lng->txt(
"assessment_log_log_entries") .
"]",
450 foreach($sorted_options as $option)
452 $options[$option[
'key']] = $option[
'title'];
455 $form->addItem($fortest);
457 $form->addCommandButton(
'showLog', $this->lng->txt(
'show'));
458 $form->addCommandButton(
'exportLog', $this->lng->txt(
'export'));
473 $ilTabs->activateTab(
'logs');
475 $template =
new ilTemplate(
"tpl.assessment_logs.html", TRUE, TRUE,
"Modules/Test");
486 if(isset(
$_GET[
'sel_test']))
488 $p_test = $values[
'sel_test'] = (int)
$_GET[
'sel_test'];
491 if(isset(
$_GET[
'log_from']))
493 $fromdate = (int)
$_GET[
'log_from'];
497 $fromdate = mktime(0, 0, 0, 1, 1,
date(
'Y'));
500 if(isset(
$_GET[
'log_until']))
502 $untildate = (int)
$_GET[
'log_until'];
512 $form->setValuesByArray($values);
516 $fromdate_input = $form->getItemByPostVar(
'log_from')->getDate();
517 $untildate_input = $form->getItemByPostVar(
'log_until')->getDate();
520 $p_test = $form->getInput(
'sel_test');
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);
531 $template->setVariable(
"FORM", $form->getHTML());
535 require_once
"Services/Link/classes/class.ilLink.php";
536 include_once
"./Modules/Test/classes/tables/class.ilAssessmentFolderLogTableGUI.php";
541 array_walk($log_output,
function(&
$row) use ($self) {
542 if(is_numeric(
$row[
'ref_id']) &&
$row[
'ref_id'] > 0)
545 $row[
'location_txt'] = $self->lng->txt(
"perma_link");
549 $table_gui->setData($log_output);
550 $template->setVariable(
'LOG', $table_gui->getHTML());
552 $this->tpl->setVariable(
"ADM_CONTENT", $template->get());
560 if (is_array(
$_POST[
"chb_test"]) && (count(
$_POST[
"chb_test"])))
562 $this->
object->deleteLogEntries(
$_POST[
"chb_test"]);
577 global $ilAccess, $ilTabs;
579 $ilTabs->activateTab(
'logs');
581 $a_write_access = ($ilAccess->checkAccess(
"write",
"", $this->
object->getRefId())) ? true :
false;
583 include_once
"./Modules/Test/classes/tables/class.ilAssessmentFolderLogAdministrationTableGUI.php";
585 include_once
"./Modules/Test/classes/class.ilObjTest.php";
586 require_once
"./Services/Link/classes/class.ilLink.php";
597 "location_txt" => $this->lng->txt(
"perma_link")
600 $table_gui->setData(
$data);
601 $this->tpl->setVariable(
'ADM_CONTENT', $table_gui->getHTML());
614 $ilTabs->addSubTabTarget(
"settings",
615 $this->ctrl->getLinkTarget($this,
"showLogSettings"),
616 array(
"saveLogSettings",
"showLogSettings")
620 $ilTabs->addSubTabTarget(
"ass_log_output",
621 $this->ctrl->getLinkTarget($this,
"logs"),
622 array(
"logs",
"showLog",
"exportLog")
626 $ilTabs->addSubTabTarget(
"ass_log_admin",
627 $this->ctrl->getLinkTarget($this,
"logAdmin"),
628 array(
"logAdmin",
"deleteLog"),
640 global $rbacsystem,
$lng;
642 switch ($this->ctrl->getCmd())
644 case "saveLogSettings":
645 case "showLogSettings":
655 if ($rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
657 $this->tabs_gui->addTarget(
"settings",
658 $this->ctrl->getLinkTarget($this,
"settings"),
array(
"settings",
"",
"view"),
"",
"");
660 $this->tabs_gui->addTarget(
"logs",
661 $this->ctrl->getLinkTarget($this,
"showLogSettings"),
662 array(
'saveLogSettings',
'showLogSettings',
"logs",
"showLog",
"exportLog",
"logAdmin",
"deleteLog"),
665 $this->tabs_gui->addTab(
"templates",
666 $lng->txt(
"adm_settings_templates"),
667 $this->ctrl->getLinkTargetByClass(
"ilsettingstemplategui",
""));
670 if ($rbacsystem->checkAccess(
"write",$this->object->getRefId()))
672 $this->tabs_gui->addTarget(
'units', $this->ctrl->getLinkTargetByClass(
'ilGlobalUnitConfigurationGUI',
''),
'',
'ilglobalunitconfigurationgui');
675 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
677 $this->tabs_gui->addTarget(
"perm_settings",
678 $this->ctrl->getLinkTargetByClass(
array(get_class($this),
'ilpermissiongui'),
"perm"),
array(
"perm",
"info",
"owner"),
'ilpermissiongui');
687 $this->tabs_gui->activateTab(
'logs');
691 $form = $this->getLogSettingsForm();
692 $form->setValuesByArray(
array(
698 $this->tpl->setContent($form->getHTML());
704 protected function saveLogSettingsObject()
711 if(!$ilAccess->checkAccess(
'write',
'', $this->object->getRefId()))
713 $this->
ilias->raiseError($this->lng->txt(
"permission_denied"),$this->
ilias->error_obj->WARNING);
716 $form = $this->getLogSettingsForm();
717 if($form->checkInput())
719 $this->
object->_enableAssessmentLogging((
int)$form->getInput(
'chb_assessment_logging'));
720 $this->
object->_setLogLanguage($form->getInput(
'reporting_language'));
721 $this->
object->update();
725 $form->setValuesByPost();
732 protected function getLogSettingsForm()
739 require_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
741 $form->setFormAction($this->ctrl->getFormAction($this,
'saveLogSettings'));
742 $form->setTitle($this->lng->txt(
'assessment_log_logging'));
745 $logging->setValue(1);
746 $logging->setOptionTitle($this->lng->txt(
'activate_assessment_logging'));
747 $form->addItem($logging);
749 $reporting =
new ilSelectInputGUI($this->lng->txt(
'assessment_settings_reporting_language'),
'reporting_language');
750 $languages = $this->lng->getInstalledLanguages();
751 $this->lng->loadLanguageModule(
'meta');
753 foreach($languages as
$lang)
758 $form->addItem($reporting);
760 if($ilAccess->checkAccess(
'write',
'', $this->object->getRefId()))
762 $form->addCommandButton(
'saveLogSettings', $this->lng->txt(
'save'));
772 $ilTabs->setTabActive(
'templates');
774 require_once
'Services/Administration/classes/class.ilSettingsTemplateGUI.php';
777 $this->ctrl->forwardCommand($gui);
787 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
static _getQuestionTypes($all_tags=FALSE, $fixOrder=false)
const ASS_PROC_LOCK_MODE_DB
Class ilObjAssessmentFolderGUI.
Class ilGlobalUnitConfigurationGUI.
Class ilUnitConfigurationRepository.
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
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.
static _getLogLanguage()
retrieve the log language for assessment logging
const ASS_PROC_LOCK_MODE_FILE
prepareOutput($a_show_subobjects=true)
prepare output
static _enabledAssessmentLogging()
check wether assessment logging is enabled or not
static _getAvailableTests($use_object_id=FALSE)
Returns the available tests for the active user.
if(!is_array($argv)) $options
saveSettingsObject()
Save Assessment settings.
Class ilObjectGUI Basic methods of all Output classes.
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
special template class to simplify handling of ITX/PEAR
static _getForbiddenQuestionTypes()
Returns the forbidden questiontypes for ILIAS.
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)
Create styles array
The data for the language used.
__construct($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
Constructor.
Create new PHPExcel object
obj_idprivate
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.
for($i=1; $i<=count($kw_cases_sel); $i+=1) $lang
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
forwardToSettingsTemplateGUI()
showLogObject()
Called when the a log should be shown.
exportLogObject()
Called when the a log should be exported.
static _getQuestionTitle($question_id)
Returns the question title of a question with a given id.
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
executeCommand()
execute command
deleteLogObject()
Deletes the log entries for one or more tests.