ILIAS  release_8 Revision v8.24
ilObjAssessmentFolder Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilObjAssessmentFolder:
+ Collaboration diagram for ilObjAssessmentFolder:

Public Member Functions

 __construct (int $a_id=0, bool $a_call_by_reference=true)
 
 _enableAssessmentLogging (bool $a_enable)
 
 _setLogLanguage (string $a_language)
 
 _setForbiddenQuestionTypes (array $typeIds)
 Sets the forbidden questiontypes for ILIAS. More...
 
 _setManualScoring (array $type_ids)
 Set the manual scoring settings. More...
 
 getNrOfLogEntries (int $test_obj_id)
 Returns the number of log entries for a given test id. More...
 
 deleteLogEntries (array $a_array)
 Deletes the log entries for a given array of test object IDs. More...
 
 getAssessmentProcessLockMode ()
 
 setAssessmentProcessLockMode (string $lockMode)
 
 getSkillTriggeringNumAnswersBarrier ()
 
 setSkillTriggeringNumAnswersBarrier (int $skillTriggeringNumAnswersBarrier)
 
 setExportEssayQuestionsWithHtml (bool $value)
 
 getExportEssayQuestionsWithHtml ()
 
 fetchScoringAdjustableTypes (array $allQuestionTypes)
 
- Public Member Functions inherited from ilObject
 __construct (int $id=0, bool $reference=true)
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 processAutoRating ()
 
 read ()
 
 getId ()
 
 setId (int $id)
 
 setRefId (int $ref_id)
 
 getRefId ()
 
 getType ()
 
 setType (string $type)
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 
 getUntranslatedTitle ()
 Get untranslated object title WebDAV needs to access the untranslated title of an object. More...
 
 setTitle (string $title)
 
 getDescription ()
 
 setDescription (string $desc)
 
 getLongDescription ()
 get object long description (stored in object_description) More...
 
 getImportId ()
 
 setImportId (string $import_id)
 
 setOfflineStatus (bool $status)
 
 getOfflineStatus ()
 
 supportsOfflineHandling ()
 
 getOwner ()
 
 getOwnerName ()
 get full name of object owner More...
 
 setOwner (int $usr_id)
 
 getCreateDate ()
 Get create date in YYYY-MM-DD HH-MM-SS format. More...
 
 getLastUpdateDate ()
 Get last update date in YYYY-MM-DD HH-MM-SS format. More...
 
 create ()
 note: title, description and type should be set when this function is called More...
 
 update ()
 
 MDUpdateListener (string $element)
 Metadata update listener. More...
 
 createMetaData ()
 
 updateMetaData ()
 
 deleteMetaData ()
 
 updateOwner ()
 update owner of object in db More...
 
 putInTree (int $parent_ref_id)
 maybe this method should be in tree object!? More...
 
 setPermissions (int $parent_ref_id)
 
 setParentRolePermissions (int $parent_ref_id)
 Initialize the permissions of parent roles (local roles of categories, global roles...) This method is overwritten in e.g. More...
 
 createReference ()
 creates reference for object More...
 
 countReferences ()
 
 delete ()
 delete object or referenced object (in the case of a referenced object, object data is only deleted if last reference is deleted) This function removes an object entirely from system!! More...
 
 initDefaultRoles ()
 init default roles settings Purpose of this function is to create a local role folder and local roles, that are needed depending on the object type. More...
 
 applyDidacticTemplate (int $tpl_id)
 
 getXMLZip ()
 
 getHTMLDirectory ()
 
 appendCopyInfo (int $target_id, int $copy_id)
 Prepend Copy info if object with same name exists in that container. More...
 
 cloneDependencies (int $target_id, int $copy_id)
 Clone object dependencies. More...
 
 cloneMetaData (ilObject $target_obj)
 Copy meta data. More...
 
 selfOrParentWithRatingEnabled ()
 
 getPossibleSubObjects (bool $filter=true)
 get all possible sub objects of this type the object can decide which types of sub objects are possible jut in time overwrite if the decision distinguish from standard model More...
 

Static Public Member Functions

static getSkillTriggerAnswerNumberBarrier ()
 
static _enabledAssessmentLogging ()
 
static _getForbiddenQuestionTypes ()
 Returns the forbidden questiontypes for ILIAS. More...
 
static _getLogLanguage ()
 
static _mananuallyScoreableQuestionTypesExists ()
 Returns the fact wether manually scoreable question types exist or not. More...
 
static _getManualScoring ()
 Retrieve the manual scoring settings. More...
 
static _getManualScoringTypes ()
 Retrieve the manual scoring settings as type strings. More...
 
static getScoringAdjustableQuestions ()
 
static setScoringAdjustableQuestions (array $type_ids)
 
static getScoringAdjustmentEnabled ()
 
