54 global $ilObjDataCache,
$ilDB;
58 $this->obj_id = $a_obj_id;
59 $this->usr_id = $a_usr_id;
60 $this->obj_type = $ilObjDataCache->lookupType($this->obj_id);
74 $query =
"DELETE FROM ut_lp_marks ".
75 "WHERE obj_id = ".$ilDB->quote($a_obj_id,
'integer');
87 $this->mark = $a_mark;
95 $this->comment = $a_comment;
103 $this->completed = (bool) $a_status;
119 if(!$this->has_entry)
123 $query =
"UPDATE ut_lp_marks ".
124 "SET mark = ".$ilDB->quote($this->
getMark(),
'text').
", ".
125 "u_comment = ".$ilDB->quote($this->
getComment() ,
'text').
", ".
126 "completed = ".$ilDB->quote($this->
getCompleted() ,
'integer').
" ".
127 "WHERE obj_id = ".$ilDB->quote($this->
getObjId() ,
'integer').
" ".
128 "AND usr_id = ".$ilDB->quote($this->
getUserId(),
'integer');
138 $query =
"SELECT * FROM ut_lp_marks ".
139 "WHERE usr_id = ".$ilDB->quote($a_usr_id ,
'integer').
" ".
140 "AND obj_id = ".$ilDB->quote($a_obj_id ,
'integer');
145 return (
bool)
$row->completed;
154 $query =
"SELECT * FROM ut_lp_marks ".
155 "WHERE usr_id = ".$ilDB->quote($a_usr_id,
'integer').
" ".
156 "AND obj_id = ".$ilDB->quote($a_obj_id ,
'integer');
171 $query =
"SELECT * FROM ut_lp_marks ".
172 "WHERE usr_id = ".$ilDB->quote($a_usr_id ,
'integer').
" ".
173 "AND obj_id = ".$ilDB->quote($a_obj_id ,
'integer');
178 return $row->u_comment;
188 $res = $this->db->query(
"SELECT * FROM ut_lp_marks ".
189 "WHERE obj_id = ".$this->db->quote($this->obj_id ,
'integer').
" ".
190 "AND usr_id = ".$ilDB->quote($this->usr_id ,
'integer'));
193 $this->has_entry =
true;
194 $this->completed = (int)
$row->completed;
195 $this->comment =
$row->u_comment;
196 $this->mark =
$row->mark;
208 $query =
"INSERT INTO ut_lp_marks (mark,u_comment, completed,obj_id,usr_id) ".
210 $ilDB->quote($this->
getMark(),
'text').
", ".
211 $ilDB->quote($this->
getComment() ,
'text').
", ".
213 $ilDB->quote($this->
getObjId() ,
'integer').
", ".
214 $ilDB->quote($this->
getUserId() ,
'integer').
" ".
217 $this->has_entry =
true;