4require_once 
"./Services/Object/classes/class.ilObject.php";
 
    5require_once 
'Modules/TestQuestionPool/classes/class.ilAssQuestionProcessLocker.php';
 
   38                include_once 
"./Services/Administration/classes/class.ilSetting.php";
 
   39                $this->setting = 
new ilSetting(
"assessment");
 
   41                $this->
ilObject($a_id,$a_call_by_reference);
 
   52                if (!parent::update())
 
   72                if (!parent::delete())
 
   96        function notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params = 0)
 
  136                if ($a_node_id==
$_GET[
"ref_id"])
 
  138                        $parent_obj =& $this->
ilias->obj_factory->getInstanceByRefId($a_node_id);
 
  139                        $parent_type = $parent_obj->getType();
 
  140                        if($parent_type == $this->
getType())
 
  142                                $a_node_id = (int) $tree->getParentId($a_node_id);
 
  146                parent::notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params);
 
  158                        $setting->set(
"assessment_logging", 1);
 
  162                        $setting->set(
"assessment_logging", 0);
 
  173                $setting->set(
"assessment_log_language", $a_language);
 
  183                return (
boolean) 
$setting->get(
"assessment_logging");
 
  192                $types = 
$setting->get(
"forbidden_questiontypes");
 
  194                if (strlen(trim($types)) == 0)
 
  214                if (is_array($a_types) && (count($a_types) > 0))
 
  216                        $types = serialize($a_types);
 
  218                $setting->set(
"forbidden_questiontypes", $types);
 
  229                if (strlen(
$lang) == 0)
 
  247                if( count(self::_getManualScoring()) > 0 )
 
  262                $types = 
$setting->get(
"assessment_manual_scoring");
 
  263                return explode(
",", $types);
 
  277                        $dbtypes[
$row[
"question_type_id"]] = 
$row[
"type_tag"];
 
  280                $types = 
$setting->get(
"assessment_manual_scoring");
 
  281                $ids = explode(
",", $types);
 
  282                foreach ($ids as $key => $value)
 
  284                        $ids[$key] = $dbtypes[$value];
 
  297                if ((!is_array($type_ids)) || (count($type_ids) == 0))
 
  299                        $setting->delete(
"assessment_manual_scoring");
 
  303                        $setting->set(
"assessment_manual_scoring", implode($type_ids, 
","));
 
  311                $types = 
$setting->get(
"assessment_scoring_adjustment");
 
  312                return explode(
",", $types);
 
  318                if ((!is_array($type_ids)) || (count($type_ids) == 0))
 
  320                        $setting->delete(
"assessment_scoring_adjustment");
 
  324                        $setting->set(
"assessment_scoring_adjustment", implode($type_ids, 
","));
 
  331                return $setting->get(
'assessment_adjustments_enabled');
 
  337                $setting->set(
'assessment_adjustments_enabled', (
bool) $active);
 
  350        function _addLog($user_id, $object_id, $logtext, $question_id = 
"", $original_id = 
"", $test_only = FALSE, $test_ref_id = NULL)
 
  353                if (strlen($question_id) == 0) $question_id = NULL;
 
  354                if (strlen($original_id) == 0) $original_id = NULL;
 
  355                if (strlen($test_ref_id) == 0) $test_ref_id = NULL;
 
  356                $only = ($test_only == TRUE) ? 1 : 0;
 
  357                $next_id = 
$ilDB->nextId(
'ass_log');
 
  358                $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)",
 
  359                        array(
'integer', 
'integer', 
'integer', 
'text', 
'integer', 
'integer', 
'text', 
'integer', 
'integer'),
 
  382        function &
getLog($ts_from, $ts_to, $test_id, $test_only = FALSE)
 
  387                if ($test_only == TRUE)
 
  389                        $result = 
$ilDB->queryF(
"SELECT * FROM ass_log WHERE obj_fi = %s AND tstamp > %s AND tstamp < %s AND test_only = %s ORDER BY tstamp",
 
  390                                array(
'integer',
'integer',
'integer',
'text'),
 
  401                        $result = 
$ilDB->queryF(
"SELECT * FROM ass_log WHERE obj_fi = %s AND tstamp > %s AND tstamp < %s ORDER BY tstamp",
 
  402                                array(
'integer',
'integer',
'integer'),
 
  412                        if (!array_key_exists(
$row[
"tstamp"], 
$log))
 
  420                $log_array = array();
 
  421                foreach (
$log as $key => $value)
 
  423                        foreach ($value as $index => 
$row)
 
  425                                array_push($log_array, 
$row);
 
  439        function &
_getLog($ts_from, $ts_to, $test_id, $test_only = FALSE)
 
  444                if ($test_only == TRUE)
 
  446                        $result = 
$ilDB->queryF(
"SELECT * FROM ass_log WHERE obj_fi = %s AND tstamp > %s AND tstamp < %s AND test_only = %s ORDER BY tstamp",
 
  447                                array(
'integer', 
'integer', 
'integer', 
'text'),
 
  448                                array($test_id, $ts_from, $ts_to, 1)
 
  453                        $result = 
$ilDB->queryF(
"SELECT * FROM ass_log WHERE obj_fi = %s AND tstamp > %s AND tstamp < %s ORDER BY tstamp",
 
  454                                array(
'integer', 
'integer', 
'integer'),
 
  455                                array($test_id, $ts_from, $ts_to)
 
  460                        if (!array_key_exists(
$row[
"tstamp"], 
$log))
 
  465                        if (array_key_exists(
"ref_id", 
$row))
 
  467                                if (
$row[
"ref_id"] > 0)
 
  473                                                        $type_href = sprintf(
"goto.php?target=tst_%s&client_id=" . CLIENT_ID, 
$row[
"ref_id"]);
 
  476                                                        $type_href = sprintf(
"goto.php?target=cat_%s&client_id=" . CLIENT_ID, 
$row[
"ref_id"]);
 
  481                        $row[
"href"] = $type_href;
 
  486                $log_array = array();
 
  487                foreach (
$log as $key => $value)
 
  489                        foreach ($value as $index => 
$row)
 
  491                                array_push($log_array, 
$row);
 
  506                $result = 
$ilDB->queryF(
"SELECT COUNT(obj_fi) logcount FROM ass_log WHERE obj_fi = %s",
 
  513                        return $row[
"logcount"];
 
  531                $pathelements = array();
 
  540                                array_push($pathelements, 
"<a href=\"./goto.php?target=" . 
$data[
"type"] . 
"_" . 
$data[
"ref_id"] . 
"&client=" . CLIENT_ID . 
"\">" .
 
  544                return implode(
" > ", $pathelements);
 
  557                foreach ($a_array as $object_id)
 
  559                        $affectedRows = 
$ilDB->manipulateF(
"DELETE FROM ass_log WHERE obj_fi = %s",
 
  563                        $this->
_addLog($ilUser->getId(), $object_id, $this->lng->txt(
"assessment_log_deleted"));
 
  575                require_once 
'Modules/TestQuestionPool/classes/class.assQuestion.php';
 
  580                                'enable_tst_page_edit', self::ADDITIONAL_QUESTION_CONTENT_EDITING_MODE_PAGE_OBJECT_DISABLED
 
  583                return $isPageEditorEnabled;
 
  588                return $this->setting->get(
'ass_process_lock_mode', self::ASS_PROC_LOCK_MODE_NONE);
 
  593                $this->setting->set(
'ass_process_lock_mode', $lockMode);
 
  598                return array(self::ASS_PROC_LOCK_MODE_NONE, self::ASS_PROC_LOCK_MODE_FILE, self::ASS_PROC_LOCK_MODE_DB);
 
  603                return $this->setting->get(
 
  604                        'ass_skl_trig_num_answ_barrier', self::DEFAULT_SKL_TRIG_NUM_ANSWERS_BARRIER
 
  610                $this->setting->set(
'ass_skl_trig_num_answ_barrier', $skillTriggeringNumAnswersBarrier);
 
  615                require_once 
'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
 
  616                $scoringAdjustableQuestionTypes = array();
 
  618                foreach($allQuestionTypes as 
$type => $typeData)
 
  624                                $scoringAdjustableQuestionTypes[
$type] = $typeData;
 
  628                return $scoringAdjustableQuestionTypes;
 
Basic GUI class for assessment questions.
& _getQuestionGUI($question_type, $question_id=-1)
Creates a question gui representation and returns the alias to the question gui note: please do not u...
Class ilObjAssessmentFolder.
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.
const ASS_PROC_LOCK_MODE_FILE
_getForbiddenQuestionTypes()
Returns the forbidden questiontypes for ILIAS.
_enableAssessmentLogging($a_enable)
enable assessment logging
getNrOfLogEntries($test_obj_id)
Returns the number of log entries for a given test id.
static isAdditionalQuestionContentEditingModePageObjectEnabled()
returns the fact wether content editing with ilias page editor is enabled for questions or not
& _getLog($ts_from, $ts_to, $test_id, $test_only=FALSE)
Retrieve assessment log datasets from the database.
update()
update object data
setSkillTriggeringNumAnswersBarrier($skillTriggeringNumAnswersBarrier)
getAssessmentProcessLockMode()
_addLog($user_id, $object_id, $logtext, $question_id="", $original_id="", $test_only=FALSE, $test_ref_id=NULL)
Add an assessment log entry.
_setManualScoring($type_ids)
Set the manual scoring settings.
_getLogLanguage()
retrieve the log language for assessment logging
questionSupportsScoringAdjustment(\assQuestionGUI $question_object)
getSkillTriggeringNumAnswersBarrier()
_getManualScoringTypes()
Retrieve the manual scoring settings as type strings.
const ASS_PROC_LOCK_MODE_NONE
& getLog($ts_from, $ts_to, $test_id, $test_only=FALSE)
Retrieve assessment log datasets from the database.
const DEFAULT_SKL_TRIG_NUM_ANSWERS_BARRIER
static setScoringAdjustmentEnabled($active)
_setLogLanguage($a_language)
set the log language
static setScoringAdjustableQuestions($type_ids)
static getScoringAdjustmentEnabled()
setAssessmentProcessLockMode($lockMode)
ilObjAssessmentFolder($a_id=0, $a_call_by_reference=true)
Constructor @access public.
static _mananuallyScoreableQuestionTypesExists()
Returns the fact wether manually scoreable question types exist or not.
const ADDITIONAL_QUESTION_CONTENT_EDITING_MODE_PAGE_OBJECT_ENABLED
static getScoringAdjustableQuestions()
notify($a_event, $a_ref_id, $a_parent_non_rbac_id, $a_node_id, $a_params=0)
notifys an object about an event occured Based on the event happend, each object may decide how it re...
_enabledAssessmentLogging()
check wether assessment logging is enabled or not
static getValidAssessmentProcessLockModes()
const ADDITIONAL_QUESTION_CONTENT_EDITING_MODE_PAGE_OBJECT_DISABLED
fetchScoringAdjustableTypes($allQuestionTypes)
_setForbiddenQuestionTypes($a_types)
Sets the forbidden questiontypes for ILIAS.
_getManualScoring()
Retrieve the manual scoring settings.
const ASS_PROC_LOCK_MODE_DB
Class ilObject Basic functions for all objects.
getType()
get object type @access public
ilObject($a_id=0, $a_reference=true)
Constructor @access public.
static _lookupType($a_id, $a_reference=false)
lookup object type
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms @access public
Interface ilGuiAnswerScoringAdjustable.
Interface ilGuiQuestionScoringAdjustable.
Interface ilObjAnswerScoringAdjustable.
Interface ilObjQuestionScoringAdjustable.
redirection script todo: (a better solution should control the processing via a xml file)