47 $this->course_id = $crs_id;
64 if(!$crs_ref_id = $tree->checkForParentType($a_lm_ref_id,
'crs'))
70 $query =
"DELETE FROM crs_lm_history ".
71 "WHERE lm_ref_id = ".$ilDB->quote($a_lm_ref_id,
'integer').
" ".
72 "AND usr_id = ".$ilDB->quote($a_user_id,
'integer').
"";
76 $fields = array(
"usr_id" => array(
"integer", $a_user_id),
77 "crs_ref_id" => array(
"integer", $crs_ref_id),
78 "lm_ref_id" => array(
"integer", $a_lm_ref_id),
79 "lm_page_id" => array(
"integer", $a_page_id),
80 "last_access" => array(
"integer", time()));
81 $ilDB->insert(
"crs_lm_history", $fields);
89 $query =
"SELECT * FROM crs_lm_history ".
90 "WHERE usr_id = ".$ilDB->quote($this->
getUserId(),
'integer').
" ".
91 "AND crs_ref_id = ".$ilDB->quote($this->
getCourseRefId(),
'integer').
" ".
92 "ORDER BY last_access ";
97 return $row->lm_ref_id;
106 $query =
"SELECT * FROM crs_lm_history ".
107 "WHERE usr_id = ".$ilDB->quote($this->
getUserId(),
'integer').
" ".
108 "AND crs_ref_id = ".$ilDB->quote($this->
getCourseRefId(),
'integer').
"";
113 $lm[
$row->lm_ref_id][
'lm_ref_id'] =
$row->lm_ref_id;
114 $lm[
$row->lm_ref_id][
'lm_page_id'] =
$row->lm_page_id;
115 $lm[
$row->lm_ref_id][
'last_access'] =
$row->last_access;
117 return $lm ? $lm : array();
124 $query =
"DELETE FROM crs_lm_history WHERE usr_id = ".$ilDB->quote($a_usr_id,
'integer').
" ";