ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilCourseLMHistory Class Reference

class ilCourseLMHistory More...

+ Inheritance diagram for ilCourseLMHistory:
+ Collaboration diagram for ilCourseLMHistory:

Public Member Functions

 ilCourseLMHistory ($crs_id, $user_id)
 getUserId ()
 getCourseRefId ()
 _updateLastAccess ($a_user_id, $a_lm_ref_id, $a_page_id)
 getLastLM ()
 getLMHistory ()
 _deleteUser ($a_usr_id)

Data Fields

 $db
 $course_id
 $user_id

Detailed Description

class ilCourseLMHistory

Author
Stefan Meyer smeye.nosp@m.r@da.nosp@m.tabay.nosp@m..de
Version
Id:
class.ilCourseLMHistory.php 19114 2009-02-23 12:43:27Z smeyer

Definition at line 34 of file class.ilCourseLMHistory.php.

Member Function Documentation

ilCourseLMHistory::_deleteUser (   $a_usr_id)

Definition at line 121 of file class.ilCourseLMHistory.php.

References $ilDB, $query, and $res.

{
global $ilDB;
$query = "DELETE FROM crs_lm_history WHERE usr_id = ".$ilDB->quote($a_usr_id,'integer')." ";
$res = $ilDB->manipulate($query);
return true;
}
ilCourseLMHistory::_updateLastAccess (   $a_user_id,
  $a_lm_ref_id,
  $a_page_id 
)

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

References $ilDB, $query, and $res.

Referenced by ilLMPresentationGUI\ilPage(), and ilLMPresentationGUI\ilTranslation().

{
global $tree,$ilDB;
if(!$crs_ref_id = $tree->checkForParentType($a_lm_ref_id,'crs'))
{
return true;
}
// Delete old entries
$query = "DELETE FROM crs_lm_history ".
"WHERE lm_ref_id = ".$ilDB->quote($a_lm_ref_id,'integer')." ".
"AND usr_id = ".$ilDB->quote($a_user_id,'integer')."";
$res = $ilDB->manipulate($query);
// Add new entry
$query = "INSERT INTO crs_lm_history ".
"SET usr_id = ".$ilDB->quote($a_user_id,'integer').", ".
"crs_ref_id = ".$ilDB->quote($crs_ref_id,'integer').", ".
"lm_ref_id = ".$ilDB->quote($a_lm_ref_id,'integer').", ".
"lm_page_id = ".$ilDB->quote($a_page_id,'integer').", ".
"last_access = ".$ilDB->quote(time(),'integer')."";
$res = $ilDB->manipulate($query);
return true;
}

+ Here is the caller graph for this function:

ilCourseLMHistory::getCourseRefId ( )

Definition at line 55 of file class.ilCourseLMHistory.php.

References $course_id.

Referenced by getLastLM(), and getLMHistory().

{
}

+ Here is the caller graph for this function:

ilCourseLMHistory::getLastLM ( )

Definition at line 86 of file class.ilCourseLMHistory.php.

References $ilDB, $query, $res, $row, DB_FETCHMODE_OBJECT, getCourseRefId(), and getUserId().

{
global $ilDB;
$query = "SELECT * FROM crs_lm_history ".
"WHERE usr_id = ".$ilDB->quote($this->getUserId(),'integer')." ".
"AND crs_ref_id = ".$ilDB->quote($this->getCourseRefId(),'integer')." ".
"ORDER BY last_access ";
$res = $this->db->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
return $row->lm_ref_id;
}
return false;
}

+ Here is the call graph for this function:

ilCourseLMHistory::getLMHistory ( )

Definition at line 103 of file class.ilCourseLMHistory.php.

References $ilDB, $query, $res, $row, DB_FETCHMODE_OBJECT, getCourseRefId(), and getUserId().

Referenced by ilCourseObjectivePresentationGUI\__showLearningMaterials(), ilCourseContentGUI\showStartObjects(), and ilObjCourseGUI\showStartObjects().

{
global $ilDB;
$query = "SELECT * FROM crs_lm_history ".
"WHERE usr_id = ".$ilDB->quote($this->getUserId(),'integer')." ".
"AND crs_ref_id = ".$ilDB->quote($this->getCourseRefId(),'integer')."";
$res = $this->db->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$lm[$row->lm_ref_id]['lm_ref_id'] = $row->lm_ref_id;
$lm[$row->lm_ref_id]['lm_page_id'] = $row->lm_page_id;
$lm[$row->lm_ref_id]['last_access'] = $row->last_access;
}
return $lm ? $lm : array();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilCourseLMHistory::getUserId ( )

Definition at line 51 of file class.ilCourseLMHistory.php.

References $user_id.

Referenced by getLastLM(), and getLMHistory().

{
}

+ Here is the caller graph for this function:

ilCourseLMHistory::ilCourseLMHistory (   $crs_id,
  $user_id 
)

Definition at line 41 of file class.ilCourseLMHistory.php.

References $ilDB, and $user_id.

{
global $ilDB;
$this->db =& $ilDB;
$this->course_id = $crs_id;
$this->user_id = $user_id;
}

Field Documentation

ilCourseLMHistory::$course_id

Definition at line 38 of file class.ilCourseLMHistory.php.

Referenced by getCourseRefId().

ilCourseLMHistory::$db

Definition at line 36 of file class.ilCourseLMHistory.php.

ilCourseLMHistory::$user_id

Definition at line 39 of file class.ilCourseLMHistory.php.

Referenced by getUserId(), and ilCourseLMHistory().


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