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

Static Public Member Functions

static _mananuallyScoreableQuestionTypesExists ()
 Returns the fact wether manually scoreable question types exist or not.
- Static Public Member Functions inherited from ilObject
static _lookupObjIdByImportId ($a_import_id)
static _getAllReferences ($a_id)
 get all reference ids of object
static _lookupTitle ($a_id)
 lookup object title
static _getIdsForTitle ($title, $type= '', $partialmatch=false)
static _lookupDescription ($a_id)
 lookup object description
static _lookupObjId ($a_id)
static _lookupType ($a_id, $a_reference=false)
 lookup object type
static _lookupObjectId ($a_ref_id)
 lookup object id
 _exists ($a_id, $a_reference=false)
 checks if an object exists in object_data
static _getObjectsByType ($a_obj_type="", $a_owner="")
 Get objects by type.
static _prepareCloneSelection ($a_ref_ids, $new_type, $show_path=true)
 Prepare copy wizard object selection.
static _getIcon ($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
 Get icon for repository item.
static collectDeletionDependencies (&$deps, $a_ref_id, $a_obj_id, $a_type, $a_depth=0)
 Collect deletion dependencies.
static getDeletionDependencies ($a_obj_id)
 Get deletion dependencies.
static getLongDescriptions (array $a_obj_ids)
 Get long description data.
static getAllOwnedRepositoryObjects ($a_user_id)
 Get all ids of objects user owns.

Data Fields

 $setting
- Data Fields inherited from ilObject
const TITLE_LENGTH = 128
 max length of object title
 $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

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

Member Function Documentation

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

References $ilUser.

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

{
global $ilUser, $ilDB;
if (strlen($question_id) == 0) $question_id = NULL;
if (strlen($original_id) == 0) $original_id = NULL;
if (strlen($test_ref_id) == 0) $test_ref_id = NULL;
$only = ($test_only == TRUE) ? 1 : 0;
$next_id = $ilDB->nextId('ass_log');
$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)",
array('integer', 'integer', 'integer', 'text', 'integer', 'integer', 'text', 'integer', 'integer'),
array(
$next_id,
$user_id,
$object_id,
$logtext,
$question_id,
$original_id,
$only,
$test_ref_id,
time()
)
);
}

+ Here is the caller graph for this function:

ilObjAssessmentFolder::_enableAssessmentLogging (   $a_enable)

enable assessment logging

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

References $setting.

{
$setting = new ilSetting("assessment");
if ($a_enable)
{
$setting->set("assessment_logging", 1);
}
else
{
$setting->set("assessment_logging", 0);
}
}
ilObjAssessmentFolder::_getForbiddenQuestionTypes ( )

Returns the forbidden questiontypes for ILIAS.

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

References $result, and $setting.

Referenced by ilObjQuestionPool\_getQuestionTypes().

{
$setting = new ilSetting("assessment");
$types = $setting->get("forbidden_questiontypes");
$result = array();
if (strlen(trim($types)) == 0)
{
$result = array();
}
else
{
$result = unserialize($types);
}
return $result;
}

+ Here is the caller graph for this function:

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

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

Referenced by ilObjTestGUI\historyObject().

{
global $ilDB;
$log = array();
if ($test_only == TRUE)
{
$result = $ilDB->queryF("SELECT * FROM ass_log WHERE obj_fi = %s AND tstamp > %s AND tstamp < %s AND test_only = %s ORDER BY tstamp",
array('integer', 'integer', 'integer', 'text'),
array($test_id, $ts_from, $ts_to, 1)
);
}
else
{
$result = $ilDB->queryF("SELECT * FROM ass_log WHERE obj_fi = %s AND tstamp > %s AND tstamp < %s ORDER BY tstamp",
array('integer', 'integer', 'integer'),
array($test_id, $ts_from, $ts_to)
);
}
while ($row = $ilDB->fetchAssoc($result))
{
if (!array_key_exists($row["tstamp"], $log))
{
$log[$row["tstamp"]] = array();
}
$type_href = "";
if (array_key_exists("ref_id", $row))
{
if ($row["ref_id"] > 0)
{
$type = ilObject::_lookupType($row['ref_id'], true);
switch ($type)
{
case "tst":
$type_href = sprintf("goto.php?target=tst_%s&amp;client_id=" . CLIENT_ID, $row["ref_id"]);
break;
case "cat":
$type_href = sprintf("goto.php?target=cat_%s&amp;client_id=" . CLIENT_ID, $row["ref_id"]);
break;
}
}
}
$row["href"] = $type_href;
array_push($log[$row["tstamp"]], $row);
}
krsort($log);
// flatten array
$log_array = array();
foreach ($log as $key => $value)
{
foreach ($value as $index => $row)
{
array_push($log_array, $row);
}
}
return $log_array;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjAssessmentFolder::_getManualScoring ( )

Retrieve the manual scoring settings.

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

References $setting.

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

{
$setting = new ilSetting("assessment");
$types = $setting->get("assessment_manual_scoring");
return explode(",", $types);
}

+ Here is the caller graph for this function:

ilObjAssessmentFolder::_getManualScoringTypes ( )

Retrieve the manual scoring settings as type strings.

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

References $result, $row, and $setting.

Referenced by assQuestion\_needsManualScoring().

{
global $ilDB;
$result = $ilDB->query("SELECT * FROM qpl_qst_type");
$dbtypes = array();
while ($row = $ilDB->fetchAssoc($result))
{
$dbtypes[$row["question_type_id"]] = $row["type_tag"];
}
$setting = new ilSetting("assessment");
$types = $setting->get("assessment_manual_scoring");
$ids = explode(",", $types);
foreach ($ids as $key => $value)
{
$ids[$key] = $dbtypes[$value];
}
return $ids;
}

+ Here is the caller graph for this function:

static ilObjAssessmentFolder::_mananuallyScoreableQuestionTypesExists ( )
static

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

public

Returns
boolean $mananuallyScoreableQuestionTypesExists

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

Referenced by ilTestScoringGUI\executeCommand().

{
if( count(self::_getManualScoring()) > 0 )
{
return true;
}
return false;
}

+ Here is the caller graph for this function:

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

References $setting.

{
$setting = new ilSetting("assessment");
$types = "";
if (is_array($a_types) && (count($a_types) > 0))
{
$types = serialize($a_types);
}
$setting->set("forbidden_questiontypes", $types);
}
ilObjAssessmentFolder::_setLogLanguage (   $a_language)

set the log language

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

References $setting.

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

References $setting.

{
$setting = new ilSetting("assessment");
if ((!is_array($type_ids)) || (count($type_ids) == 0))
{
$setting->delete("assessment_manual_scoring");
}
else
{
$setting->set("assessment_manual_scoring", implode($type_ids, ","));
}
}
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

Reimplemented from ilObject.

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

{
// always call parent delete function first!!
if (!parent::delete())
{
return false;
}
//put here your module specific stuff
return true;
}
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 543 of file class.ilObjAssessmentFolder.php.

References $ilUser, and _addLog().

{
global $ilDB;
global $ilUser;
foreach ($a_array as $object_id)
{
$affectedRows = $ilDB->manipulateF("DELETE FROM ass_log WHERE obj_fi = %s",
array('integer'),
array($object_id)
);
$this->_addLog($ilUser->getId(), $object_id, $this->lng->txt("assessment_log_deleted"));
}
}

+ Here is the call graph for this function:

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

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

{
global $tree;
$path = $tree->getPathFull($ref_id);
$pathelements = array();
foreach ($path as $id => $data)
{
if ($id == 0)
{
array_push($pathelements, ilUtil::prepareFormOutput($this->lng->txt("repository")));
}
else
{
array_push($pathelements, "<a href=\"./goto.php?target=" . $data["type"] . "_" . $data["ref_id"] . "&amp;client=" . CLIENT_ID . "\">" .
ilUtil::prepareFormOutput($data["title"]) . "</a>");
}
}
return implode("&nbsp;&gt;&nbsp;", $pathelements);
}

+ Here is the call graph for this function:

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

References $log, $result, and $row.

{
global $ilDB;
$log = array();
if ($test_only == TRUE)
{
$result = $ilDB->queryF("SELECT * FROM ass_log WHERE obj_fi = %s AND tstamp > %s AND tstamp < %s AND test_only = %s ORDER BY tstamp",
array('integer','integer','integer','text'),
array(
$test_id,
$ts_from,
$ts_to,
1
)
);
}
else
{
$result = $ilDB->queryF("SELECT * FROM ass_log WHERE obj_fi = %s AND tstamp > %s AND tstamp < %s ORDER BY tstamp",
array('integer','integer','integer'),
array(
$test_id,
$ts_from,
$ts_to
)
);
}
while ($row = $ilDB->fetchAssoc($result))
{
if (!array_key_exists($row["tstamp"], $log))
{
$log[$row["tstamp"]] = array();
}
array_push($log[$row["tstamp"]], $row);
}
krsort($log);
// flatten array
$log_array = array();
foreach ($log as $key => $value)
{
foreach ($value as $index => $row)
{
array_push($log_array, $row);
}
}
return $log_array;
}
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 494 of file class.ilObjAssessmentFolder.php.

References $result, and $row.

{
global $ilDB;
$result = $ilDB->queryF("SELECT COUNT(obj_fi) logcount FROM ass_log WHERE obj_fi = %s",
array('integer'),
array($test_obj_id)
);
if ($result->numRows())
{
$row = $ilDB->fetchAssoc($result);
return $row["logcount"];
}
else
{
return 0;
}
}
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 46 of file class.ilObjAssessmentFolder.php.

References ilObject\ilObject().

{
include_once "./Services/Administration/classes/class.ilSetting.php";
$this->setting = new ilSetting("assessment");
$this->type = "assf";
$this->ilObject($a_id,$a_call_by_reference);
}

+ Here is the call graph for this function:

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.

Reimplemented from ilObject.

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

{
global $rbacadmin;
return array();
}
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

Reimplemented from ilObject.

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

References $_GET, and ilObject\getType().

{
global $tree;
switch ($a_event)
{
case "link":
//var_dump("<pre>",$a_params,"</pre>");
//echo "Module name ".$this->getRefId()." triggered by link event. Objects linked into target object ref_id: ".$a_ref_id;
//exit;
break;
case "cut":
//echo "Module name ".$this->getRefId()." triggered by cut event. Objects are removed from target object ref_id: ".$a_ref_id;
//exit;
break;
case "copy":
//var_dump("<pre>",$a_params,"</pre>");
//echo "Module name ".$this->getRefId()." triggered by copy event. Objects are copied into target object ref_id: ".$a_ref_id;
//exit;
break;
case "paste":
//echo "Module name ".$this->getRefId()." triggered by paste (cut) event. Objects are pasted into target object ref_id: ".$a_ref_id;
//exit;
break;
case "new":
//echo "Module name ".$this->getRefId()." triggered by paste (new) event. Objects are applied to target object ref_id: ".$a_ref_id;
//exit;
break;
}
// At the beginning of the recursive process it avoids second call of the notify function with the same parameter
if ($a_node_id==$_GET["ref_id"])
{
$parent_obj =& $this->ilias->obj_factory->getInstanceByRefId($a_node_id);
$parent_type = $parent_obj->getType();
if($parent_type == $this->getType())
{
$a_node_id = (int) $tree->getParentId($a_node_id);
}
}
parent::notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params);
}

+ Here is the call graph for this function:

ilObjAssessmentFolder::update ( )

update object data

public

Returns
boolean

Reimplemented from ilObject.

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

{
if (!parent::update())
{
return false;
}
// put here object specific stuff
return true;
}

Field Documentation


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