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 | |
| ilClone ($a_parent_ref) | |
| copy all entries of your object. | |
| 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 | |
| _getLogLanguage () | |
| retrieve the log language for assessment logging | |
| _addLog ($user_id, $object_id, $logtext, $question_id="", $original_id="") | |
| Add an assessment log entry. | |
| & | getLog ($ts_from, $ts_to, $test_id, $with_user_actions=FALSE) |
| Retrieve assessment log datasets from the database. | |
Definition at line 36 of file class.ilObjAssessmentFolder.php.
| ilObjAssessmentFolder::_addLog | ( | $ | user_id, | |
| $ | object_id, | |||
| $ | logtext, | |||
| $ | question_id = "", |
|||
| $ | original_id = "" | |||
| ) |
Add an assessment log entry.
Add an assessment log entry
| integer | $user_id The user id of the acting user | |
| integer | $object_id The database id of the modified test object | |
| string | $logtext The textual description for the log entry | |
| integer | $question_id The database id of a modified question (optional) | |
| integer | $original_id The database id of the original of a modified question (optional) |
Definition at line 273 of file class.ilObjAssessmentFolder.php.
References $ilUser, $query, $result, and $user_id.
Referenced by ilObjTest::logAction(), and ASS_MarkSchema::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 . "");
}
$query = sprintf("INSERT INTO ass_log (ass_log_id, user_fi, obj_fi, logtext, question_fi, original_fi, TIMESTAMP) VALUES (NULL, %s, %s, %s, %s, %s, NULL)",
$ilDB->quote($user_id . ""),
$ilDB->quote($object_id . ""),
$ilDB->quote($logtext . ""),
$question_id,
$original_id
);
$result = $ilDB->query($query);
}
Here is the caller graph for this function:| ilObjAssessmentFolder::_enableAssessmentLogging | ( | $ | a_enable | ) |
enable assessment logging
Definition at line 212 of file class.ilObjAssessmentFolder.php.
References ilObject::$ilias.
{
global $ilias;
if ($a_enable)
{
$ilias->setSetting("assessment_logging", 1);
}
else
{
$ilias->setSetting("assessment_logging", 0);
}
}
| ilObjAssessmentFolder::_enabledAssessmentLogging | ( | ) |
check wether assessment logging is enabled or not
Definition at line 239 of file class.ilObjAssessmentFolder.php.
References ilObject::$ilias.
Referenced by ilObjTest::insertQuestion(), ilObjTest::questionMoveDown(), ilObjTest::questionMoveUp(), ilObjTest::removeAllTestEditings(), ilObjTest::removeQuestion(), ilObjTest::saveQuestionsToDb(), ilObjTest::saveToDb(), and ASS_MarkSchema::saveToDb().
{
global $ilias;
return (boolean) $ilias->getSetting("assessment_logging");
}
Here is the caller graph for this function:| ilObjAssessmentFolder::_getLogLanguage | ( | ) |
retrieve the log language for assessment logging
Definition at line 249 of file class.ilObjAssessmentFolder.php.
References ilObject::$ilias, and $lang.
Referenced by ilObjTest::insertQuestion(), ilObjTest::questionMoveDown(), ilObjTest::questionMoveUp(), ilObjTest::removeAllTestEditings(), ilObjTest::removeQuestion(), ilObjTest::saveQuestionsToDb(), ilObjTest::saveToDb(), and ASS_MarkSchema::saveToDb().
{
global $ilias;
$lang = $ilias->getSetting("assessment_log_language");
if (strlen($lang) == 0)
{
$lang = "en";
}
return $lang;
}
Here is the caller graph for this function:| ilObjAssessmentFolder::_setLogLanguage | ( | $ | a_language | ) |
set the log language
Definition at line 229 of file class.ilObjAssessmentFolder.php.
References ilObject::$ilias.
{
global $ilias;
$ilias->setSetting("assessment_log_language", $a_language);
}
| ilObjAssessmentFolder::delete | ( | ) |
delete object and all related data
public
Reimplemented from ilObject.
Definition at line 104 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::getLog | ( | $ | ts_from, | |
| $ | ts_to, | |||
| $ | test_id, | |||
| $ | with_user_actions = FALSE | |||
| ) |
Retrieve assessment log datasets from the database.
Retrieve assessment log datasets from the database
| string | $ts_from Timestamp of the starting date/time period | |
| string | $ts_to Timestamp of the ending date/time period | |
| integer | $test_id Database id of the ILIAS test object |
Definition at line 312 of file class.ilObjAssessmentFolder.php.
References $log, $query, $result, $row, and ilObjTest::_getTestIDFromObjectID().
{
$log = array();
$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);
}
if ($with_user_actions)
{
require_once "./assessment/classes/class.ilObjTest.php";
$query = sprintf("SELECT tst_solutions.*, tst_solutions.TIMESTAMP + 0 AS TIMESTAMP14 FROM tst_solutions WHERE test_fi = %s AND TIMESTAMP + 0 > %s AND TIMESTAMP + 0 < %s",
$this->ilias->db->quote(ilObjTest::_getTestIDFromObjectID($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);
}
}
ksort($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:| ilObjAssessmentFolder::ilClone | ( | $ | a_parent_ref | ) |
copy all entries of your object.
public
| integer | ref_id of parent object |
Reimplemented from ilObject.
Definition at line 75 of file class.ilObjAssessmentFolder.php.
References $rbacadmin.
{
global $rbacadmin;
// always call parent ilClone function first!!
$new_ref_id = parent::ilClone($a_parent_ref);
// get object instance of ilCloned object
//$newObj =& $this->ilias->obj_factory->getInstanceByRefId($new_ref_id);
// create a local role folder & default roles
//$roles = $newObj->initDefaultRoles();
// ...finally assign role to creator of object
//$rbacadmin->assignUser($roles[0], $newObj->getOwner(), "n");
// always destroy objects in ilClone method because ilClone() is recursive and creates instances for each object in subtree!
//unset($newObj);
// ... and finally always return new reference ID!!
return $new_ref_id;
}
| ilObjAssessmentFolder::ilObjAssessmentFolder | ( | $ | a_id = 0, |
|
| $ | a_call_by_reference = true | |||
| ) |
Constructor public.
| integer | reference_id or object_id | |
| boolean | treat the id as reference_id (true) or object_id (false) |
Definition at line 44 of file class.ilObjAssessmentFolder.php.
References ilObject::ilObject().
{
$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
Reimplemented from ilObject.
Definition at line 126 of file class.ilObjAssessmentFolder.php.
References $rbacadmin, and $roles.
{
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
| string | event | |
| integer | reference id of object where the event occured | |
| array | passes optional parameters if required |
Reimplemented from ilObject.
Definition at line 156 of file class.ilObjAssessmentFolder.php.
References $_GET, $tree, 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
Reimplemented from ilObject.
Definition at line 56 of file class.ilObjAssessmentFolder.php.
{
if (!parent::update())
{
return false;
}
// put here object specific stuff
return true;
}
1.7.1