ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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)
 
 getSkillTriggeringNumAnswersBarrier ()
 
 setSkillTriggeringNumAnswersBarrier ($skillTriggeringNumAnswersBarrier)
 
 fetchScoringAdjustableTypes ($allQuestionTypes)
 
- 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...
 
 getPossibleSubObjects ($a_filter=true)
 get all possible subobjects of this type the object can decide which types of subobjects are possible jut in time overwrite if the decision distinguish from standard model 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 _lookupImportId ($a_obj_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 fixMissingTitles ($a_type, array &$a_obj_title_map)
 Try to fix missing object titles. 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'
 
const DEFAULT_SKL_TRIG_NUM_ANSWERS_BARRIER = 1
 
 $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...
 

Private Member Functions

 questionSupportsScoringAdjustment (\assQuestionGUI $question_object)
 

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

References $ilDB, and $ilUser.

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

351  {
352  global $ilUser, $ilDB;
353  if (strlen($question_id) == 0) $question_id = NULL;
354  if (strlen($original_id) == 0) $original_id = NULL;
355  if (strlen($test_ref_id) == 0) $test_ref_id = NULL;
356  $only = ($test_only == TRUE) ? 1 : 0;
357  $next_id = $ilDB->nextId('ass_log');
358  $affectedRows = $ilDB->manipulateF("INSERT INTO ass_log (ass_log_id, user_fi, obj_fi, logtext, question_fi, original_fi, test_only, ref_id, tstamp) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)",
359  array('integer', 'integer', 'integer', 'text', 'integer', 'integer', 'text', 'integer', 'integer'),
360  array(
361  $next_id,
362  $user_id,
363  $object_id,
364  $logtext,
365  $question_id,
366  $original_id,
367  $only,
368  $test_ref_id,
369  time()
370  )
371  );
372  }
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 152 of file class.ilObjAssessmentFolder.php.

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

◆ _enabledAssessmentLogging()

ilObjAssessmentFolder::_enabledAssessmentLogging ( )

check wether assessment logging is enabled or not

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

Referenced by assQuestion\_setReachedPoints(), ilObjTest\addExtraTime(), ilTestOutputGUI\adoptUserSolutionsFromPreviousPass(), assMultipleChoice\calculateReachedPoints(), assQuestion\calculateResultsFromSolution(), ilObjTest\checkMaximumAllowedUsers(), ilObjTest\createQuestionGUI(), ilObjTest\createRandomSolutions(), ilObjTest\getManualFeedback(), ilTestPlayerAbstractGUI\getQuestionInstance(), ilObjTest\insertQuestion(), assQuestion\instantiateQuestionGUI(), assKprimChoice\isComplete(), assNumeric\isValidSolutionSubmit(), ilTestPasswordChecker\logWrongEnteredPassword(), ilObjTest\questionMoveDown(), ilObjTest\questionMoveUp(), ilTestEvaluationGUI\redirectToPassDeletionContext(), ilObjTest\removeQuestion(), ilObjTest\removeTestResultsByActiveIds(), ilSoapTestAdministration\saveQuestion(), ilObjTest\saveQuestionsToDb(), ASS_MarkSchema\saveToDb(), ilObjTest\saveToDb(), assOrderingHorizontal\saveWorkingData(), assErrorText\saveWorkingData(), assTextSubset\saveWorkingData(), assTextQuestion\saveWorkingData(), assFileUpload\saveWorkingData(), assSingleChoice\saveWorkingData(), assLongMenu\saveWorkingData(), assImagemapQuestion\saveWorkingData(), assOrderingQuestion\saveWorkingData(), assFormulaQuestion\saveWorkingData(), assMatchingQuestion\saveWorkingData(), and assClozeTest\saveWorkingData().

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

◆ _getForbiddenQuestionTypes()

ilObjAssessmentFolder::_getForbiddenQuestionTypes ( )

Returns the forbidden questiontypes for ILIAS.

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

References $result.

Referenced by ilObjQuestionPool\_getQuestionTypes().

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

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

Referenced by ilObjTestGUI\historyObject().

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

References $lang.

Referenced by assQuestion\_setReachedPoints(), ilObjTest\addExtraTime(), assMultipleChoice\calculateReachedPoints(), assQuestion\calculateResultsFromSolution(), ilObjTest\checkMaximumAllowedUsers(), ilObjTest\getManualFeedback(), ilTestPasswordChecker\getWrongEnteredPasswordLogMsg(), ilObjTest\insertQuestion(), assKprimChoice\isComplete(), assNumeric\isValidSolutionSubmit(), ilObjTest\questionMoveDown(), ilObjTest\questionMoveUp(), ilTestEvaluationGUI\redirectToPassDeletionContext(), ilObjTest\removeQuestion(), ilObjTest\removeTestResultsByActiveIds(), ilObjTest\saveQuestionsToDb(), ASS_MarkSchema\saveToDb(), ilObjTest\saveToDb(), assOrderingHorizontal\saveWorkingData(), assErrorText\saveWorkingData(), assTextSubset\saveWorkingData(), assTextQuestion\saveWorkingData(), assFileUpload\saveWorkingData(), assSingleChoice\saveWorkingData(), assLongMenu\saveWorkingData(), assImagemapQuestion\saveWorkingData(), assOrderingQuestion\saveWorkingData(), assFormulaQuestion\saveWorkingData(), assMatchingQuestion\saveWorkingData(), and assClozeTest\saveWorkingData().

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

◆ _getManualScoring()

ilObjAssessmentFolder::_getManualScoring ( )

Retrieve the manual scoring settings.

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

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

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

References $ilDB, $result, and $row.

Referenced by assQuestion\_needsManualScoring().

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

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

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

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

◆ _setLogLanguage()

ilObjAssessmentFolder::_setLogLanguage (   $a_language)

set the log language

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

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

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

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

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

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

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

◆ fetchScoringAdjustableTypes()

ilObjAssessmentFolder::fetchScoringAdjustableTypes (   $allQuestionTypes)

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

References ilObject\$type, assQuestionGUI\_getQuestionGUI(), and questionSupportsScoringAdjustment().

614  {
615  require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
616  $scoringAdjustableQuestionTypes = array();
617 
618  foreach($allQuestionTypes as $type => $typeData)
619  {
620  $questionGui = assQuestionGUI::_getQuestionGUI($typeData['type_tag']);
621 
622  if( $this->questionSupportsScoringAdjustment($questionGui) )
623  {
624  $scoringAdjustableQuestionTypes[$type] = $typeData;
625  }
626  }
627 
628  return $scoringAdjustableQuestionTypes;
629  }
questionSupportsScoringAdjustment(\assQuestionGUI $question_object)
& _getQuestionGUI($question_type, $question_id=-1)
Creates a question gui representation and returns the alias to the question gui note: please do not u...
+ Here is the call graph for this function:

◆ getAssessmentProcessLockMode()

ilObjAssessmentFolder::getAssessmentProcessLockMode ( )

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

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

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

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

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

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

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

References $ilDB, $result, and $row.

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

◆ getScoringAdjustableQuestions()

static ilObjAssessmentFolder::getScoringAdjustableQuestions ( )
static

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

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

◆ getScoringAdjustmentEnabled()

static ilObjAssessmentFolder::getScoringAdjustmentEnabled ( )
static

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

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

◆ getSkillTriggeringNumAnswersBarrier()

ilObjAssessmentFolder::getSkillTriggeringNumAnswersBarrier ( )

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

602  {
603  return $this->setting->get(
604  'ass_skl_trig_num_answ_barrier', self::DEFAULT_SKL_TRIG_NUM_ANSWERS_BARRIER
605  );
606  }

◆ getValidAssessmentProcessLockModes()

static ilObjAssessmentFolder::getValidAssessmentProcessLockModes ( )
static

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

Referenced by ilObjAssessmentFolderGUI\saveSettingsObject().

597  {
598  return array(self::ASS_PROC_LOCK_MODE_NONE, self::ASS_PROC_LOCK_MODE_FILE, self::ASS_PROC_LOCK_MODE_DB);
599  }
+ 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 36 of file class.ilObjAssessmentFolder.php.

References ilObject\ilObject().

37  {
38  include_once "./Services/Administration/classes/class.ilSetting.php";
39  $this->setting = new ilSetting("assessment");
40  $this->type = "assf";
41  $this->ilObject($a_id,$a_call_by_reference);
42  }
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 573 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().

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

References $_GET, and ilObject\getType().

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

◆ questionSupportsScoringAdjustment()

ilObjAssessmentFolder::questionSupportsScoringAdjustment ( \assQuestionGUI  $question_object)
private

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

Referenced by fetchScoringAdjustableTypes().

632  {
633  return ($question_object instanceof ilGuiQuestionScoringAdjustable
634  || $question_object instanceof ilGuiAnswerScoringAdjustable)
635  && ($question_object->object instanceof ilObjQuestionScoringAdjustable
636  || $question_object->object instanceof ilObjAnswerScoringAdjustable);
637  }
Interface ilObjAnswerScoringAdjustable.
Interface ilObjQuestionScoringAdjustable.
Interface ilGuiAnswerScoringAdjustable.
Interface ilGuiQuestionScoringAdjustable.
+ Here is the caller graph for this function:

◆ setAssessmentProcessLockMode()

ilObjAssessmentFolder::setAssessmentProcessLockMode (   $lockMode)

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

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

◆ setScoringAdjustableQuestions()

static ilObjAssessmentFolder::setScoringAdjustableQuestions (   $type_ids)
static

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

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

◆ setScoringAdjustmentEnabled()

static ilObjAssessmentFolder::setScoringAdjustmentEnabled (   $active)
static

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

335  {
336  $setting = new ilSetting('assessment');
337  $setting->set('assessment_adjustments_enabled', (bool) $active);
338  }
ILIAS Setting Class.

◆ setSkillTriggeringNumAnswersBarrier()

ilObjAssessmentFolder::setSkillTriggeringNumAnswersBarrier (   $skillTriggeringNumAnswersBarrier)

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

609  {
610  $this->setting->set('ass_skl_trig_num_answ_barrier', $skillTriggeringNumAnswersBarrier);
611  }

◆ update()

ilObjAssessmentFolder::update ( )

update object data

public

Returns
boolean

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

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

Field Documentation

◆ $setting

ilObjAssessmentFolder::$setting

Definition at line 28 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

◆ DEFAULT_SKL_TRIG_NUM_ANSWERS_BARRIER

const ilObjAssessmentFolder::DEFAULT_SKL_TRIG_NUM_ANSWERS_BARRIER = 1

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