static setScoringAdjustmentEnabled (bool $active)
 
static _addLog ( $user_id, $object_id, $logtext, $question_id=0, $original_id=0, $test_only=false, $test_ref_id=0)
 Add an assessment log entry. More...
 
static getLog (int $ts_from, int $ts_to, int $test_id, bool $test_only=false)
 Retrieve assessment log datasets from the database. More...
 
static _getLog (int $ts_from, int $ts_to, int $test_id, bool $test_only=false)
 Retrieve assessment log datasets from the database. More...
 
static isAdditionalQuestionContentEditingModePageObjectEnabled ()
 Returns the fact wether content editing with ilias page editor is enabled for questions or not. More...
 
static getValidAssessmentProcessLockModes ()
 
- Static Public Member Functions inherited from ilObject
static _lookupObjIdByImportId (string $import_id)
 Get (latest) object id for an import id. More...
 
static _lookupImportId (int $obj_id)
 
static _lookupOwnerName (int $owner_id)
 Lookup owner name for owner id. More...
 
static _getIdForImportId (string $import_id)
 
static _getAllReferences (int $id)
 get all reference ids for object ID More...
 
static _lookupTitle (int $obj_id)
 
static lookupOfflineStatus (int $obj_id)
 Lookup offline status using objectDataCache. More...
 
static _lookupOwner (int $obj_id)
 Lookup owner user ID for object ID. More...
 
static _getIdsForTitle (string $title, string $type='', bool $partial_match=false)
 
static _lookupDescription (int $obj_id)
 
static _lookupLastUpdate (int $obj_id, bool $formatted=false)
 
static _getLastUpdateOfObjects (array $obj_ids)
 
static _lookupObjId (int $ref_id)
 
static _setDeletedDate (int $ref_id, int $deleted_by)
 
static setDeletedDates (array $ref_ids, int $user_id)
 
static _resetDeletedDate (int $ref_id)
 
static _lookupDeletedDate (int $ref_id)
 
static _writeTitle (int $obj_id, string $title)
 write title to db (static) More...
 
static _writeDescription (int $obj_id, string $desc)
 write description to db (static) More...
 
static _writeImportId (int $obj_id, string $import_id)
 write import id to db (static) More...
 
static _lookupType (int $id, bool $reference=false)
 
static _isInTrash (int $ref_id)
 
static _hasUntrashedReference (int $obj_id)
 checks whether an object has at least one reference that is not in trash More...
 
static _lookupObjectId (int $ref_id)
 
static _getObjectsDataForType (string $type, bool $omit_trash=false)
 get all objects of a certain type More...
 
static _exists (int $id, bool $reference=false, ?string $type=null)
 checks if an object exists in object_data More...
 
static _getObjectsByType (string $obj_type="", int $owner=null)
 
static _prepareCloneSelection (array $ref_ids, string $new_type, bool $show_path=true)
 Prepare copy wizard object selection. More...
 
static _getIcon (int $obj_id=0, string $size="big", string $type="", bool $offline=false)
 Get icon for repository item. More...
 
static collectDeletionDependencies (array &$deps, int $ref_id, int $obj_id, string $type, int $depth=0)
 Collect deletion dependencies. More...
 
static getDeletionDependencies (int $obj_id)
 Get deletion dependencies. More...
 
static getLongDescriptions (array $obj_ids)
 
static getAllOwnedRepositoryObjects (int $user_id)
 
static fixMissingTitles ($type, array &$obj_title_map)
 Try to fix missing object titles. More...
 
static _lookupCreationDate (int $obj_id)
 
static _getObjectTypeIdByTitle (string $type, \ilDBInterface $ilDB=null)
 

Data Fields

const ADDITIONAL_QUESTION_CONTENT_EDITING_MODE_PAGE_OBJECT_DISABLED = 0
 
const ADDITIONAL_QUESTION_CONTENT_EDITING_MODE_PAGE_OBJECT_ENABLED = 1
 
const ASS_PROC_LOCK_MODE_NONE = 'none'
 
const ASS_PROC_LOCK_MODE_FILE = 'file'
 
const ASS_PROC_LOCK_MODE_DB = 'db'
 
const DEFAULT_SKL_TRIG_NUM_ANSWERS_BARRIER = 1
 
ilSetting $setting
 
- Data Fields inherited from ilObject
const TITLE_LENGTH = 255
 
const DESC_LENGTH = 128
 
const LONG_DESC_LENGTH = 4000
 
const TABLE_OBJECT_DATA = "object_data"
 
array $objectList
 
string $untranslatedTitle
 

Private Member Functions

 questionSupportsScoringAdjustment (assQuestionGUI $question_object)
 

Private Attributes

const SETTINGS_KEY_SKL_TRIG_NUM_ANSWERS_BARRIER = 'ass_skl_trig_num_answ_barrier'
 

