ILIAS  Release_3_10_x_branch Revision 61812
 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, $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
 _lookupObjIdByImportId ($a_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
 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)
 _getAllReferences ($a_id)
 get all reference ids of object
 _lookupTitle ($a_id)
 lookup object title
 _lookupDescription ($a_id)
 lookup object description
 _lookupLastUpdate ($a_id, $a_as_string=false)
 lookup last update
 _getLastUpdateOfObjects ($a_objs)
 Get last update for a set of media objects.
 _lookupObjId ($a_id)
 _setDeletedDate ($a_ref_id)
 only called in ilTree::saveSubTree
 _resetDeletedDate ($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)
 _lookupType ($a_id, $a_reference=false)
 lookup object type
 _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
 _lookupObjectId ($a_ref_id)
 lookup object id
 _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
 setRegisterMode ($a_bool)
 isUserRegistered ($a_user_id=0)
 requireRegistration ()
 getXMLZip ()
 getHTMLDirectory ()
 cloneObject ($a_target_id, $a_copy_id=0)
 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.

Data Fields

 $setting
- Data Fields inherited from ilObject
 $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

Additional Inherited Members

- Static Public Member Functions inherited from ilObject
static _getIdsForTitle ($title, $type= '')
 _exists ($a_id, $a_reference=false)
 checks if an object exists in object_data
static _getObjectsByType ($a_obj_type="")
 Get objects by type.
static _prepareCloneSelection ($a_ref_ids, $new_type)
 Prepare copy wizard object selection.
static _getIcon ($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)

Detailed Description

Class ilObjAssessmentFolder.

Author
Helmut Schottmüller hscho.nosp@m.ttm@.nosp@m.gmx.d.nosp@m.e
Version
Id:
class.ilObjAssessmentFolder.php 16511 2008-04-29 18:10:55Z hschottm

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

Member Function Documentation

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

Add an assessment log entry.

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

References ilObject\$ref_id, and $result.

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

{
global $ilUser, $ilDB;
if (strlen($question_id) == 0)
{
$question_id = "NULL";
}
else
{
$question_id = $ilDB->quote($question_id . "");
}
if (strlen($original_id) == 0)
{
$original_id = "NULL";
}
else
{
$original_id = $ilDB->quote($original_id . "");
}
$only = "0";
if ($test_only == TRUE)
{
$only = "1";
}
$test_ref_id = "NULL";
if ($ref_id > 0)
{
$test_ref_id = $ilDB->quote($ref_id . "");
}
$query = sprintf("INSERT INTO ass_log (ass_log_id, user_fi, obj_fi, logtext, question_fi, original_fi, test_only, ref_id, TIMESTAMP) VALUES (NULL, %s, %s, %s, %s, %s, %s, %s, NULL)",
$ilDB->quote($user_id . ""),
$ilDB->quote($object_id . ""),
$ilDB->quote($logtext . ""),
$question_id,
$original_id,
$ilDB->quote($only . ""),
$test_ref_id
);
$result = $ilDB->query($query);
}

+ Here is the caller graph for this function:

ilObjAssessmentFolder::_enableAssessmentLogging (   $a_enable)

enable assessment logging

Definition at line 186 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 223 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.

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

References $log, $result, and DB_FETCHMODE_ASSOC.

Referenced by ilObjTestGUI\historyObject().

