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);
205 $ilDB = $DIC[
'ilDB'];
210 $dbtypes[
$row[
"question_type_id"]] = $row[
"type_tag"];
213 $types =
$setting->get(
"assessment_manual_scoring");
214 $ids = explode(
",", $types);
215 foreach ($ids as
$key => $value) {
216 $ids[
$key] = $dbtypes[$value];
229 if ((!is_array($type_ids)) || (count($type_ids) == 0)) {
230 $setting->delete(
"assessment_manual_scoring");
232 $setting->set(
"assessment_manual_scoring", implode(
",", $type_ids));
240 $types =
$setting->get(
"assessment_scoring_adjustment");
241 return explode(
",", $types);
247 if ((!is_array($type_ids)) || (count($type_ids) == 0)) {
248 $setting->delete(
"assessment_scoring_adjustment");
250 $setting->set(
"assessment_scoring_adjustment", implode(
",", $type_ids));
257 return $setting->get(
'assessment_adjustments_enabled');
263 $setting->set(
'assessment_adjustments_enabled', (
bool) $active);
276 public static function _addLog($user_id, $object_id, $logtext, $question_id =
"", $original_id =
"", $test_only =
false, $test_ref_id = null)
280 $ilDB = $DIC[
'ilDB'];
281 if (strlen($question_id) == 0) {
284 if (strlen($original_id) == 0) {
287 if (strlen($test_ref_id) == 0) {
290 $only = ($test_only ==
true) ? 1 : 0;
291 $next_id =
$ilDB->nextId(
'ass_log');
292 $affectedRows =
$ilDB->manipulateF(
293 "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)",
294 array(
'integer',
'integer',
'integer',
'text',
'integer',
'integer',
'text',
'integer',
'integer'),
317 public static function getLog($ts_from, $ts_to, $test_id, $test_only =
false)
320 $ilDB = $DIC[
'ilDB'];
323 if ($test_only ==
true) {
325 "SELECT * FROM ass_log WHERE obj_fi = %s AND tstamp > %s AND tstamp < %s AND test_only = %s ORDER BY tstamp",
326 array(
'integer',
'integer',
'integer',
'text'),
336 "SELECT * FROM ass_log WHERE obj_fi = %s AND tstamp > %s AND tstamp < %s ORDER BY tstamp",
337 array(
'integer',
'integer',
'integer'),
346 if (!array_key_exists(
$row[
"tstamp"],
$log)) {
349 array_push(
$log[
$row[
"tstamp"]], $row);
353 $log_array = array();
356 array_push($log_array,
$row);
370 public static function _getLog($ts_from, $ts_to, $test_id, $test_only =
false)
373 $ilDB = $DIC[
'ilDB'];
376 if ($test_only ==
true) {
378 "SELECT * FROM ass_log WHERE obj_fi = %s AND tstamp > %s AND tstamp < %s AND test_only = %s ORDER BY tstamp",
379 array(
'integer',
'integer',
'integer',
'text'),
380 array($test_id, $ts_from, $ts_to, 1)
384 "SELECT * FROM ass_log WHERE obj_fi = %s AND tstamp > %s AND tstamp < %s ORDER BY tstamp",
385 array(
'integer',
'integer',
'integer'),
386 array($test_id, $ts_from, $ts_to)
390 if (!array_key_exists(
$row[
"tstamp"],
$log)) {
394 if (array_key_exists(
"ref_id",
$row)) {
395 if (
$row[
"ref_id"] > 0) {
399 $type_href = sprintf(
"goto.php?target=tst_%s&client_id=" . CLIENT_ID,
$row[
"ref_id"]);
402 $type_href = sprintf(
"goto.php?target=cat_%s&client_id=" . CLIENT_ID,
$row[
"ref_id"]);
407 $row[
"href"] = $type_href;
408 array_push(
$log[
$row[
"tstamp"]], $row);
412 $log_array = array();
415 array_push($log_array,
$row);
430 $ilDB = $DIC[
'ilDB'];
432 "SELECT COUNT(obj_fi) logcount FROM ass_log WHERE obj_fi = %s",
438 return $row[
"logcount"];
453 $tree = $DIC[
'tree'];
455 $pathelements = array();
460 array_push($pathelements,
"<a href=\"./goto.php?target=" .
$data[
"type"] .
"_" .
$data[
"ref_id"] .
"&client=" . CLIENT_ID .
"\">" .
464 return implode(
" > ", $pathelements);
475 $ilDB = $DIC[
'ilDB'];
478 foreach ($a_array as $object_id) {
479 $affectedRows =
$ilDB->manipulateF(
480 "DELETE FROM ass_log WHERE obj_fi = %s",
484 self::_addLog(
$ilUser->getId(), $object_id, $this->lng->txt(
"assessment_log_deleted"));
496 require_once
'Modules/TestQuestionPool/classes/class.assQuestion.php';
502 'enable_tst_page_edit',
503 self::ADDITIONAL_QUESTION_CONTENT_EDITING_MODE_PAGE_OBJECT_DISABLED
506 return $isPageEditorEnabled;
511 return $this->setting->get(
'ass_process_lock_mode', self::ASS_PROC_LOCK_MODE_NONE);
516 $this->setting->set(
'ass_process_lock_mode', $lockMode);
521 return array(self::ASS_PROC_LOCK_MODE_NONE, self::ASS_PROC_LOCK_MODE_FILE, self::ASS_PROC_LOCK_MODE_DB);
526 return $this->setting->get(
527 'ass_skl_trig_num_answ_barrier',
528 self::DEFAULT_SKL_TRIG_NUM_ANSWERS_BARRIER
534 $this->setting->set(
'ass_skl_trig_num_answ_barrier', $skillTriggeringNumAnswersBarrier);
539 $this->setting->set(
'export_essay_qst_with_html', $value);
544 return $this->setting->get(
'export_essay_qst_with_html');
549 require_once
'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
550 $scoringAdjustableQuestionTypes = array();
552 foreach ($allQuestionTypes as
$type => $typeData) {
556 $scoringAdjustableQuestionTypes[
$type] = $typeData;
560 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.
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 ...
for($i=1; $i<=count($kw_cases_sel); $i+=1) $lang
update()
update object data
Interface ilGuiAnswerScoringAdjustable.
Interface ilGuiQuestionScoringAdjustable.
fetchScoringAdjustableTypes($allQuestionTypes)
const ADDITIONAL_QUESTION_CONTENT_EDITING_MODE_PAGE_OBJECT_ENABLED
static setScoringAdjustmentEnabled($active)