Additional Inherited Members

- Protected Member Functions inherited from ilObject
 doMDUpdateListener (string $a_element)
 
 beforeMDUpdateListener (string $a_element)
 
 doCreateMetaData ()
 
 beforeCreateMetaData ()
 
 doUpdateMetaData ()
 
 beforeUpdateMetaData ()
 
 doDeleteMetaData ()
 
 beforeDeleteMetaData ()
 
 handleAutoRating ()
 
 hasAutoRating ()
 
- Protected Attributes inherited from ilObject
ilLogger $obj_log
 
ILIAS $ilias
 
ilObjectDefinition $obj_definition
 
ilDBInterface $db
 
ilLogger $log
 
ilErrorHandling $error
 
ilTree $tree
 
ilAppEventHandler $app_event_handler
 
ilRbacAdmin $rbac_admin
 
ilRbacReview $rbac_review
 
ilObjUser $user
 
ilLanguage $lng
 
int $id
 
bool $referenced
 
bool $call_by_reference
 
int $max_title = self::TITLE_LENGTH
 
int $max_desc = self::DESC_LENGTH
 
bool $add_dots = true
 
int $ref_id = null
 
string $type = ""
 
string $title = ""
 
bool $offline = false
 
string $desc = ""
 
string $long_desc = ""
 
int $owner = 0
 
string $create_date = ""
 
string $last_update = ""
 
string $import_id = ""
 
bool $register = false
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class ilObjAssessmentFolder

Author
Helmut Schottmüller hscho.nosp@m.ttm@.nosp@m.gmx.d.nosp@m.e
Björn Heyser bheys.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de

Definition at line 27 of file class.ilObjAssessmentFolder.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjAssessmentFolder::__construct ( int  $id = 0,
bool  $reference = true 
)
Parameters
int$idreference_id or object_id
bool$referencebool treat the id as reference_id (true) or object_id (false)

Reimplemented from ilObject.

Definition at line 41 of file class.ilObjAssessmentFolder.php.

