Public Member Functions | |
| ilCourseLMHistory ($crs_id, $user_id) | |
| getUserId () | |
| getCourseRefId () | |
| _updateLastAccess ($a_user_id, $a_lm_ref_id, $a_page_id) | |
| getLastLM () | |
| getLMHistory () | |
Data Fields | |
| $db | |
| $course_id | |
| $user_id | |
Definition at line 35 of file class.ilCourseLMHistory.php.
| ilCourseLMHistory::_updateLastAccess | ( | $ | a_user_id, | |
| $ | a_lm_ref_id, | |||
| $ | a_page_id | |||
| ) |
Definition at line 61 of file class.ilCourseLMHistory.php.
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 = '".$a_lm_ref_id."' ".
"AND usr_id = '".$a_user_id."'";
$ilDB->query($query);
// Add new entry
$query = "INSERT INTO crs_lm_history ".
"SET usr_id = '".$a_user_id."', ".
"crs_ref_id = '".$crs_ref_id."', ".
"lm_ref_id = '".$a_lm_ref_id."', ".
"lm_page_id = '".$a_page_id."', ".
"last_access = '".time()."'";
$ilDB->query($query);
return true;
}
Here is the caller graph for this function:| ilCourseLMHistory::getCourseRefId | ( | ) |
Definition at line 56 of file class.ilCourseLMHistory.php.
{
return $this->course_id;
}
| ilCourseLMHistory::getLastLM | ( | ) |
Definition at line 90 of file class.ilCourseLMHistory.php.
| ilCourseLMHistory::getLMHistory | ( | ) |
Definition at line 105 of file class.ilCourseLMHistory.php.
References $query, $res, and $row.
{
$query = "SELECT * FROM crs_lm_history ".
"WHERE usr_id = '".$this->getUserId()."' ".
"AND crs_ref_id = '".$this->getCourseRefId()."'";
$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();
}
| ilCourseLMHistory::getUserId | ( | ) |
Definition at line 52 of file class.ilCourseLMHistory.php.
{
return $this->user_id;
}
| ilCourseLMHistory::ilCourseLMHistory | ( | $ | crs_id, | |
| $ | user_id | |||
| ) |
Definition at line 42 of file class.ilCourseLMHistory.php.
References $user_id.
{
global $ilDB;
$this->db =& $ilDB;
$this->course_id = $crs_id;
$this->user_id = $user_id;
}
| ilCourseLMHistory::$course_id |
Definition at line 39 of file class.ilCourseLMHistory.php.
| ilCourseLMHistory::$db |
Definition at line 37 of file class.ilCourseLMHistory.php.
| ilCourseLMHistory::$user_id |
Definition at line 40 of file class.ilCourseLMHistory.php.
Referenced by ilCourseLMHistory().
1.7.1