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);
53 if (!parent::update())
65 require_once
'Services/Administration/classes/class.ilSetting.php';
66 $assSettings =
new ilSetting(
'assessment');
68 return $assSettings->get(
69 self::SETTINGS_KEY_SKL_TRIG_NUM_ANSWERS_BARRIER,
70 self::DEFAULT_SKL_TRIG_NUM_ANSWERS_BARRIER
83 if (!parent::delete())
102 $setting->set(
"assessment_logging", 1);
106 $setting->set(
"assessment_logging", 0);
117 $setting->set(
"assessment_log_language", $a_language);
127 return (
boolean) $setting->get(
"assessment_logging");
136 $types = $setting->get(
"forbidden_questiontypes");
138 if (strlen(trim($types)) == 0)
158 if (is_array($a_types) && (count($a_types) > 0))
160 $types = serialize($a_types);
162 $setting->set(
"forbidden_questiontypes", $types);
172 $lang = $setting->get(
"assessment_log_language");
173 if (strlen(
$lang) == 0)
191 if( count(self::_getManualScoring()) > 0 )
206 $types = $setting->get(
"assessment_manual_scoring");
207 return explode(
",", $types);
217 $result = $ilDB->query(
"SELECT * FROM qpl_qst_type");
221 $dbtypes[
$row[
"question_type_id"]] = $row[
"type_tag"];
224 $types = $setting->get(
"assessment_manual_scoring");
225 $ids = explode(
",", $types);
226 foreach ($ids as $key => $value)
228 $ids[$key] = $dbtypes[$value];
241 if ((!is_array($type_ids)) || (count($type_ids) == 0))
243 $setting->delete(
"assessment_manual_scoring");
247 $setting->set(
"assessment_manual_scoring", implode($type_ids,
","));
255 $types = $setting->get(
"assessment_scoring_adjustment");
256 return explode(
",", $types);
262 if ((!is_array($type_ids)) || (count($type_ids) == 0))
264 $setting->delete(
"assessment_scoring_adjustment");
268 $setting->set(
"assessment_scoring_adjustment", implode($type_ids,
","));
275 return $setting->get(
'assessment_adjustments_enabled');
281 $setting->set(
'assessment_adjustments_enabled', (
bool) $active);
294 public static function _addLog($user_id, $object_id, $logtext, $question_id =
"", $original_id =
"", $test_only = FALSE, $test_ref_id = NULL)
297 if (strlen($question_id) == 0) $question_id = NULL;
298 if (strlen($original_id) == 0) $original_id = NULL;
299 if (strlen($test_ref_id) == 0) $test_ref_id = NULL;
300 $only = ($test_only == TRUE) ? 1 : 0;
301 $next_id = $ilDB->nextId(
'ass_log');
302 $affectedRows = $ilDB->manipulateF(
"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)",
303 array(
'integer',
'integer',
'integer',
'text',
'integer',
'integer',
'text',
'integer',
'integer'),
326 public static function getLog($ts_from, $ts_to, $test_id, $test_only = FALSE)
331 if ($test_only == TRUE)
333 $result = $ilDB->queryF(
"SELECT * FROM ass_log WHERE obj_fi = %s AND tstamp > %s AND tstamp < %s AND test_only = %s ORDER BY tstamp",
334 array(
'integer',
'integer',
'integer',
'text'),
345 $result = $ilDB->queryF(
"SELECT * FROM ass_log WHERE obj_fi = %s AND tstamp > %s AND tstamp < %s ORDER BY tstamp",
346 array(
'integer',
'integer',
'integer'),
356 if (!array_key_exists(
$row[
"tstamp"],
$log))
360 array_push(
$log[
$row[
"tstamp"]], $row);
364 $log_array =
array();
365 foreach (
$log as $key => $value)
367 foreach ($value as $index =>
$row)
369 array_push($log_array,
$row);
383 public static function _getLog($ts_from, $ts_to, $test_id, $test_only = FALSE)
388 if ($test_only == TRUE)
390 $result = $ilDB->queryF(
"SELECT * FROM ass_log WHERE obj_fi = %s AND tstamp > %s AND tstamp < %s AND test_only = %s ORDER BY tstamp",
391 array(
'integer',
'integer',
'integer',
'text'),
392 array($test_id, $ts_from, $ts_to, 1)
397 $result = $ilDB->queryF(
"SELECT * FROM ass_log WHERE obj_fi = %s AND tstamp > %s AND tstamp < %s ORDER BY tstamp",
398 array(
'integer',
'integer',
'integer'),
399 array($test_id, $ts_from, $ts_to)
404 if (!array_key_exists(
$row[
"tstamp"],
$log))
409 if (array_key_exists(
"ref_id",
$row))
411 if (
$row[
"ref_id"] > 0)
417 $type_href = sprintf(
"goto.php?target=tst_%s&client_id=" . CLIENT_ID,
$row[
"ref_id"]);
420 $type_href = sprintf(
"goto.php?target=cat_%s&client_id=" . CLIENT_ID,
$row[
"ref_id"]);
425 $row[
"href"] = $type_href;
426 array_push(
$log[
$row[
"tstamp"]], $row);
430 $log_array =
array();
431 foreach (
$log as $key => $value)
433 foreach ($value as $index =>
$row)
435 array_push($log_array,
$row);
450 $result = $ilDB->queryF(
"SELECT COUNT(obj_fi) logcount FROM ass_log WHERE obj_fi = %s",
457 return $row[
"logcount"];
475 $pathelements =
array();
484 array_push($pathelements,
"<a href=\"./goto.php?target=" .
$data[
"type"] .
"_" .
$data[
"ref_id"] .
"&client=" . CLIENT_ID .
"\">" .
488 return implode(
" > ", $pathelements);
501 foreach ($a_array as $object_id)
503 $affectedRows = $ilDB->manipulateF(
"DELETE FROM ass_log WHERE obj_fi = %s",
507 self::_addLog($ilUser->getId(), $object_id, $this->lng->txt(
"assessment_log_deleted"));
519 require_once
'Modules/TestQuestionPool/classes/class.assQuestion.php';
523 $isPageEditorEnabled = $ilSetting->get(
524 'enable_tst_page_edit', self::ADDITIONAL_QUESTION_CONTENT_EDITING_MODE_PAGE_OBJECT_DISABLED
527 return $isPageEditorEnabled;
532 return $this->setting->get(
'ass_process_lock_mode', self::ASS_PROC_LOCK_MODE_NONE);
537 $this->setting->set(
'ass_process_lock_mode', $lockMode);
542 return array(self::ASS_PROC_LOCK_MODE_NONE, self::ASS_PROC_LOCK_MODE_FILE, self::ASS_PROC_LOCK_MODE_DB);
547 return $this->setting->get(
548 'ass_skl_trig_num_answ_barrier', self::DEFAULT_SKL_TRIG_NUM_ANSWERS_BARRIER
554 $this->setting->set(
'ass_skl_trig_num_answ_barrier', $skillTriggeringNumAnswersBarrier);
559 $this->setting->set(
'export_essay_qst_with_html', $value);
564 return $this->setting->get(
'export_essay_qst_with_html');
569 require_once
'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
570 $scoringAdjustableQuestionTypes =
array();
572 foreach($allQuestionTypes as
$type => $typeData)
578 $scoringAdjustableQuestionTypes[
$type] = $typeData;
582 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
static _addLog($user_id, $object_id, $logtext, $question_id="", $original_id="", $test_only=FALSE, $test_ref_id=NULL)
Add an assessment log entry.
_setLogLanguage($a_language)
set the log language
static setScoringAdjustableQuestions($type_ids)
const ASS_PROC_LOCK_MODE_DB
Class ilObject Basic functions for all objects.
getAssessmentProcessLockMode()
static _getLog($ts_from, $ts_to, $test_id, $test_only=FALSE)
Retrieve assessment log datasets from the database.
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
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()
setExportEssayQuestionsWithHtml($value)
static _getManualScoring()
Retrieve the manual scoring settings.
Interface ilObjQuestionScoringAdjustable.
setSkillTriggeringNumAnswersBarrier($skillTriggeringNumAnswersBarrier)
getExportEssayQuestionsWithHtml()
static getLog($ts_from, $ts_to, $test_id, $test_only=FALSE)
Retrieve assessment log datasets from the database.
setAssessmentProcessLockMode($lockMode)
static isAdditionalQuestionContentEditingModePageObjectEnabled()
returns the fact wether content editing with ilias page editor is enabled for questions or not ...
for($i=1; $i<=count($kw_cases_sel); $i+=1) $lang
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)