55 global $ilObjDataCache,$ilDB;
59 $this->obj_id = $a_obj_id;
60 $this->usr_id = $a_usr_id;
61 $this->obj_type = $ilObjDataCache->lookupType($this->obj_id);
75 $query =
"DELETE FROM ut_lp_marks ".
76 "WHERE obj_id = ".$ilDB->quote($a_obj_id,
'integer');
88 $this->mark = $a_mark;
96 $this->comment = $a_comment;
104 $this->completed = (bool) $a_status;
124 if(!$this->has_entry)
128 $query =
"UPDATE ut_lp_marks ".
129 "SET mark = ".$ilDB->quote($this->
getMark(),
'text').
", ".
130 "u_comment = ".$ilDB->quote($this->
getComment() ,
'text').
", ".
131 "completed = ".$ilDB->quote($this->
getCompleted() ,
'integer').
" ".
132 "WHERE obj_id = ".$ilDB->quote($this->
getObjId() ,
'integer').
" ".
133 "AND usr_id = ".$ilDB->quote($this->
getUserId(),
'integer');
143 $query =
"SELECT * FROM ut_lp_marks ".
144 "WHERE usr_id = ".$ilDB->quote($a_usr_id ,
'integer').
" ".
145 "AND obj_id = ".$ilDB->quote($a_obj_id ,
'integer');
150 return (
bool)
$row->completed;
159 $query =
"SELECT * FROM ut_lp_marks ".
160 "WHERE usr_id = ".$ilDB->quote($a_usr_id,
'integer').
" ".
161 "AND obj_id = ".$ilDB->quote($a_obj_id ,
'integer');
176 $query =
"SELECT * FROM ut_lp_marks ".
177 "WHERE usr_id = ".$ilDB->quote($a_usr_id ,
'integer').
" ".
178 "AND obj_id = ".$ilDB->quote($a_obj_id ,
'integer');
183 return $row->u_comment;
193 $res = $this->db->query(
"SELECT * FROM ut_lp_marks ".
194 "WHERE obj_id = ".$this->db->quote($this->obj_id ,
'integer').
" ".
195 "AND usr_id = ".$ilDB->quote($this->usr_id ,
'integer'));
198 $this->has_entry =
true;
199 $this->completed = (int)
$row->completed;
200 $this->comment =
$row->u_comment;
201 $this->mark =
$row->mark;
202 $this->status_changed =
$row->status_changed;
214 $query =
"INSERT INTO ut_lp_marks (mark,u_comment, completed,obj_id,usr_id) ".
216 $ilDB->quote($this->
getMark(),
'text').
", ".
217 $ilDB->quote($this->
getComment() ,
'text').
", ".
219 $ilDB->quote($this->
getObjId() ,
'integer').
", ".
220 $ilDB->quote($this->
getUserId() ,
'integer').
" ".
223 $this->has_entry =
true;
232 $ilDB->manipulate(
"DELETE FROM ut_lp_marks".
233 " WHERE obj_id = ".$ilDB->quote($a_obj_id,
"integer").
234 " AND ".$ilDB->in(
"usr_id", $a_user_ids,
"",
"integer"));
243 $set = $ilDB->query(
"SELECT usr_id FROM ut_lp_marks".
244 " WHERE obj_id = ".$ilDB->quote($a_obj_id,
"integer"));
245 while(
$row = $ilDB->fetchAssoc($set))