ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
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...
 
 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...
 
 setParentRolePermissions ($a_parent_ref)
 Initialize the permissions of parent roles (local roles of categories, global roles...) This method is overwritten in e.g courses, groups for building permission intersections with non_member templates. 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...
 
 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 348 of file class.ilObjAssessmentFolder.php.

References $ilDB, and $ilUser.

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

349  {
350  global $ilUser, $ilDB;
351  if (strlen($question_id) == 0) $question_id = NULL;
352  if (strlen($original_id) == 0) $original_id = NULL;
353  if (strlen($test_ref_id) == 0) $test_ref_id = NULL;
354  $only = ($test_only == TRUE) ? 1 : 0;
355  $next_id = $ilDB->nextId('ass_log');
356  $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)",
357  array('integer', 'integer', 'integer', 'text', 'integer', 'integer', 'text', 'integer', 'integer'),
358  array(
359  $next_id,
360  $user_id,
361  $object_id,
362  $logtext,
363  $question_id,
364  $original_id,
365  $only,
366  $test_ref_id,
367  time()
368  )
369  );
370  }
global $ilUser
Definition: imgupload.php:15
global $ilDB
+ Here is the caller graph for this function:

◆ _enableAssessmentLogging()

ilObjAssessmentFolder::_enableAssessmentLogging (   $a_enable)

enable assessment logging

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

151  {
152  $setting = new ilSetting("assessment");
153 
154  if ($a_enable)
155  {
156  $setting->set("assessment_logging", 1);
157  }
158  else
159  {
160  $setting->set("assessment_logging", 0);
161  }
162  }
ILIAS Setting Class.

◆ _enabledAssessmentLogging()

ilObjAssessmentFolder::_enabledAssessmentLogging ( )

check wether assessment logging is enabled or not

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

Referenced by assQuestion\_setReachedPoints(), ilObjTest\addExtraTime(), assMultipleChoice\calculateReachedPoints(), assQuestion\calculateResultsFromSolution(), ilObjTest\checkMaximumAllowedUsers(), ilObjTest\createQuestionGUI(), ilObjTest\getManualFeedback(), ilObjTest\insertQuestion(), assQuestion\instantiateQuestionGUI(), assKprimChoice\isComplete(), assNumeric\isValidSolutionSubmit(), 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(), assTextSubset\saveWorkingData(), assFileUpload\saveWorkingData(), assTextQuestion\saveWorkingData(), assSingleChoice\saveWorkingData(), assImagemapQuestion\saveWorkingData(), assOrderingQuestion\saveWorkingData(), assFormulaQuestion\saveWorkingData(), assMatchingQuestion\saveWorkingData(), and assClozeTest\saveWorkingData().

178  {
179  $setting = new ilSetting("assessment");
180 
181  return (boolean) $setting->get("assessment_logging");
182  }
ILIAS Setting Class.
+ Here is the caller graph for this function:

◆ _getForbiddenQuestionTypes()

ilObjAssessmentFolder::_getForbiddenQuestionTypes ( )

Returns the forbidden questiontypes for ILIAS.

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

References $result.

Referenced by ilObjQuestionPool\_getQuestionTypes().

188  {
189  $setting = new ilSetting("assessment");
190  $types = $setting->get("forbidden_questiontypes");
191  $result = array();
192  if (strlen(trim($types)) == 0)
193  {
194  $result = array();
195  }
196  else
197  {
198  $result = unserialize($types);
199  }
200  return $result;
201  }
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 437 of file class.ilObjAssessmentFolder.php.

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

Referenced by ilObjTestGUI\historyObject().