42 {
43 $this->setting = new ilSetting('assessment');
44 $this->type = 'assf';
45 parent::__construct($a_id, $a_call_by_reference);
46 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Member Function Documentation

◆ _addLog()

static ilObjAssessmentFolder::_addLog (   $user_id,
  $object_id,
  $logtext,
  $question_id = 0,
  $original_id = 0,
  $test_only = false,
  $test_ref_id = 0 
)
static

Add an assessment log entry.

Parameters
int$user_idThe user id of the acting user
int$object_idThe database id of the modified test object
string$logtextThe textual description for the log entry
int$question_idThe database id of a modified question (optional)
int$original_idThe database id of the original of a modified question (optional)
bool$test_only
int$test_ref_id

Definition at line 230 of file class.ilObjAssessmentFolder.php.

238 : void {
239 global $DIC;
240 $ilUser = $DIC['ilUser'];
241 $ilDB = $DIC['ilDB'];
242
243 $db_question_id = 0;
244 if (is_numeric($question_id)) {
245 $db_question_id = (int) $question_id;
246 }
247
248 $db_original_id = 0;
249 if (is_numeric($original_id)) {
250 $db_original_id = (int) $original_id;
251 }
252
253 $db_test_ref_id = 0;
254 if (is_numeric($test_ref_id)) {
255 $db_test_ref_id = (int) $test_ref_id;
256 }
257
258 $only = ($test_only === true) ? 1 : 0;
259 $next_id = $ilDB->nextId('ass_log');
260 $affectedRows = $ilDB->manipulateF(
261 "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)",
262 ['integer', 'integer', 'integer', 'text', 'integer', 'integer', 'text', 'integer', 'integer'],
263 [
264 $next_id,
265 $user_id,
266 $object_id,
267 $logtext,
268 $db_question_id,
269 $db_original_id,
270 $only,
271 $db_test_ref_id,
272 time()
273 ]
274 );
275 }
global $DIC
Definition: feed.php:28
$ilUser
Definition: imgupload.php:34

References ILIAS\Repository\int().

Referenced by ilObjTest\logAction(), assQuestion\logAction(), ilTestPasswordChecker\logWrongEnteredPassword(), and ilTestPassFinishTasks\updateLearningProgressAfterPassFinishedIsWritten().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _enableAssessmentLogging()

ilObjAssessmentFolder::_enableAssessmentLogging ( bool  $a_enable)

Definition at line 58 of file class.ilObjAssessmentFolder.php.

58 : void
59 {
60 $setting = new ilSetting('assessment');
61
62 $setting->set('assessment_logging', (string) ((int) $a_enable));
63 }
set(string $a_key, string $a_val)

References $setting, and ilSetting\set().

+ Here is the call graph for this function:

◆ _enabledAssessmentLogging()

static ilObjAssessmentFolder::_enabledAssessmentLogging ( )
static

Definition at line 72 of file class.ilObjAssessmentFolder.php.

72 : bool
73 {
74 $setting = new ilSetting('assessment');
75
76 return (bool) $setting->get('assessment_logging', '0');
77 }
get(string $a_keyword, ?string $a_default_value=null)
get setting

References $setting, and ilSetting\get().

Referenced by assQuestion\_setReachedPoints(), ilObjTest\addExtraTime(), ilTestOutputGUI\adoptUserSolutionsFromPreviousPass(), assQuestion\calculateResultsFromSolution(), ilObjTest\checkMaximumAllowedUsers(), ilObjTest\createQuestionGUI(), ilTestPlayerAbstractGUI\getQuestionInstance(), ilObjTest\insertQuestion(), assQuestion\instantiateQuestionGUI(), assQuestion\log(), ilTestPasswordChecker\logWrongEnteredPassword(), ilObjTest\questionMoveDown(), ilObjTest\questionMoveUp(), ilObjTest\removeQuestion(), ilObjTest\removeTestResultsByActiveIds(), ilSoapTestAdministration\saveQuestion(), ilObjTest\saveQuestionsToDb(), ilObjTest\saveToDb(), ASS_MarkSchema\saveToDb(), assClozeTest\saveWorkingData(), assErrorText\saveWorkingData(), assFileUpload\saveWorkingData(), assFormulaQuestion\saveWorkingData(), assImagemapQuestion\saveWorkingData(), assMatchingQuestion\saveWorkingData(), assOrderingHorizontal\saveWorkingData(), assSingleChoice\saveWorkingData(), assTextQuestion\saveWorkingData(), assTextSubset\saveWorkingData(), assLongMenu\saveWorkingData(), and ilObjAssessmentFolderGUI\showLogSettingsObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getForbiddenQuestionTypes()

static ilObjAssessmentFolder::_getForbiddenQuestionTypes ( )
static

Returns the forbidden questiontypes for ILIAS.

Returns
int[]

Definition at line 83 of file class.ilObjAssessmentFolder.php.

83 : array
84 {
85 $setting = new ilSetting('assessment');
86 $types = $setting->get('forbidden_questiontypes', '');
87 $result = [];
88
89 if ($types === '') {
90 $result = [];
91 } else {
92 $result = unserialize($types, ['allowed_classes' => false]);
93 }
94
95 return array_filter(array_map('intval', $result));
96 }

References $setting, and ilSetting\get().

Referenced by ilObjQuestionPool\_getQuestionTypes().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getLog()

static ilObjAssessmentFolder::_getLog ( int  $ts_from,
int  $ts_to,
int  $test_id,
bool  $test_only = false 
)
static

Retrieve assessment log datasets from the database.

Parameters
int$ts_fromTimestamp of the starting date/time period
int$ts_toTimestamp of the ending date/time period
integer$test_idDatabase id of the ILIAS test object
Returns
array<string, mixed>[] Array containing the datasets between $ts_from and $ts_to for the test with the id $test_id

Definition at line 336 of file class.ilObjAssessmentFolder.php.

336 : array
337 {
338 global $DIC;
339 $ilDB = $DIC['ilDB'];
340
341 $log = [];
342 if ($test_only === true) {
343 $result = $ilDB->queryF(
344 "SELECT * FROM ass_log WHERE obj_fi = %s AND tstamp > %s AND tstamp < %s AND test_only = %s ORDER BY tstamp",
345 ['integer', 'integer', 'integer', 'text'],
346 [$test_id, $ts_from, $ts_to, 1]
347 );
348 } else {
349 $result = $ilDB->queryF(
350 "SELECT * FROM ass_log WHERE obj_fi = %s AND tstamp > %s AND tstamp < %s ORDER BY tstamp",
351 ['integer', 'integer', 'integer'],
352 [$test_id, $ts_from, $ts_to]
353 );
354 }
355 while ($row = $ilDB->fetchAssoc($result)) {
356 if (!array_key_exists($row["tstamp"], $log)) {
357 $log[$row["tstamp"]] = [];
358 }
359 $type_href = "";
360 if (array_key_exists("ref_id", $row) && $row["ref_id"] > 0) {
361 $type = ilObject::_lookupType((int) $row['ref_id'], true);
362 switch ($type) {
363 case "tst":
364 $type_href = sprintf("goto.php?target=tst_%s&amp;client_id=" . CLIENT_ID, $row["ref_id"]);
365 break;
366 case "cat":
367 $type_href = sprintf("goto.php?target=cat_%s&amp;client_id=" . CLIENT_ID, $row["ref_id"]);
368 break;
369 }
370 }
371 $row["href"] = $type_href;
372 $log[$row["tstamp"]][] = $row;
373 }
374 krsort($log);
375 // flatten array
376 $log_array = [];
377 foreach ($log as $key => $value) {
378 foreach ($value as $index => $row) {
379 $log_array[] = $row;
380 }
381 }
382 return $log_array;
383 }
static _lookupType(int $id, bool $reference=false)
ilLogger $log
string $type
const CLIENT_ID
Definition: constants.php:41
$index
Definition: metadata.php:145
string $key
Consumer key/client ID value.
Definition: System.php:193

References $DIC, $ilDB, $index, ILIAS\LTI\ToolProvider\$key, $log, $type, ilObject\_lookupType(), and CLIENT_ID.

Referenced by ilObjTestGUI\historyObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getLogLanguage()

◆ _getManualScoring()

static ilObjAssessmentFolder::_getManualScoring ( )
static

Retrieve the manual scoring settings.

Returns
int[]

Definition at line 139 of file class.ilObjAssessmentFolder.php.

139 : array
140 {
141 $setting = new ilSetting('assessment');
142
143 $types = $setting->get('assessment_manual_scoring', '');
144 return array_filter(array_map('intval', explode(',', $types)));
145 }

References $setting, and ilSetting\get().

Referenced by ilTestService\getManScoringQuestionGuiList(), ilTestServiceGUI\getPassListOfAnswersWithScoring(), ilObjTest\getTestParticipantsForManualScoring(), ilTestManScoringParticipantsBySelectedQuestionAndPassTableGUI\initFilter(), and ilTestTabsManager\setupTabsGuiConfig().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getManualScoringTypes()

static ilObjAssessmentFolder::_getManualScoringTypes ( )
static

Retrieve the manual scoring settings as type strings.

Returns
string[]

Definition at line 151 of file class.ilObjAssessmentFolder.php.

151 : array
152 {
153 global $DIC;
154 $ilDB = $DIC['ilDB'];
155
156 $setting = new ilSetting('assessment');
157 $typeIds = array_filter(array_map('intval', explode(',', $setting->get('assessment_manual_scoring', ''))));
158 $manualScoringTypes = [];
159
160 $result = $ilDB->query('SELECT question_type_id, type_tag FROM qpl_qst_type');
161 while ($row = $ilDB->fetchAssoc($result)) {
162 if (in_array((int) $row['question_type_id'], $typeIds, true)) {
163 $manualScoringTypes[] = $row['type_tag'];
164 }
165 }
166 return array_filter($manualScoringTypes);
167 }

References $DIC, $ilDB, $setting, and ilSetting\get().

Referenced by assQuestion\_needsManualScoring().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _mananuallyScoreableQuestionTypesExists()

static ilObjAssessmentFolder::_mananuallyScoreableQuestionTypesExists ( )
static

Returns the fact wether manually scoreable question types exist or not.

Definition at line 130 of file class.ilObjAssessmentFolder.php.

130 : bool
131 {
132 return count(self::_getManualScoring()) > 0;
133 }

Referenced by ilTestScoringGUI\executeCommand().

+ Here is the caller graph for this function:

◆ _setForbiddenQuestionTypes()

ilObjAssessmentFolder::_setForbiddenQuestionTypes ( array  $typeIds)

Sets the forbidden questiontypes for ILIAS.

Parameters
int[]$typeIdsAn array containing the database ID's of the forbidden question types

Definition at line 102 of file class.ilObjAssessmentFolder.php.

102 : void
103 {
104 $setting = new ilSetting('assessment');
105
106 $types = '';
107 if ($typeIds !== []) {
108 $types = serialize(array_map('intval', $typeIds));
109 }
110
111 $setting->set('forbidden_questiontypes', $types);
112 }

References $setting, and ilSetting\set().

+ Here is the call graph for this function:

◆ _setLogLanguage()

ilObjAssessmentFolder::_setLogLanguage ( string  $a_language)

Definition at line 65 of file class.ilObjAssessmentFolder.php.

65 : void
66 {
67 $setting = new ilSetting('assessment');
68
69 $setting->set('assessment_log_language', $a_language);
70 }

References $setting, and ilSetting\set().

+ Here is the call graph for this function:

◆ _setManualScoring()

ilObjAssessmentFolder::_setManualScoring ( array  $type_ids)

Set the manual scoring settings.

Parameters
int[]$type_idsAn array containing the database ids of the question types which could be scored manually

Definition at line 173 of file class.ilObjAssessmentFolder.php.

173 : void
174 {
175 $setting = new ilSetting('assessment');
176 if ($type_ids === []) {
177 $setting->delete('assessment_manual_scoring');
178 } else {
179 $setting->set('assessment_manual_scoring', implode(',', $type_ids));
180 }
181 }
delete(string $a_keyword)

References $setting, ilSetting\delete(), and ilSetting\set().

+ Here is the call graph for this function:

◆ deleteLogEntries()

ilObjAssessmentFolder::deleteLogEntries ( array  $a_array)

Deletes the log entries for a given array of test object IDs.

Parameters
int[]$a_arrayAn array containing the object IDs of the tests

Definition at line 412 of file class.ilObjAssessmentFolder.php.

412 : void
413 {
414 global $DIC;
415 $ilDB = $DIC->database();
416 $ilUser = $DIC->user();
417
418 foreach ($a_array as $object_id) {
419 $affectedRows = $ilDB->manipulateF(
420 "DELETE FROM ass_log WHERE obj_fi = %s",
421 ['integer'],
422 [$object_id]
423 );
424 self::_addLog($ilUser->getId(), $object_id, $this->lng->txt("assessment_log_deleted"));
425 }
426 }
static _addLog( $user_id, $object_id, $logtext, $question_id=0, $original_id=0, $test_only=false, $test_ref_id=0)
Add an assessment log entry.

References $DIC, $ilDB, and $ilUser.

◆ fetchScoringAdjustableTypes()

ilObjAssessmentFolder::fetchScoringAdjustableTypes ( array  $allQuestionTypes)
Parameters
array<string,array{question_type_idint, type_tag: string, plugin: int, plugin_name: string|null}> $allQuestionTypes
Returns
array<string, array{question_type_id: int, type_tag: string, plugin: int, plugin_name: string|null}>
Exceptions
ilTestQuestionPoolInvalidArgumentException

Definition at line 494 of file class.ilObjAssessmentFolder.php.

494 : array
495 {
496 $scoringAdjustableQuestionTypes = [];
497
498 foreach ($allQuestionTypes as $type => $typeData) {
499 $questionGui = assQuestionGUI::_getQuestionGUI($typeData['type_tag']);
500
501 if ($this->questionSupportsScoringAdjustment($questionGui)) {
502 $scoringAdjustableQuestionTypes[$type] = $typeData;
503 }
504 }
505
506 return $scoringAdjustableQuestionTypes;
507 }
static _getQuestionGUI(string $question_type='', int $question_id=-1)
Creates a question gui representation and returns the alias to the question gui.
questionSupportsScoringAdjustment(assQuestionGUI $question_object)

References $type, and assQuestionGUI\_getQuestionGUI().

+ Here is the call graph for this function:

◆ getAssessmentProcessLockMode()

ilObjAssessmentFolder::getAssessmentProcessLockMode ( )

Definition at line 444 of file class.ilObjAssessmentFolder.php.

444 : string
445 {
446 return $this->setting->get('ass_process_lock_mode', self::ASS_PROC_LOCK_MODE_NONE);
447 }

◆ getExportEssayQuestionsWithHtml()

ilObjAssessmentFolder::getExportEssayQuestionsWithHtml ( )

Definition at line 484 of file class.ilObjAssessmentFolder.php.

484 : bool
485 {
486 return (bool) $this->setting->get('export_essay_qst_with_html', '0');
487 }

◆ getLog()

static ilObjAssessmentFolder::getLog ( int  $ts_from,
int  $ts_to,
int  $test_id,
bool  $test_only = false 
)
static

Retrieve assessment log datasets from the database.

Parameters
int$ts_fromTimestamp of the starting date/time period
int$ts_toTimestamp of the ending date/time period
int$test_idDatabase id of the ILIAS test object
Returns
array<string, mixed>[] Array containing the datasets between $ts_from and $ts_to for the test with the id $test_id

Definition at line 284 of file class.ilObjAssessmentFolder.php.

284 : array
285 {
286 global $DIC;
287 $ilDB = $DIC['ilDB'];
288
289 $log = [];
290 if ($test_only === true) {
291 $result = $ilDB->queryF(
292 "SELECT * FROM ass_log WHERE obj_fi = %s AND tstamp > %s AND tstamp < %s AND test_only = %s ORDER BY tstamp",
293 ['integer', 'integer', 'integer', 'text'],
294 [
295 $test_id,
296 $ts_from,
297 $ts_to,
298 1
299 ]
300 );
301 } else {
302 $result = $ilDB->queryF(
303 "SELECT * FROM ass_log WHERE obj_fi = %s AND tstamp > %s AND tstamp < %s ORDER BY tstamp",
304 ['integer', 'integer', 'integer'],
305 [
306 $test_id,
307 $ts_from,
308 $ts_to
309 ]
310 );
311 }
312 while ($row = $ilDB->fetchAssoc($result)) {
313 if (!array_key_exists($row["tstamp"], $log)) {
314 $log[$row["tstamp"]] = [];
315 }
316 $log[$row["tstamp"]][] = $row;
317 }
318 krsort($log);
319 // flatten array
320 $log_array = [];
321 foreach ($log as $key => $value) {
322 foreach ($value as $index => $row) {
323 $log_array[] = $row;
324 }
325 }
326 return $log_array;
327 }

References $DIC, $ilDB, $index, ILIAS\LTI\ToolProvider\$key, and $log.

Referenced by ilObjAssessmentFolderGUI\exportLogObject().

+ Here is the caller graph for this function:

◆ getNrOfLogEntries()

ilObjAssessmentFolder::getNrOfLogEntries ( int  $test_obj_id)

Returns the number of log entries for a given test id.

Parameters
int$test_obj_idDatabase id of the ILIAS test object
Returns
int The number of log entries for the test object

Definition at line 390 of file class.ilObjAssessmentFolder.php.

390 : int
391 {
392 global $DIC;
393 $ilDB = $DIC->database();
394
395 $result = $ilDB->queryF(
396 "SELECT COUNT(obj_fi) logcount FROM ass_log WHERE obj_fi = %s",
397 ['integer'],
398 [$test_obj_id]
399 );
400 if ($result->numRows()) {
401 $row = $ilDB->fetchAssoc($result);
402 return (int) $row["logcount"];
403 }
404
405 return 0;
406 }

References $DIC, and $ilDB.

◆ getScoringAdjustableQuestions()

static ilObjAssessmentFolder::getScoringAdjustableQuestions ( )
static
Returns
int[]

Definition at line 186 of file class.ilObjAssessmentFolder.php.

186 : array
187 {
188 $setting = new ilSetting('assessment');
189
190 $types = $setting->get('assessment_scoring_adjustment', '');
191 return array_filter(array_map('intval', explode(',', $types)));
192 }

References $setting, and ilSetting\get().

+ Here is the call graph for this function:

◆ getScoringAdjustmentEnabled()

static ilObjAssessmentFolder::getScoringAdjustmentEnabled ( )
static

Definition at line 208 of file class.ilObjAssessmentFolder.php.

208 : bool
209 {
210 $setting = new ilSetting('assessment');
211 return (bool) $setting->get('assessment_adjustments_enabled', '0');
212 }

References $setting, and ilSetting\get().

+ Here is the call graph for this function:

◆ getSkillTriggerAnswerNumberBarrier()

static ilObjAssessmentFolder::getSkillTriggerAnswerNumberBarrier ( )
static

Definition at line 48 of file class.ilObjAssessmentFolder.php.

48 : int
49 {
50 $assSettings = new ilSetting('assessment');
51
52 return (int) $assSettings->get(
53 self::SETTINGS_KEY_SKL_TRIG_NUM_ANSWERS_BARRIER,
54 (string) self::DEFAULT_SKL_TRIG_NUM_ANSWERS_BARRIER
55 );
56 }

Referenced by ilTestInfoScreenToolbarGUI\getSkillAssignBarrierInfo(), and ilAssQuestionSkillAssignmentList\hasSkillsAssignedLowerThanBarrier().

+ Here is the caller graph for this function:

◆ getSkillTriggeringNumAnswersBarrier()

ilObjAssessmentFolder::getSkillTriggeringNumAnswersBarrier ( )

Definition at line 466 of file class.ilObjAssessmentFolder.php.

466 : string
467 {
468 return $this->setting->get(
469 'ass_skl_trig_num_answ_barrier',
470 (string) self::DEFAULT_SKL_TRIG_NUM_ANSWERS_BARRIER
471 );
472 }

◆ getValidAssessmentProcessLockModes()

static ilObjAssessmentFolder::getValidAssessmentProcessLockModes ( )
static
Returns
string[]

Definition at line 457 of file class.ilObjAssessmentFolder.php.

Referenced by ilObjAssessmentFolderGUI\saveSettingsObject().

+ Here is the caller graph for this function:

◆ isAdditionalQuestionContentEditingModePageObjectEnabled()

static ilObjAssessmentFolder::isAdditionalQuestionContentEditingModePageObjectEnabled ( )
static

Returns the fact wether content editing with ilias page editor is enabled for questions or not.

Definition at line 431 of file class.ilObjAssessmentFolder.php.

431 : bool
432 {
433 global $DIC;
434 $ilSetting = $DIC->settings();
435
436 $isPageEditorEnabled = $ilSetting->get(
437 'enable_tst_page_edit',
438 (string) self::ADDITIONAL_QUESTION_CONTENT_EDITING_MODE_PAGE_OBJECT_DISABLED
439 );
440
441 return (bool) $isPageEditorEnabled;
442 }
global $ilSetting
Definition: privfeed.php:17

References $DIC, and $ilSetting.

Referenced by ilTestExpressPageObjectGUI\addQuestion(), ilObjTestGUI\addQuestionObject(), ilObjQuestionPoolGUI\buildCreateQuestionForm(), ilObjQuestionPoolGUI\createQuestionFormObject(), ilObjQuestionPoolGUI\createQuestionForTestObject(), ilObjTestGUI\createQuestionObject(), ilObjQuestionPoolGUI\createQuestionObject(), ilPCQuestionGUI\edit(), ilTestExpressPageObjectGUI\handleToolbarCommand(), and ilPCQuestionGUI\insert().

+ Here is the caller graph for this function:

◆ questionSupportsScoringAdjustment()

ilObjAssessmentFolder::questionSupportsScoringAdjustment ( assQuestionGUI  $question_object)
private

Definition at line 509 of file class.ilObjAssessmentFolder.php.

509 : bool
510 {
511 return (
512 $question_object instanceof ilGuiQuestionScoringAdjustable ||
513 $question_object instanceof ilGuiAnswerScoringAdjustable
514 ) && (
515 $question_object->object instanceof ilObjQuestionScoringAdjustable ||
516 $question_object->object instanceof ilObjAnswerScoringAdjustable
517 );
518 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ setAssessmentProcessLockMode()

ilObjAssessmentFolder::setAssessmentProcessLockMode ( string  $lockMode)

Definition at line 449 of file class.ilObjAssessmentFolder.php.

449 : void
450 {
451 $this->setting->set('ass_process_lock_mode', $lockMode);
452 }

◆ setExportEssayQuestionsWithHtml()

ilObjAssessmentFolder::setExportEssayQuestionsWithHtml ( bool  $value)

Definition at line 479 of file class.ilObjAssessmentFolder.php.

479 : void
480 {
481 $this->setting->set('export_essay_qst_with_html', (string) ((int) $value));
482 }

◆ setScoringAdjustableQuestions()

static ilObjAssessmentFolder::setScoringAdjustableQuestions ( array  $type_ids)
static
Parameters
int[]$type_ids
Returns
void

Definition at line 198 of file class.ilObjAssessmentFolder.php.

198 : void
199 {
200 $setting = new ilSetting('assessment');
201 if ($type_ids === []) {
202 $setting->delete('assessment_scoring_adjustment');
203 } else {
204 $setting->set('assessment_scoring_adjustment', implode(',', $type_ids));
205 }
206 }

References $setting, ilSetting\delete(), and ilSetting\set().

+ Here is the call graph for this function:

◆ setScoringAdjustmentEnabled()

static ilObjAssessmentFolder::setScoringAdjustmentEnabled ( bool  $active)
static

Definition at line 214 of file class.ilObjAssessmentFolder.php.

214 : void
215 {
216 $setting = new ilSetting('assessment');
217 $setting->set('assessment_adjustments_enabled', (string) ((int) $active));
218 }

References $setting, and ilSetting\set().

+ Here is the call graph for this function:

◆ setSkillTriggeringNumAnswersBarrier()

ilObjAssessmentFolder::setSkillTriggeringNumAnswersBarrier ( int  $skillTriggeringNumAnswersBarrier)

Definition at line 474 of file class.ilObjAssessmentFolder.php.

474 : void
475 {
476 $this->setting->set('ass_skl_trig_num_answ_barrier', (string) $skillTriggeringNumAnswersBarrier);
477 }

Field Documentation

◆ $setting

◆ ADDITIONAL_QUESTION_CONTENT_EDITING_MODE_PAGE_OBJECT_DISABLED

const ilObjAssessmentFolder::ADDITIONAL_QUESTION_CONTENT_EDITING_MODE_PAGE_OBJECT_DISABLED = 0

◆ ADDITIONAL_QUESTION_CONTENT_EDITING_MODE_PAGE_OBJECT_ENABLED

const ilObjAssessmentFolder::ADDITIONAL_QUESTION_CONTENT_EDITING_MODE_PAGE_OBJECT_ENABLED = 1

Definition at line 30 of file class.ilObjAssessmentFolder.php.

◆ ASS_PROC_LOCK_MODE_DB

const ilObjAssessmentFolder::ASS_PROC_LOCK_MODE_DB = 'db'

◆ ASS_PROC_LOCK_MODE_FILE

const ilObjAssessmentFolder::ASS_PROC_LOCK_MODE_FILE = 'file'

◆ ASS_PROC_LOCK_MODE_NONE

◆ DEFAULT_SKL_TRIG_NUM_ANSWERS_BARRIER

const ilObjAssessmentFolder::DEFAULT_SKL_TRIG_NUM_ANSWERS_BARRIER = 1

◆ SETTINGS_KEY_SKL_TRIG_NUM_ANSWERS_BARRIER

const ilObjAssessmentFolder::SETTINGS_KEY_SKL_TRIG_NUM_ANSWERS_BARRIER = 'ass_skl_trig_num_answ_barrier'
private

Definition at line 36 of file class.ilObjAssessmentFolder.php.


The documentation for this class was generated from the following file: