4 require_once
"./Services/Object/classes/class.ilObject.php";
5 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionProcessLocker.php';
37 public function __construct($a_id = 0, $a_call_by_reference =
true)
39 include_once
"./Services/Administration/classes/class.ilSetting.php";
40 $this->setting =
new ilSetting(
"assessment");
42 parent::__construct($a_id, $a_call_by_reference);
64 require_once
'Services/Administration/classes/class.ilSetting.php';
65 $assSettings =
new ilSetting(
'assessment');
67 return $assSettings->get(
68 self::SETTINGS_KEY_SKL_TRIG_NUM_ANSWERS_BARRIER,
69 self::DEFAULT_SKL_TRIG_NUM_ANSWERS_BARRIER
79 public function delete()
82 if (!parent::delete()) {
99 $setting->set(
"assessment_logging", 1);
101 $setting->set(
"assessment_logging", 0);
112 $setting->set(
"assessment_log_language", $a_language);
122 return (
boolean)
$setting->get(
"assessment_logging");
131 $types =
$setting->get(
"forbidden_questiontypes");
133 if (strlen(trim($types)) == 0) {
150 if (is_array($a_types) && (count($a_types) > 0)) {
151 $types = serialize($a_types);
153 $setting->set(
"forbidden_questiontypes", $types);
164 if (strlen(
$lang) == 0) {
181 if (count(self::_getManualScoring()) > 0) {
195 $types =
$setting->get(
"assessment_manual_scoring");
196 return explode(
",", $types);
206 $result = $ilDB->query(
"SELECT * FROM qpl_qst_type");
209 $dbtypes[
$row[
"question_type_id"]] = $row[
"type_tag"];
212 $types =
$setting->get(
"assessment_manual_scoring");
213 $ids = explode(
",", $types);
214 foreach ($ids as
$key => $value) {
215 $ids[
$key] = $dbtypes[$value];
228 if ((!is_array($type_ids)) || (count($type_ids) == 0)) {
229 $setting->delete(
"assessment_manual_scoring");
231 $setting->set(
"assessment_manual_scoring", implode($type_ids,
","));
239 $types =
$setting->get(
"assessment_scoring_adjustment");
240 return explode(
",", $types);
246 if ((!is_array($type_ids)) || (count($type_ids) == 0)) {
247 $setting->delete(
"assessment_scoring_adjustment");
249 $setting->set(
"assessment_scoring_adjustment", implode($type_ids,
","));
256 return $setting->get(
'assessment_adjustments_enabled');
262 $setting->set(
'assessment_adjustments_enabled', (
bool) $active);
275 public static function _addLog($user_id, $object_id, $logtext, $question_id =
"", $original_id =
"", $test_only =
false, $test_ref_id = null)
278 if (strlen($question_id) == 0) {
281 if (strlen($original_id) == 0) {
284 if (strlen($test_ref_id) == 0) {
287 $only = ($test_only ==
true) ? 1 : 0;
288 $next_id = $ilDB->nextId(
'ass_log');
289 $affectedRows = $ilDB->manipulateF(
290 "INSERT INTO ass_log (ass_log_id, user_fi, obj_fi, logtext, question_fi, original_fi, test_only, ref_id, tstamp) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)",
291 array(
'integer',
'integer',
'integer',
'text',
'integer',
'integer',
'text',
'integer',
'integer'),
314 public static function getLog($ts_from, $ts_to, $test_id, $test_only =
false)
319 if ($test_only ==
true) {
321 "SELECT * FROM ass_log WHERE obj_fi = %s AND tstamp > %s AND tstamp < %s AND test_only = %s ORDER BY tstamp",
322 array(
'integer',
'integer',
'integer',
'text'),
332 "SELECT * FROM ass_log WHERE obj_fi = %s AND tstamp > %s AND tstamp < %s ORDER BY tstamp",
333 array(
'integer',
'integer',
'integer'),
342 if (!array_key_exists(
$row[
"tstamp"],
$log)) {
345 array_push(
$log[
$row[
"tstamp"]], $row);
349 $log_array =
array();
352 array_push($log_array,
$row);
366 public static function _getLog($ts_from, $ts_to, $test_id, $test_only =
false)
371 if ($test_only ==
true) {
373 "SELECT * FROM ass_log WHERE obj_fi = %s AND tstamp > %s AND tstamp < %s AND test_only = %s ORDER BY tstamp",
374 array(
'integer',
'integer',
'integer',
'text'),
375 array($test_id, $ts_from, $ts_to, 1)
379 "SELECT * FROM ass_log WHERE obj_fi = %s AND tstamp > %s AND tstamp < %s ORDER BY tstamp",
380 array(
'integer',
'integer',
'integer'),
381 array($test_id, $ts_from, $ts_to)
385 if (!array_key_exists(
$row[
"tstamp"],
$log)) {
389 if (array_key_exists(
"ref_id",
$row)) {
390 if (
$row[
"ref_id"] > 0) {
394 $type_href = sprintf(
"goto.php?target=tst_%s&client_id=" . CLIENT_ID,
$row[
"ref_id"]);
397 $type_href = sprintf(
"goto.php?target=cat_%s&client_id=" . CLIENT_ID,
$row[
"ref_id"]);
402 $row[
"href"] = $type_href;
403 array_push(
$log[
$row[
"tstamp"]], $row);
407 $log_array =
array();
410 array_push($log_array,
$row);
426 "SELECT COUNT(obj_fi) logcount FROM ass_log WHERE obj_fi = %s",
432 return $row[
"logcount"];
448 $pathelements =
array();
453 array_push($pathelements,
"<a href=\"./goto.php?target=" .
$data[
"type"] .
"_" .
$data[
"ref_id"] .
"&client=" . CLIENT_ID .
"\">" .
457 return implode(
" > ", $pathelements);
470 foreach ($a_array as $object_id) {
471 $affectedRows = $ilDB->manipulateF(
472 "DELETE FROM ass_log WHERE obj_fi = %s",
476 self::_addLog($ilUser->getId(), $object_id, $this->lng->txt(
"assessment_log_deleted"));
488 require_once
'Modules/TestQuestionPool/classes/class.assQuestion.php';
492 $isPageEditorEnabled = $ilSetting->get(
493 'enable_tst_page_edit',
494 self::ADDITIONAL_QUESTION_CONTENT_EDITING_MODE_PAGE_OBJECT_DISABLED
497 return $isPageEditorEnabled;
502 return $this->setting->get(
'ass_process_lock_mode', self::ASS_PROC_LOCK_MODE_NONE);
507 $this->setting->set(
'ass_process_lock_mode', $lockMode);
512 return array(self::ASS_PROC_LOCK_MODE_NONE, self::ASS_PROC_LOCK_MODE_FILE, self::ASS_PROC_LOCK_MODE_DB);
517 return $this->setting->get(
518 'ass_skl_trig_num_answ_barrier',
519 self::DEFAULT_SKL_TRIG_NUM_ANSWERS_BARRIER
525 $this->setting->set(
'ass_skl_trig_num_answ_barrier', $skillTriggeringNumAnswersBarrier);
530 $this->setting->set(
'export_essay_qst_with_html', $value);
535 return $this->setting->get(
'export_essay_qst_with_html');
540 require_once
'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
541 $scoringAdjustableQuestionTypes =
array();
543 foreach ($allQuestionTypes as
$type => $typeData) {
547 $scoringAdjustableQuestionTypes[
$type] = $typeData;
551 return $scoringAdjustableQuestionTypes;
static getScoringAdjustmentEnabled()
__construct($a_id=0, $a_call_by_reference=true)
Constructor public.
static _getManualScoringTypes()
Retrieve the manual scoring settings as type strings.
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
_setLogLanguage($a_language)
set the log language
static setScoringAdjustableQuestions($type_ids)
const ASS_PROC_LOCK_MODE_DB
static getLog($ts_from, $ts_to, $test_id, $test_only=false)
Retrieve assessment log datasets from the database.
getAssessmentProcessLockMode()
static getValidAssessmentProcessLockModes()
static getScoringAdjustableQuestions()
const DEFAULT_SKL_TRIG_NUM_ANSWERS_BARRIER
_enableAssessmentLogging($a_enable)
enable assessment logging
const ASS_PROC_LOCK_MODE_NONE
questionSupportsScoringAdjustment(\assQuestionGUI $question_object)
getFullPath($ref_id)
Returns the full path output of an object.
deleteLogEntries($a_array)
Deletes the log entries for a given array of test object IDs.
static _getLogLanguage()
retrieve the log language for assessment logging
const ASS_PROC_LOCK_MODE_FILE
static _enabledAssessmentLogging()
check wether assessment logging is enabled or not
static _addLog($user_id, $object_id, $logtext, $question_id="", $original_id="", $test_only=false, $test_ref_id=null)
Add an assessment log entry.
getSkillTriggeringNumAnswersBarrier()
const ADDITIONAL_QUESTION_CONTENT_EDITING_MODE_PAGE_OBJECT_DISABLED
static _getQuestionGUI($question_type, $question_id=-1)
Creates a question gui representation and returns the alias to the question gui note: please do not u...
static _mananuallyScoreableQuestionTypesExists()
Returns the fact wether manually scoreable question types exist or not.
const SETTINGS_KEY_SKL_TRIG_NUM_ANSWERS_BARRIER
Class ilObjAssessmentFolder.
static _getForbiddenQuestionTypes()
Returns the forbidden questiontypes for ILIAS.
_setForbiddenQuestionTypes($a_types)
Sets the forbidden questiontypes for ILIAS.
Interface ilObjAnswerScoringAdjustable.
getNrOfLogEntries($test_obj_id)
Returns the number of log entries for a given test id.
_setManualScoring($type_ids)
Set the manual scoring settings.
Basic GUI class for assessment questions.
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
static getSkillTriggerAnswerNumberBarrier()
update($pash, $contents, Config $config)
setExportEssayQuestionsWithHtml($value)
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.
Interface ilObjQuestionScoringAdjustable.
setSkillTriggeringNumAnswersBarrier($skillTriggeringNumAnswersBarrier)
getExportEssayQuestionsWithHtml()
setAssessmentProcessLockMode($lockMode)
static isAdditionalQuestionContentEditingModePageObjectEnabled()
returns the fact wether content editing with ilias page editor is enabled for questions or not ...
update()
update object data
Interface ilGuiAnswerScoringAdjustable.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
Interface ilGuiQuestionScoringAdjustable.
fetchScoringAdjustableTypes($allQuestionTypes)
const ADDITIONAL_QUESTION_CONTENT_EDITING_MODE_PAGE_OBJECT_ENABLED
static setScoringAdjustmentEnabled($active)