438  {
439  global $ilDB;
440 
441  $log = array();
442  if ($test_only == TRUE)
443  {
444  $result = $ilDB->queryF("SELECT * FROM ass_log WHERE obj_fi = %s AND tstamp > %s AND tstamp < %s AND test_only = %s ORDER BY tstamp",
445  array('integer', 'integer', 'integer', 'text'),
446  array($test_id, $ts_from, $ts_to, 1)
447  );
448  }
449  else
450  {
451  $result = $ilDB->queryF("SELECT * FROM ass_log WHERE obj_fi = %s AND tstamp > %s AND tstamp < %s ORDER BY tstamp",
452  array('integer', 'integer', 'integer'),
453  array($test_id, $ts_from, $ts_to)
454  );
455  }
456  while ($row = $ilDB->fetchAssoc($result))
457  {
458  if (!array_key_exists($row["tstamp"], $log))
459  {
460  $log[$row["tstamp"]] = array();
461  }
462  $type_href = "";
463  if (array_key_exists("ref_id", $row))
464  {
465  if ($row["ref_id"] > 0)
466  {
467  $type = ilObject::_lookupType($row['ref_id'], true);
468  switch ($type)
469  {
470  case "tst":
471  $type_href = sprintf("goto.php?target=tst_%s&amp;client_id=" . CLIENT_ID, $row["ref_id"]);
472  break;
473  case "cat":
474  $type_href = sprintf("goto.php?target=cat_%s&amp;client_id=" . CLIENT_ID, $row["ref_id"]);
475  break;
476  }
477  }
478  }
479  $row["href"] = $type_href;
480  array_push($log[$row["tstamp"]], $row);
481  }
482  krsort($log);
483  // flatten array
484  $log_array = array();
485  foreach ($log as $key => $value)
486  {
487  foreach ($value as $index => $row)
488  {
489  array_push($log_array, $row);
490  }
491  }
492  return $log_array;
493  }
$result
static _lookupType($a_id, $a_reference=false)
lookup object type
global $ilDB
+ 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 222 of file class.ilObjAssessmentFolder.php.

References $lang.

Referenced by assQuestion\_setReachedPoints(), ilObjTest\addExtraTime(), assMultipleChoice\calculateReachedPoints(), assQuestion\calculateResultsFromSolution(), ilObjTest\checkMaximumAllowedUsers(), ilObjTest\getManualFeedback(), ilObjTest\insertQuestion(), assKprimChoice\isComplete(), assNumeric\isValidSolutionSubmit(), 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(), assTextSubset\saveWorkingData(), assFileUpload\saveWorkingData(), assTextQuestion\saveWorkingData(), assSingleChoice\saveWorkingData(), assImagemapQuestion\saveWorkingData(), assOrderingQuestion\saveWorkingData(), assFormulaQuestion\saveWorkingData(), assMatchingQuestion\saveWorkingData(), and assClozeTest\saveWorkingData().

223  {
224  $setting = new ilSetting("assessment");
225 
226  $lang = $setting->get("assessment_log_language");
227  if (strlen($lang) == 0)
228  {
229  $lang = "en";
230  }
231  return $lang;
232  }
ILIAS Setting Class.
+ Here is the caller graph for this function:

◆ _getManualScoring()

ilObjAssessmentFolder::_getManualScoring ( )

Retrieve the manual scoring settings.

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

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

257  {
258  $setting = new ilSetting("assessment");
259 
260  $types = $setting->get("assessment_manual_scoring");
261  return explode(",", $types);
262  }
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 267 of file class.ilObjAssessmentFolder.php.

References $ilDB, $result, and $row.

Referenced by assQuestion\_needsManualScoring().

268  {
269  global $ilDB;
270 
271  $result = $ilDB->query("SELECT * FROM qpl_qst_type");
272  $dbtypes = array();
273  while ($row = $ilDB->fetchAssoc($result))
274  {
275  $dbtypes[$row["question_type_id"]] = $row["type_tag"];
276  }
277  $setting = new ilSetting("assessment");
278  $types = $setting->get("assessment_manual_scoring");
279  $ids = explode(",", $types);
280  foreach ($ids as $key => $value)
281  {
282  $ids[$key] = $dbtypes[$value];
283  }
284  return $ids;
285  }
ILIAS Setting Class.
$result
global $ilDB
+ 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 243 of file class.ilObjAssessmentFolder.php.

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

244  {
245  if( count(self::_getManualScoring()) > 0 )
246  {
247  return true;
248  }
249 
250  return false;
251  }
+ 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 208 of file class.ilObjAssessmentFolder.php.

209  {
210  $setting = new ilSetting("assessment");
211  $types = "";
212  if (is_array($a_types) && (count($a_types) > 0))
213  {
214  $types = serialize($a_types);
215  }
216  $setting->set("forbidden_questiontypes", $types);
217  }
ILIAS Setting Class.

◆ _setLogLanguage()