{
global $ilDB;
$log = array();
if ($test_only == TRUE)
{
$query = sprintf("SELECT *, TIMESTAMP + 0 AS timestamp14 FROM ass_log WHERE obj_fi = %s AND TIMESTAMP + 0 > %s AND TIMESTAMP + 0 < %s AND test_only = %s ORDER BY timestamp14",
$ilDB->quote($test_id . ""),
$ilDB->quote($ts_from . ""),
$ilDB->quote($ts_to . ""),
$ilDB->quote("1")
);
}
else
{
$query = sprintf("SELECT *, TIMESTAMP + 0 AS timestamp14 FROM ass_log WHERE obj_fi = %s AND TIMESTAMP + 0 > %s AND TIMESTAMP + 0 < %s ORDER BY timestamp14",
$ilDB->quote($test_id . ""),
$ilDB->quote($ts_from . ""),
$ilDB->quote($ts_to . "")
);
}
$result = $ilDB->query($query);
while ($row = $result->fetchRow(DB_FETCHMODE_ASSOC))
{
if (!array_key_exists($row["timestamp14"], $log))
{
$log[$row["timestamp14"]] = array();
}
$type_href = "";
if (array_key_exists("ref_id", $row))
{
if ($row["ref_id"] > 0)
{
$typequery = sprintf("SELECT object_data.type FROM object_data, object_reference WHERE object_reference.ref_id = %s AND object_reference.obj_id = object_data.obj_id",
$ilDB->quote($row["ref_id"])
);
$typequeryresult = $ilDB->query($typequery);
if ($typequeryresult->numRows() == 1)
{
$typerow = $typequeryresult->fetchRow(DB_FETCHMODE_ASSOC);
switch ($typerow["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["timestamp14"]], $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 caller graph for this function:

ilObjAssessmentFolder::_getManualScoring ( )

Retrieve the manual scoring settings.

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

References $setting.

Referenced by ilTestServiceGUI\getPassListOfAnswersWithScoring(), ilObjTestGUI\getTabs(), and ilTestScoringGUI\manscoring().

{
$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 284 of file class.ilObjAssessmentFolder.php.

References $result, $setting, and DB_FETCHMODE_ASSOC.

Referenced by assQuestion\_needsManualScoring().

{
global $ilDB;
$query = "SELECT * FROM qpl_question_type";
$result = $ilDB->query($query);
$dbtypes = array();
while ($row = $result->fetchRow(DB_FETCHMODE_ASSOC))
{
$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:

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 244 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 203 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 310 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 78 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.

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

References _addLog().

{
global $ilDB;
global $ilUser;
foreach ($a_array as $object_id)
{
$query = sprintf("DELETE FROM ass_log WHERE obj_fi = %s",
$ilDB->quote($object_id . "")
);
$ilDB->query($query);
$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.

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

References $data, ilObject\$id, 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.

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

References $log, $result, and DB_FETCHMODE_ASSOC.

{
$log = array();
if ($test_only == TRUE)
{
$query = sprintf("SELECT *, TIMESTAMP + 0 AS timestamp14 FROM ass_log WHERE obj_fi = %s AND TIMESTAMP + 0 > %s AND TIMESTAMP + 0 < %s AND test_only = %s ORDER BY timestamp14",
$this->ilias->db->quote($test_id . ""),
$this->ilias->db->quote($ts_from . ""),
$this->ilias->db->quote($ts_to . ""),
$this->ilias->db->quote("1")
);
}
else
{
$query = sprintf("SELECT *, TIMESTAMP + 0 AS timestamp14 FROM ass_log WHERE obj_fi = %s AND TIMESTAMP + 0 > %s AND TIMESTAMP + 0 < %s ORDER BY timestamp14",
$this->ilias->db->quote($test_id . ""),
$this->ilias->db->quote($ts_from . ""),
$this->ilias->db->quote($ts_to . "")
);
}
$result = $this->ilias->db->query($query);
while ($row = $result->fetchRow(DB_FETCHMODE_ASSOC))
{
if (!array_key_exists($row["timestamp14"], $log))
{
$log[$row["timestamp14"]] = array();
}
array_push($log[$row["timestamp14"]], $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.

Returns the number of log entries for a given test id

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

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

References $result, and DB_FETCHMODE_ASSOC.

{
$query = sprintf("SELECT COUNT(obj_fi) AS logcount FROM ass_log WHERE obj_fi = %s",
$this->ilias->db->quote($test_obj_id . "")
);
$result = $this->ilias->db->query($query);
if ($result->numRows())
{
$row = $result->fetchRow(DB_FETCHMODE_ASSOC);
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 45 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 100 of file class.ilObjAssessmentFolder.php.

{
global $rbacadmin;
// create a local role folder
//$rfoldObj = $this->createRoleFolder("Local roles","Role Folder of forum obj_no.".$this->getId());
// create moderator role and assign role to rolefolder...
//$roleObj = $rfoldObj->createRole("Moderator","Moderator of forum obj_no.".$this->getId());
//$roles[] = $roleObj->getId();
//unset($rfoldObj);
//unset($roleObj);
return $roles ? $roles : 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 130 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 59 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: