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);
72 $this->mark = $a_mark;
80 $this->comment = $a_comment;
88 $this->completed = (bool) $a_status;
102 if(!$this->has_entry)
106 $query =
"UPDATE ut_lp_marks ".
107 "SET mark = '".ilUtil::prepareDBString($this->
getMark()).
"', ".
108 "comment = '".ilUtil::prepareDBString($this->
getComment()).
"', ".
110 "WHERE obj_id = '".$this->getObjId().
"' ".
111 "AND usr_id = '".$this->getUserId().
"'";
113 $this->db->query($query);
123 $query =
"SELECT * FROM ut_lp_marks ".
124 "WHERE usr_id = '".$a_usr_id.
"' ".
125 "AND obj_id = '".$a_obj_id.
"'";
127 $res = $ilDB->query($query);
130 return (
bool) $row->completed;
139 $query =
"SELECT * FROM ut_lp_marks ".
140 "WHERE usr_id = '".$a_usr_id.
"' ".
141 "AND obj_id = '".$a_obj_id.
"'";
143 $res = $ilDB->query($query);
156 $query =
"SELECT * FROM ut_lp_marks ".
157 "WHERE usr_id = '".$a_usr_id.
"' ".
158 "AND obj_id = '".$a_obj_id.
"'";
160 $res = $ilDB->query($query);
163 return $row->comment;
171 $res = $this->db->query(
"SELECT * FROM ut_lp_marks ".
172 "WHERE obj_id = ".$this->db->quote($this->obj_id).
" ".
173 "AND usr_id = '".(int) $this->usr_id.
"'");
176 $this->has_entry =
true;
177 $this->completed = (int) $row->completed;
178 $this->comment = $row->comment;
179 $this->mark = $row->mark;
189 $query =
"INSERT INTO ut_lp_marks ".
190 "SET mark = '".ilUtil::prepareDBString($this->
getMark()).
"', ".
191 "comment = '".ilUtil::prepareDBString($this->
getComment()).
"', ".
193 "obj_id = '".$this->getObjId().
"', ".
194 "usr_id = '".$this->getUserId().
"'";
196 $this->db->query($query);
198 $this->has_entry =
true;