ilObjAssessmentFolder::_setLogLanguage (   $a_language)

set the log language

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

168  {
169  $setting = new ilSetting("assessment");
170 
171  $setting->set("assessment_log_language", $a_language);
172  }
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 292 of file class.ilObjAssessmentFolder.php.

293  {
294  $setting = new ilSetting("assessment");
295  if ((!is_array($type_ids)) || (count($type_ids) == 0))
296  {
297  $setting->delete("assessment_manual_scoring");
298  }
299  else
300  {
301  $setting->set("assessment_manual_scoring", implode($type_ids, ","));
302  }
303  }
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 550 of file class.ilObjAssessmentFolder.php.

References $ilDB, $ilUser, and _addLog().

551  {
552  global $ilDB;
553  global $ilUser;
554 
555  foreach ($a_array as $object_id)
556  {
557  $affectedRows = $ilDB->manipulateF("DELETE FROM ass_log WHERE obj_fi = %s",
558  array('integer'),
559  array($object_id)
560  );
561  $this->_addLog($ilUser->getId(), $object_id, $this->lng->txt("assessment_log_deleted"));
562  }
563  }
_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
global $ilDB
+ Here is the call graph for this function:

◆ getAssessmentProcessLockMode()

ilObjAssessmentFolder::getAssessmentProcessLockMode ( )

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

585  {
586  return $this->setting->get('ass_process_lock_mode', self::ASS_PROC_LOCK_MODE_NONE);
587  }

◆ 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 525 of file class.ilObjAssessmentFolder.php.

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

526  {
527  global $tree;
528  $path = $tree->getPathFull($ref_id);
529  $pathelements = array();
530  foreach ($path as $id => $data)
531  {
532  if ($id == 0)
533  {
534  array_push($pathelements, ilUtil::prepareFormOutput($this->lng->txt("repository")));
535  }
536  else
537  {
538  array_push($pathelements, "<a href=\"./goto.php?target=" . $data["type"] . "_" . $data["ref_id"] . "&amp;client=" . CLIENT_ID . "\">" .
539  ilUtil::prepareFormOutput($data["title"]) . "</a>");
540  }
541  }
542  return implode("&nbsp;&gt;&nbsp;", $pathelements);
543  }
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
$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 380 of file class.ilObjAssessmentFolder.php.

References $ilDB, $log, $result, and $row.

381  {
382  global $ilDB;
383 
384  $log = array();
385  if ($test_only == TRUE)
386  {
387  $result = $ilDB->queryF("SELECT * FROM ass_log WHERE obj_fi = %s AND tstamp > %s AND tstamp < %s AND test_only = %s ORDER BY tstamp",
388  array('integer','integer','integer','text'),
389  array(
390  $test_id,
391  $ts_from,
392  $ts_to,
393  1
394  )
395  );
396  }
397  else
398  {
399  $result = $ilDB->queryF("SELECT * FROM ass_log WHERE obj_fi = %s AND tstamp > %s AND tstamp < %s ORDER BY tstamp",
400  array('integer','integer','integer'),
401  array(
402  $test_id,
403  $ts_from,
404  $ts_to
405  )
406  );
407  }
408  while ($row = $ilDB->fetchAssoc($result))
409  {
410  if (!array_key_exists($row["tstamp"], $log))
411  {
412  $log[$row["tstamp"]] = array();
413  }
414  array_push($log[$row["tstamp"]], $row);
415  }
416  krsort($log);
417  // flatten array
418  $log_array = array();
419  foreach ($log as $key => $value)
420  {
421  foreach ($value as $index => $row)
422  {
423  array_push($log_array, $row);
424  }
425  }
426  return $log_array;
427  }
$result
global $ilDB

◆ 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 501 of file class.ilObjAssessmentFolder.php.

References $ilDB, $result, and $row.

502  {
503  global $ilDB;
504  $result = $ilDB->queryF("SELECT COUNT(obj_fi) logcount FROM ass_log WHERE obj_fi = %s",
505  array('integer'),
506  array($test_obj_id)
507  );
508  if ($result->numRows())
509  {
510  $row = $ilDB->fetchAssoc($result);
511  return $row["logcount"];
512  }
513  else
514  {
515  return 0;
516  }
517  }
$result
global $ilDB

