4require_once 
"./Services/Object/classes/class.ilObject.php";
 
    5require_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");
 
   53        if (!parent::update()) {
 
   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);
 
  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)
 
  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)
 
  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)) {
 
  347                $log[$row[
"tstamp"]] = array();
 
  349            array_push(
$log[$row[
"tstamp"]], $row);
 
  353        $log_array = array();
 
  354        foreach (
$log as $key => $value) {
 
  355            foreach ($value as 
$index => $row) {
 
  356                array_push($log_array, $row);
 
  370    public static function _getLog($ts_from, $ts_to, $test_id, $test_only = 
false)
 
  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)) {
 
  391                $log[$row[
"tstamp"]] = array();
 
  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();
 
  413        foreach (
$log as $key => $value) {
 
  414            foreach ($value as 
$index => $row) {
 
  415                array_push($log_array, $row);
 
  432            "SELECT COUNT(obj_fi) logcount FROM ass_log WHERE obj_fi = %s",
 
  438            return $row[
"logcount"];
 
  455        $pathelements = array();
 
  460                array_push($pathelements, 
"<a href=\"./goto.php?target=" . 
$data[
"type"] . 
"_" . 
$data[
"ref_id"] . 
"&client=" . 
CLIENT_ID . 
"\">" .
 
  464        return implode(
" > ", $pathelements);
 
  478        foreach ($a_array as $object_id) {
 
  479            $affectedRows = 
$ilDB->manipulateF(
 
  480                "DELETE FROM ass_log WHERE obj_fi = %s",
 
  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;
 
An exception for terminatinating execution or to throw for unit testing.
Basic GUI class for assessment questions.
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...
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
_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
update()
update object data
setSkillTriggeringNumAnswersBarrier($skillTriggeringNumAnswersBarrier)
getAssessmentProcessLockMode()
_setManualScoring($type_ids)
Set the manual scoring settings.
questionSupportsScoringAdjustment(\assQuestionGUI $question_object)
static _addLog($user_id, $object_id, $logtext, $question_id="", $original_id="", $test_only=false, $test_ref_id=null)
Add an assessment log entry.
static _getLogLanguage()
retrieve the log language for assessment logging
getSkillTriggeringNumAnswersBarrier()
static _getManualScoring()
Retrieve the manual scoring settings.
const ASS_PROC_LOCK_MODE_NONE
static 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)
const SETTINGS_KEY_SKL_TRIG_NUM_ANSWERS_BARRIER
static _mananuallyScoreableQuestionTypesExists()
Returns the fact wether manually scoreable question types exist or not.
const ADDITIONAL_QUESTION_CONTENT_EDITING_MODE_PAGE_OBJECT_ENABLED
static getScoringAdjustableQuestions()
static getSkillTriggerAnswerNumberBarrier()
static _getForbiddenQuestionTypes()
Returns the forbidden questiontypes for ILIAS.
getExportEssayQuestionsWithHtml()
setExportEssayQuestionsWithHtml($value)
static _getManualScoringTypes()
Retrieve the manual scoring settings as type strings.
static getValidAssessmentProcessLockModes()
static _enabledAssessmentLogging()
check wether assessment logging is enabled or not
static _getLog($ts_from, $ts_to, $test_id, $test_only=false)
Retrieve assessment log datasets from the database.
const ADDITIONAL_QUESTION_CONTENT_EDITING_MODE_PAGE_OBJECT_DISABLED
fetchScoringAdjustableTypes($allQuestionTypes)
__construct($a_id=0, $a_call_by_reference=true)
Constructor @access public.
_setForbiddenQuestionTypes($a_types)
Sets the forbidden questiontypes for ILIAS.
const ASS_PROC_LOCK_MODE_DB
Class ilObject Basic functions for all objects.
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.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc