ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
ilObjAssessmentFolder Class Reference

Class ilObjAssessmentFolder. More...

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

Public Member Functions

 ilObjAssessmentFolder ($a_id=0, $a_call_by_reference=true)
 Constructor public. More...
 
 update ()
 update object data More...
 
 delete ()
 delete object and all related data More...
 
 initDefaultRoles ()
 init default roles settings More...
 
 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 reacts. More...
 
 _enableAssessmentLogging ($a_enable)
 enable assessment logging More...
 
 _setLogLanguage ($a_language)
 set the log language More...
 
 _enabledAssessmentLogging ()
 check wether assessment logging is enabled or not More...
 
 _getForbiddenQuestionTypes ()
 Returns the forbidden questiontypes for ILIAS. More...
 
 _setForbiddenQuestionTypes ($a_types)
 Sets the forbidden questiontypes for ILIAS. More...
 
 _getLogLanguage ()
 retrieve the log language for assessment logging More...
 
 _getManualScoring ()
 Retrieve the manual scoring settings. More...
 
 _getManualScoringTypes ()
 Retrieve the manual scoring settings as type strings. More...
 
 _setManualScoring ($type_ids)
 Set the manual scoring settings. More...
 
 _addLog ($user_id, $object_id, $logtext, $question_id="", $original_id="", $test_only=FALSE, $test_ref_id=NULL)
 Add an assessment log entry. More...
 
getLog ($ts_from, $ts_to, $test_id, $test_only=FALSE)
 Retrieve assessment log datasets from the database. More...
 
_getLog ($ts_from, $ts_to, $test_id, $test_only=FALSE)
 Retrieve assessment log datasets from the database. More...
 
 getNrOfLogEntries ($test_obj_id)
 Returns the number of log entries for a given test id. More...
 
 getFullPath ($ref_id)
 Returns the full path output of an object. More...
 
 deleteLogEntries ($a_array)
 Deletes the log entries for a given array of test object IDs. More...
 
 getAssessmentProcessLockMode ()
 
 setAssessmentProcessLockMode ($lockMode)
 
- Public Member Functions inherited from ilObject
 ilObject ($a_id=0, $a_reference=true)
 Constructor public. More...
 
 withReferences ()
 determines wehter objects are referenced or not (got ref ids or not) More...
 
 read ($a_force_db=false)
 read object data from db into object More...
 
 getId ()
 get object id public More...
 
 setId ($a_id)
 set object id public More...
 
 setRefId ($a_id)
 set reference id public More...
 
 getRefId ()
 get reference id public More...
 
 getType ()
 get object type public More...
 
 setType ($a_type)
 set object type public More...
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 get object title public More...
 
 getUntranslatedTitle ()
 get untranslated object title public More...
 
 setTitle ($a_title)
 set object title More...
 
 getDescription ()
 get object description More...
 
 setDescription ($a_desc)
 set object description More...
 
 getLongDescription ()
 get object long description (stored in object_description) More...
 
 getImportId ()
 get import id More...
 
 setImportId ($a_import_id)
 set import id More...
 
 getOwner ()
 get object owner More...
 
 getOwnerName ()
 
 _lookupOwnerName ($a_owner_id)
 lookup owner name for owner id More...
 
 setOwner ($a_owner)
 set object owner More...
 
 getCreateDate ()
 get create date public More...
 
 getLastUpdateDate ()
 get last update date public More...
 
 getDiskUsage ()
 Gets the disk usage of the object in bytes. More...
 
 setObjDataRecord ($a_record)
 set object_data record (note: this method should only be called from the ilObjectFactory class) More...
 
 create ()
 create More...
 
 update ()
 update object in db More...
 
 MDUpdateListener ($a_element)
 Meta data update listener. More...
 
 createMetaData ()
 create meta data entry More...
 
 updateMetaData ()
 update meta data entry More...
 
 deleteMetaData ()
 delete meta data entry More...
 
 updateOwner ()
 update owner of object in db More...
 
 _getIdForImportId ($a_import_id)
 get current object id for import id (static) More...
 
 _lookupOwner ($a_id)
 lookup object owner More...
 
 _lookupLastUpdate ($a_id, $a_as_string=false)
 lookup last update More...
 
 _getLastUpdateOfObjects ($a_objs)
 Get last update for a set of media objects. More...
 
 _setDeletedDate ($a_ref_id)
 only called in ilTree::saveSubTree More...
 
 _resetDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
 _lookupDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
 _writeTitle ($a_obj_id, $a_title)
 write title to db (static) More...
 
 _writeDescription ($a_obj_id, $a_desc)
 write description to db (static) More...
 
 _writeImportId ($a_obj_id, $a_import_id)
 write import id to db (static) More...
 
 _isInTrash ($a_ref_id)
 checks wether object is in trash More...
 
 _hasUntrashedReference ($a_obj_id)
 checks wether an object has at least one reference that is not in trash More...
 
 _getObjectsDataForType ($a_type, $a_omit_trash=false)
 get all objects of a certain type More...
 
 putInTree ($a_parent_ref)
 maybe this method should be in tree object!? More...
 
 setPermissions ($a_parent_ref)
 set permissions of object More...
 
 createReference ()
 creates reference for object More...
 
 countReferences ()
 count references of object More...
 
 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 If you want to setup default local roles you MUST overwrite this method in derived object classes (see ilObjForum for an example) public More...
 
 createRoleFolder ()
 creates a local role folder More...
 
 applyDidacticTemplate ($a_tpl_id)
 Apply template. More...
 
 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 passed, each object may decide how it reacts. More...
 
 setRegisterMode ($a_bool)
 
 isUserRegistered ($a_user_id=0)
 
 requireRegistration ()
 
 getXMLZip ()
 
 getHTMLDirectory ()
 
 cloneObject ($a_target_id, $a_copy_id=0, $a_omit_tree=false)
 Clone object permissions, put in tree ... More...
 
 appendCopyInfo ($a_target_id, $a_copy_id)
 Prepend Copy info if object with same name exists in that container. More...
 
 cloneDependencies ($a_target_id, $a_copy_id)
 Clone object dependencies. More...
 
 cloneMetaData ($target_obj)
 Copy meta data. More...
 
 _lookupCreationDate ($a_id)
 Lookup creation date. More...
 

Static Public Member Functions

static _mananuallyScoreableQuestionTypesExists ()
 Returns the fact wether manually scoreable question types exist or not. More...
 
static getScoringAdjustableQuestions ()
 
static setScoringAdjustableQuestions ($type_ids)
 
static getScoringAdjustmentEnabled ()
 
static setScoringAdjustmentEnabled ($active)
 
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 ($a_import_id)
 
static _getAllReferences ($a_id)
 get all reference ids of object More...
 
static _lookupTitle ($a_id)
 lookup object title More...
 
static _getIdsForTitle ($title, $type='', $partialmatch=false)
 
static _lookupDescription ($a_id)
 lookup object description More...
 
static _lookupObjId ($a_id)
 
static setDeletedDates ($a_ref_ids)
 Set deleted date type $ilDB. More...
 
static _lookupType ($a_id, $a_reference=false)
 lookup object type More...
 
static _lookupObjectId ($a_ref_id)
 lookup object id More...
 
static _exists ($a_id, $a_reference=false, $a_type=null)
 checks if an object exists in object_data More...
 
static _getObjectsByType ($a_obj_type="", $a_owner="")
 Get objects by type. More...
 
static _prepareCloneSelection ($a_ref_ids, $new_type, $show_path=true)
 Prepare copy wizard object selection. More...
 
static _getIcon ($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
 Get icon for repository item. More...
 
static collectDeletionDependencies (&$deps, $a_ref_id, $a_obj_id, $a_type, $a_depth=0)
 Collect deletion dependencies. More...
 
static getDeletionDependencies ($a_obj_id)
 Get deletion dependencies. More...
 
static getLongDescriptions (array $a_obj_ids)
 Get long description data. More...
 
static getAllOwnedRepositoryObjects ($a_user_id)
 Get all ids of objects user owns. More...
 
static hasAutoRating ($a_type, $a_ref_id)
 Check if auto rating is active for parent group/course. More...
 

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'
 
 $setting
 
- Data Fields inherited from ilObject
const TITLE_LENGTH = 255
 max length of object title More...
 
const DESC_LENGTH = 128
 
 $ilias
 
 $lng
 
 $id
 
 $ref_id
 
 $type
 
 $title
 
 $untranslatedTitle
 
 $desc
 
 $long_desc
 
 $owner
 
 $create_date
 
 $last_update
 
 $import_id
 
 $register = false
 
 $referenced
 
 $objectList
 
 $max_title
 
 $max_desc
 
 $add_dots
 
 $obj_data_record
 object_data record More...
 

Detailed Description

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
Version
$Id$

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

Member Function Documentation

◆ _addLog()

ilObjAssessmentFolder::_addLog (   $user_id,
  $object_id,
  $logtext,
  $question_id = "",
  $original_id = "",
  $test_only = FALSE,
  $test_ref_id = NULL 
)

Add an assessment log entry.

Parameters
integer$user_idThe user id of the acting user
integer$object_idThe database id of the modified test object
string$logtextThe textual description for the log entry
integer$question_idThe database id of a modified question (optional)
integer$original_idThe database id of the original of a modified question (optional)
Returns
array Array containing the datasets between $ts_from and $ts_to for the test with the id $test_id

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

References $ilUser.

Referenced by assQuestion\_logAction(), ASS_MarkSchema\checkMarks(), deleteLogEntries(), assQuestion\logAction(), and ilObjTest\logAction().

363  {
364  global $ilUser, $ilDB;
365  if (strlen($question_id) == 0) $question_id = NULL;
366  if (strlen($original_id) == 0) $original_id = NULL;
367  if (strlen($test_ref_id) == 0) $test_ref_id = NULL;
368  $only = ($test_only == TRUE) ? 1 : 0;
369  $next_id = $ilDB->nextId('ass_log');
370  $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)",
371  array('integer', 'integer', 'integer', 'text', 'integer', 'integer', 'text', 'integer', 'integer'),
372  array(
373  $next_id,
374  $user_id,
375  $object_id,
376  $logtext,
377  $question_id,
378  $original_id,
379  $only,
380  $test_ref_id,
381  time()
382  )
383  );
384  }
global $ilUser
Definition: imgupload.php:15
+ Here is the caller graph for this function:

◆ _enableAssessmentLogging()

ilObjAssessmentFolder::_enableAssessmentLogging (   $a_enable)

enable assessment logging

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

165  {
166  $setting = new ilSetting("assessment");
167 
168  if ($a_enable)
169  {
170  $setting->set("assessment_logging", 1);
171  }
172  else
173  {
174  $setting->set("assessment_logging", 0);
175  }
176  }
ILIAS Setting Class.

◆ _enabledAssessmentLogging()

ilObjAssessmentFolder::_enabledAssessmentLogging ( )

check wether assessment logging is enabled or not

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

Referenced by assQuestion\_setReachedPoints(), ilObjTest\addExtraTime(), assMultipleChoice\calculateReachedPoints(), assQuestion\calculateResultsFromSolution(), ilObjTest\checkMaximumAllowedUsers(), assNumeric\contains(), ilObjTest\createQuestionGUI(), ilObjTest\getManualFeedback(), ilObjTest\insertQuestion(), assQuestion\instantiateQuestionGUI(), assOrderingHorizontal\moveRight(), ilObjTest\questionMoveDown(), ilObjTest\questionMoveUp(), ilTestEvaluationGUI\redirectToPassDeletionContext(), ilObjTest\removeAllTestEditings(), ilObjTest\removeQuestion(), ilObjTest\removeTestResultsByActiveIds(), ilObjTest\removeTestResultsForUser(), ilSoapTestAdministration\saveQuestion(), ilObjTest\saveQuestionsToDb(), ASS_MarkSchema\saveToDb(), ilObjTest\saveToDb(), assOrderingHorizontal\saveWorkingData(), assErrorText\saveWorkingData(), assFileUpload\saveWorkingData(), assTextSubset\saveWorkingData(), assSingleChoice\saveWorkingData(), assTextQuestion\saveWorkingData(), assImagemapQuestion\saveWorkingData(), assOrderingQuestion\saveWorkingData(), assFormulaQuestion\saveWorkingData(), assMatchingQuestion\saveWorkingData(), assClozeTest\saveWorkingData(), and assErrorText\toggleSelection().

192  {
193  $setting = new ilSetting("assessment");
194 
195  return (boolean) $setting->get("assessment_logging");
196  }
ILIAS Setting Class.
+ Here is the caller graph for this function:

◆ _getForbiddenQuestionTypes()

ilObjAssessmentFolder::_getForbiddenQuestionTypes ( )

Returns the forbidden questiontypes for ILIAS.

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

References $result.

Referenced by ilObjQuestionPool\_getQuestionTypes().

202  {
203  $setting = new ilSetting("assessment");
204  $types = $setting->get("forbidden_questiontypes");
205  $result = array();
206  if (strlen(trim($types)) == 0)
207  {
208  $result = array();
209  }
210  else
211  {
212  $result = unserialize($types);
213  }
214  return $result;
215  }
ILIAS Setting Class.
$result
+ Here is the caller graph for this function:

◆ _getLog()

& ilObjAssessmentFolder::_getLog (   $ts_from,
  $ts_to,
  $test_id,
  $test_only = FALSE 
)

Retrieve assessment log datasets from the database.

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

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

References $log, $result, $row, ilObject\$type, and ilObject\_lookupType().

Referenced by ilObjTestGUI\historyObject().

452  {
453  global $ilDB;
454 
455  $log = array();
456  if ($test_only == TRUE)
457  {
458  $result = $ilDB->queryF("SELECT * FROM ass_log WHERE obj_fi = %s AND tstamp > %s AND tstamp < %s AND test_only = %s ORDER BY tstamp",
459  array('integer', 'integer', 'integer', 'text'),
460  array($test_id, $ts_from, $ts_to, 1)
461  );
462  }
463  else
464  {
465  $result = $ilDB->queryF("SELECT * FROM ass_log WHERE obj_fi = %s AND tstamp > %s AND tstamp < %s ORDER BY tstamp",
466  array('integer', 'integer', 'integer'),
467  array($test_id, $ts_from, $ts_to)
468  );
469  }
470  while ($row = $ilDB->fetchAssoc($result))
471  {
472  if (!array_key_exists($row["tstamp"], $log))
473  {
474  $log[$row["tstamp"]] = array();
475  }
476  $type_href = "";
477  if (array_key_exists("ref_id", $row))
478  {
479  if ($row["ref_id"] > 0)
480  {
481  $type = ilObject::_lookupType($row['ref_id'], true);
482  switch ($type)
483  {
484  case "tst":
485  $type_href = sprintf("goto.php?target=tst_%s&amp;client_id=" . CLIENT_ID, $row["ref_id"]);
486  break;
487  case "cat":
488  $type_href = sprintf("goto.php?target=cat_%s&amp;client_id=" . CLIENT_ID, $row["ref_id"]);
489  break;
490  }
491  }
492  }
493  $row["href"] = $type_href;
494  array_push($log[$row["tstamp"]], $row);
495  }
496  krsort($log);
497  // flatten array
498  $log_array = array();
499  foreach ($log as $key => $value)
500  {
501  foreach ($value as $index => $row)
502  {
503  array_push($log_array, $row);
504  }
505  }
506  return $log_array;
507  }
$result
static _lookupType($a_id, $a_reference=false)
lookup object type
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getLogLanguage()

ilObjAssessmentFolder::_getLogLanguage ( )

retrieve the log language for assessment logging

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

References $lang.

Referenced by assQuestion\_setReachedPoints(), ilObjTest\addExtraTime(), assMultipleChoice\calculateReachedPoints(), assQuestion\calculateResultsFromSolution(), ilObjTest\checkMaximumAllowedUsers(), assNumeric\contains(), ilObjTest\getManualFeedback(), ilObjTest\insertQuestion(), assOrderingHorizontal\moveRight(), ilObjTest\questionMoveDown(), ilObjTest\questionMoveUp(), ilTestEvaluationGUI\redirectToPassDeletionContext(), ilObjTest\removeAllTestEditings(), ilObjTest\removeQuestion(), ilObjTest\removeTestResultsByActiveIds(), ilObjTest\removeTestResultsForUser(), ilObjTest\saveQuestionsToDb(), ASS_MarkSchema\saveToDb(), ilObjTest\saveToDb(), assOrderingHorizontal\saveWorkingData(), assErrorText\saveWorkingData(), assFileUpload\saveWorkingData(), assTextSubset\saveWorkingData(), assSingleChoice\saveWorkingData(), assTextQuestion\saveWorkingData(), assImagemapQuestion\saveWorkingData(), assOrderingQuestion\saveWorkingData(), assFormulaQuestion\saveWorkingData(), assMatchingQuestion\saveWorkingData(), assClozeTest\saveWorkingData(), and assErrorText\toggleSelection().

237  {
238  $setting = new ilSetting("assessment");
239 
240  $lang = $setting->get("assessment_log_language");
241  if (strlen($lang) == 0)
242  {
243  $lang = "en";
244  }
245  return $lang;
246  }
ILIAS Setting Class.
+ Here is the caller graph for this function:

◆ _getManualScoring()

ilObjAssessmentFolder::_getManualScoring ( )

Retrieve the manual scoring settings.

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

Referenced by ilTestScoringByQuestionsGUI\__construct(), ilTestService\getManScoringQuestionGuiList(), ilTestServiceGUI\getPassListOfAnswersWithScoring(), ilObjTestGUI\getTabs(), ilObjTest\getTestParticipantsForManualScoring(), and ilTestManScoringParticipantsBySelectedQuestionAndPassTableGUI\initFilter().

271  {
272  $setting = new ilSetting("assessment");
273 
274  $types = $setting->get("assessment_manual_scoring");
275  return explode(",", $types);
276  }
ILIAS Setting Class.
+ Here is the caller graph for this function:

◆ _getManualScoringTypes()

ilObjAssessmentFolder::_getManualScoringTypes ( )

Retrieve the manual scoring settings as type strings.

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

References $result, and $row.

Referenced by assQuestion\_needsManualScoring().

282  {
283  global $ilDB;
284 
285  $result = $ilDB->query("SELECT * FROM qpl_qst_type");
286  $dbtypes = array();
287  while ($row = $ilDB->fetchAssoc($result))
288  {
289  $dbtypes[$row["question_type_id"]] = $row["type_tag"];
290  }
291  $setting = new ilSetting("assessment");
292  $types = $setting->get("assessment_manual_scoring");
293  $ids = explode(",", $types);
294  foreach ($ids as $key => $value)
295  {
296  $ids[$key] = $dbtypes[$value];
297  }
298  return $ids;
299  }
ILIAS Setting Class.
$result
+ Here is the caller graph for this function:

◆ _mananuallyScoreableQuestionTypesExists()

static ilObjAssessmentFolder::_mananuallyScoreableQuestionTypesExists ( )
static

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

public

Returns
boolean $mananuallyScoreableQuestionTypesExists

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

Referenced by ilTestScoringByQuestionsGUI\__construct(), and ilTestScoringGUI\executeCommand().

258  {
259  if( count(self::_getManualScoring()) > 0 )
260  {
261  return true;
262  }
263 
264  return false;
265  }
+ Here is the caller graph for this function:

◆ _setForbiddenQuestionTypes()

ilObjAssessmentFolder::_setForbiddenQuestionTypes (   $a_types)

Sets the forbidden questiontypes for ILIAS.

Parameters
array$a_typesAn array containing the database ID's of the forbidden question types

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

223  {
224  $setting = new ilSetting("assessment");
225  $types = "";
226  if (is_array($a_types) && (count($a_types) > 0))
227  {
228  $types = serialize($a_types);
229  }
230  $setting->set("forbidden_questiontypes", $types);
231  }
ILIAS Setting Class.

◆ _setLogLanguage()

ilObjAssessmentFolder::_setLogLanguage (   $a_language)

set the log language

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

182  {
183  $setting = new ilSetting("assessment");
184 
185  $setting->set("assessment_log_language", $a_language);
186  }
ILIAS Setting Class.

◆ _setManualScoring()

ilObjAssessmentFolder::_setManualScoring (   $type_ids)

Set the manual scoring settings.

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

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

307  {
308  $setting = new ilSetting("assessment");
309  if ((!is_array($type_ids)) || (count($type_ids) == 0))
310  {
311  $setting->delete("assessment_manual_scoring");
312  }
313  else
314  {
315  $setting->set("assessment_manual_scoring", implode($type_ids, ","));
316  }
317  }
ILIAS Setting Class.

◆ delete()

ilObjAssessmentFolder::delete ( )

delete object and all related data

public

Returns
boolean true if all object data were removed; false if only a references were removed

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

68  {
69  // always call parent delete function first!!
70  if (!parent::delete())
71  {
72  return false;
73  }
74 
75  //put here your module specific stuff
76 
77  return true;
78  }

◆ deleteLogEntries()

ilObjAssessmentFolder::deleteLogEntries (   $a_array)

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

Parameters
array$a_arrayAn array containing the object IDs of the tests

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

References $ilUser, and _addLog().

565  {
566  global $ilDB;
567  global $ilUser;
568 
569  foreach ($a_array as $object_id)
570  {
571  $affectedRows = $ilDB->manipulateF("DELETE FROM ass_log WHERE obj_fi = %s",
572  array('integer'),
573  array($object_id)
574  );
575  $this->_addLog($ilUser->getId(), $object_id, $this->lng->txt("assessment_log_deleted"));
576  }
577  }
_addLog($user_id, $object_id, $logtext, $question_id="", $original_id="", $test_only=FALSE, $test_ref_id=NULL)
Add an assessment log entry.
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:

◆ getAssessmentProcessLockMode()

ilObjAssessmentFolder::getAssessmentProcessLockMode ( )

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

599  {
600  return $this->setting->get('ass_process_lock_mode', self::ASS_PROC_LOCK_MODE_NONE);
601  }

◆ getFullPath()

ilObjAssessmentFolder::getFullPath (   $ref_id)

Returns the full path output of an object.

Parameters
integer$ref_idThe reference id of the object
Returns
string The full path with hyperlinks to the path elements

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

References $data, ilObject\$id, $path, ilObject\$ref_id, and ilUtil\prepareFormOutput().

540  {
541  global $tree;
542  $path = $tree->getPathFull($ref_id);
543  $pathelements = array();
544  foreach ($path as $id => $data)
545  {
546  if ($id == 0)
547  {
548  array_push($pathelements, ilUtil::prepareFormOutput($this->lng->txt("repository")));
549  }
550  else
551  {
552  array_push($pathelements, "<a href=\"./goto.php?target=" . $data["type"] . "_" . $data["ref_id"] . "&amp;client=" . CLIENT_ID . "\">" .
553  ilUtil::prepareFormOutput($data["title"]) . "</a>");
554  }
555  }
556  return implode("&nbsp;&gt;&nbsp;", $pathelements);
557  }
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
while($lm_rec=$ilDB->fetchAssoc($lm_set)) $data
$path
Definition: index.php:22
+ Here is the call graph for this function:

◆ getLog()

& ilObjAssessmentFolder::getLog (   $ts_from,
  $ts_to,
  $test_id,
  $test_only = FALSE 
)

Retrieve assessment log datasets from the database.

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

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

References $log, $result, and $row.

395  {
396  global $ilDB;
397 
398  $log = array();
399  if ($test_only == TRUE)
400  {
401  $result = $ilDB->queryF("SELECT * FROM ass_log WHERE obj_fi = %s AND tstamp > %s AND tstamp < %s AND test_only = %s ORDER BY tstamp",
402  array('integer','integer','integer','text'),
403  array(
404  $test_id,
405  $ts_from,
406  $ts_to,
407  1
408  )
409  );
410  }
411  else
412  {
413  $result = $ilDB->queryF("SELECT * FROM ass_log WHERE obj_fi = %s AND tstamp > %s AND tstamp < %s ORDER BY tstamp",
414  array('integer','integer','integer'),
415  array(
416  $test_id,
417  $ts_from,
418  $ts_to
419  )
420  );
421  }
422  while ($row = $ilDB->fetchAssoc($result))
423  {
424  if (!array_key_exists($row["tstamp"], $log))
425  {
426  $log[$row["tstamp"]] = array();
427  }
428  array_push($log[$row["tstamp"]], $row);
429  }
430  krsort($log);
431  // flatten array
432  $log_array = array();
433  foreach ($log as $key => $value)
434  {
435  foreach ($value as $index => $row)
436  {
437  array_push($log_array, $row);
438  }
439  }
440  return $log_array;
441  }
$result

◆ getNrOfLogEntries()

ilObjAssessmentFolder::getNrOfLogEntries (   $test_obj_id)

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

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

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

References $result, and $row.

516  {
517  global $ilDB;
518  $result = $ilDB->queryF("SELECT COUNT(obj_fi) logcount FROM ass_log WHERE obj_fi = %s",
519  array('integer'),
520  array($test_obj_id)
521  );
522  if ($result->numRows())
523  {
524  $row = $ilDB->fetchAssoc($result);
525  return $row["logcount"];
526  }
527  else
528  {
529  return 0;
530  }
531  }
$result

◆ getScoringAdjustableQuestions()

static ilObjAssessmentFolder::getScoringAdjustableQuestions ( )
static

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

320  {
321  $setting = new ilSetting("assessment");
322 
323  $types = $setting->get("assessment_scoring_adjustment");
324  return explode(",", $types);
325  }
ILIAS Setting Class.

◆ getScoringAdjustmentEnabled()

static ilObjAssessmentFolder::getScoringAdjustmentEnabled ( )
static

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

341  {
342  $setting = new ilSetting("assessment");
343  return $setting->get('assessment_adjustments_enabled');
344  }
ILIAS Setting Class.

◆ getValidAssessmentProcessLockModes()

static ilObjAssessmentFolder::getValidAssessmentProcessLockModes ( )
static

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

Referenced by ilObjAssessmentFolderGUI\saveSettingsObject().

609  {
610  return array(self::ASS_PROC_LOCK_MODE_NONE, self::ASS_PROC_LOCK_MODE_FILE, self::ASS_PROC_LOCK_MODE_DB);
611  }
+ Here is the caller graph for this function:

◆ ilObjAssessmentFolder()

ilObjAssessmentFolder::ilObjAssessmentFolder (   $a_id = 0,
  $a_call_by_reference = true 
)

Constructor public.

Parameters
integerreference_id or object_id
booleantreat the id as reference_id (true) or object_id (false)

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

References ilObject\ilObject().

35  {
36  include_once "./Services/Administration/classes/class.ilSetting.php";
37  $this->setting = new ilSetting("assessment");
38  $this->type = "assf";
39  $this->ilObject($a_id,$a_call_by_reference);
40  }
ILIAS Setting Class.
ilObject($a_id=0, $a_reference=true)
Constructor public.
+ Here is the call graph for this function:

◆ initDefaultRoles()

ilObjAssessmentFolder::initDefaultRoles ( )

init default roles settings

If your module does not require any default roles, delete this method (For an example how this method is used, look at ilObjForum)

public

Returns
array object IDs of created local roles.

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

90  {
91  global $rbacadmin;
92  return array();
93  }

◆ isAdditionalQuestionContentEditingModePageObjectEnabled()

static ilObjAssessmentFolder::isAdditionalQuestionContentEditingModePageObjectEnabled ( )
static

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

ilSetting $ilSetting

Returns
bool $isPageEditorEnabled

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

References $ilSetting.

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

586  {
587  require_once 'Modules/TestQuestionPool/classes/class.assQuestion.php';
588 
589  global $ilSetting;
590 
591  $isPageEditorEnabled = $ilSetting->get(
592  'enable_tst_page_edit', self::ADDITIONAL_QUESTION_CONTENT_EDITING_MODE_PAGE_OBJECT_DISABLED
593  );
594 
595  return $isPageEditorEnabled;
596  }
global $ilSetting
Definition: privfeed.php:40
+ Here is the caller graph for this function:

◆ notify()

ilObjAssessmentFolder::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 reacts.

If you are not required to handle any events related to your module, just delete this method. (For an example how this method is used, look at ilObjGroup)

public

Parameters
stringevent
integerreference id of object where the event occured
arraypasses optional parameters if required
Returns
boolean

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

References $_GET, and ilObject\getType().

109  {
110  global $tree;
111 
112  switch ($a_event)
113  {
114  case "link":
115 
116  //var_dump("<pre>",$a_params,"</pre>");
117  //echo "Module name ".$this->getRefId()." triggered by link event. Objects linked into target object ref_id: ".$a_ref_id;
118  //exit;
119  break;
120 
121  case "cut":
122 
123  //echo "Module name ".$this->getRefId()." triggered by cut event. Objects are removed from target object ref_id: ".$a_ref_id;
124  //exit;
125  break;
126 
127  case "copy":
128 
129  //var_dump("<pre>",$a_params,"</pre>");
130  //echo "Module name ".$this->getRefId()." triggered by copy event. Objects are copied into target object ref_id: ".$a_ref_id;
131  //exit;
132  break;
133 
134  case "paste":
135 
136  //echo "Module name ".$this->getRefId()." triggered by paste (cut) event. Objects are pasted into target object ref_id: ".$a_ref_id;
137  //exit;
138  break;
139 
140  case "new":
141 
142  //echo "Module name ".$this->getRefId()." triggered by paste (new) event. Objects are applied to target object ref_id: ".$a_ref_id;
143  //exit;
144  break;
145  }
146 
147  // At the beginning of the recursive process it avoids second call of the notify function with the same parameter
148  if ($a_node_id==$_GET["ref_id"])
149  {
150  $parent_obj =& $this->ilias->obj_factory->getInstanceByRefId($a_node_id);
151  $parent_type = $parent_obj->getType();
152  if($parent_type == $this->getType())
153  {
154  $a_node_id = (int) $tree->getParentId($a_node_id);
155  }
156  }
157 
158  parent::notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params);
159  }
$_GET["client_id"]
redirection script todo: (a better solution should control the processing via a xml file) ...
getType()
get object type public
+ Here is the call graph for this function:

◆ setAssessmentProcessLockMode()

ilObjAssessmentFolder::setAssessmentProcessLockMode (   $lockMode)

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

604  {
605  $this->setting->set('ass_process_lock_mode', $lockMode);
606  }

◆ setScoringAdjustableQuestions()

static ilObjAssessmentFolder::setScoringAdjustableQuestions (   $type_ids)
static

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

328  {
329  $setting = new ilSetting("assessment");
330  if ((!is_array($type_ids)) || (count($type_ids) == 0))
331  {
332  $setting->delete("assessment_scoring_adjustment");
333  }
334  else
335  {
336  $setting->set("assessment_scoring_adjustment", implode($type_ids, ","));
337  }
338  }
ILIAS Setting Class.

◆ setScoringAdjustmentEnabled()

static ilObjAssessmentFolder::setScoringAdjustmentEnabled (   $active)
static

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

347  {
348  $setting = new ilSetting('assessment');
349  $setting->set('assessment_adjustments_enabled', (bool) $active);
350  }
ILIAS Setting Class.

◆ update()

ilObjAssessmentFolder::update ( )

update object data

public

Returns
boolean

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

49  {
50  if (!parent::update())
51  {
52  return false;
53  }
54 
55  // put here object specific stuff
56 
57  return true;
58  }

Field Documentation

◆ $setting

ilObjAssessmentFolder::$setting

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

◆ 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 20 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


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