◆ getScoringAdjustableQuestions()

static ilObjAssessmentFolder::getScoringAdjustableQuestions ( )
static

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

306  {
307  $setting = new ilSetting("assessment");
308 
309  $types = $setting->get("assessment_scoring_adjustment");
310  return explode(",", $types);
311  }
ILIAS Setting Class.

◆ getScoringAdjustmentEnabled()

static ilObjAssessmentFolder::getScoringAdjustmentEnabled ( )
static

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

327  {
328  $setting = new ilSetting("assessment");
329  return $setting->get('assessment_adjustments_enabled');
330  }
ILIAS Setting Class.

◆ getValidAssessmentProcessLockModes()

static ilObjAssessmentFolder::getValidAssessmentProcessLockModes ( )
static

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

Referenced by ilObjAssessmentFolderGUI\saveSettingsObject().

595  {
596  return array(self::ASS_PROC_LOCK_MODE_NONE, self::ASS_PROC_LOCK_MODE_FILE, self::ASS_PROC_LOCK_MODE_DB);
597  }
+ 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:

◆ 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 571 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().

572  {
573  require_once 'Modules/TestQuestionPool/classes/class.assQuestion.php';
574 
575  global $ilSetting;
576 
577  $isPageEditorEnabled = $ilSetting->get(
578  'enable_tst_page_edit', self::ADDITIONAL_QUESTION_CONTENT_EDITING_MODE_PAGE_OBJECT_DISABLED
579  );
580 
581  return $isPageEditorEnabled;
582  }
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 94 of file class.ilObjAssessmentFolder.php.

References $_GET, and ilObject\getType().

95  {
96  global $tree;
97 
98  switch ($a_event)
99  {
100  case "link":
101 
102  //var_dump("<pre>",$a_params,"</pre>");
103  //echo "Module name ".$this->getRefId()." triggered by link event. Objects linked into target object ref_id: ".$a_ref_id;
104  //exit;
105  break;
106 
107  case "cut":
108 
109  //echo "Module name ".$this->getRefId()." triggered by cut event. Objects are removed from target object ref_id: ".$a_ref_id;
110  //exit;
111  break;
112 
113  case "copy":
114 
115  //var_dump("<pre>",$a_params,"</pre>");
116  //echo "Module name ".$this->getRefId()." triggered by copy event. Objects are copied into target object ref_id: ".$a_ref_id;
117  //exit;
118  break;
119 
120  case "paste":
121 
122  //echo "Module name ".$this->getRefId()." triggered by paste (cut) event. Objects are pasted into target object ref_id: ".$a_ref_id;
123  //exit;
124  break;
125 
126  case "new":
127 
128  //echo "Module name ".$this->getRefId()." triggered by paste (new) event. Objects are applied to target object ref_id: ".$a_ref_id;
129  //exit;
130  break;
131  }
132 
133  // At the beginning of the recursive process it avoids second call of the notify function with the same parameter
134  if ($a_node_id==$_GET["ref_id"])
135  {
136  $parent_obj =& $this->ilias->obj_factory->getInstanceByRefId($a_node_id);
137  $parent_type = $parent_obj->getType();
138  if($parent_type == $this->getType())
139  {
140  $a_node_id = (int) $tree->getParentId($a_node_id);
141  }
142  }
143 
144  parent::notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params);
145  }
$_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 589 of file class.ilObjAssessmentFolder.php.

590  {
591  $this->setting->set('ass_process_lock_mode', $lockMode);
592  }

◆ setScoringAdjustableQuestions()

static ilObjAssessmentFolder::setScoringAdjustableQuestions (   $type_ids)
static

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

314  {
315  $setting = new ilSetting("assessment");
316  if ((!is_array($type_ids)) || (count($type_ids) == 0))
317  {
318  $setting->delete("assessment_scoring_adjustment");
319  }
320  else
321  {
322  $setting->set("assessment_scoring_adjustment", implode($type_ids, ","));
323  }
324  }
ILIAS Setting Class.

◆ setScoringAdjustmentEnabled()

static ilObjAssessmentFolder::setScoringAdjustmentEnabled (   $active)
static

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

333  {
334  $setting = new ilSetting('assessment');
335  $setting->set('assessment_adjustments_enabled', (bool) $active);
336  }
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: