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;
104 $this->completed = (bool) $a_status;
124 if (!$this->has_entry) {
127 $query =
"UPDATE ut_lp_marks " .
128 "SET mark = " . $ilDB->quote($this->
getMark(),
'text') .
", " .
129 "u_comment = " . $ilDB->quote($this->
getComment(),
'text') .
", " .
130 "completed = " . $ilDB->quote($this->
getCompleted(),
'integer') .
" " .
131 "WHERE obj_id = " . $ilDB->quote($this->
getObjId(),
'integer') .
" " .
132 "AND usr_id = " . $ilDB->quote($this->
getUserId(),
'integer');
142 $query =
"SELECT * FROM ut_lp_marks " .
143 "WHERE usr_id = " . $ilDB->quote($a_usr_id,
'integer') .
" " .
144 "AND obj_id = " . $ilDB->quote($a_obj_id,
'integer');
148 return (
bool)
$row->completed;
157 $query =
"SELECT * FROM ut_lp_marks " .
158 "WHERE usr_id = " . $ilDB->quote($a_usr_id,
'integer') .
" " .
159 "AND obj_id = " . $ilDB->quote($a_obj_id,
'integer');
173 $query =
"SELECT * FROM ut_lp_marks " .
174 "WHERE usr_id = " . $ilDB->quote($a_usr_id,
'integer') .
" " .
175 "AND obj_id = " . $ilDB->quote($a_obj_id,
'integer');
179 return $row->u_comment;
189 $res = $this->db->query(
"SELECT * FROM ut_lp_marks " .
190 "WHERE obj_id = " . $this->db->quote($this->obj_id,
'integer') .
" " .
191 "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;
197 $this->status_changed =
$row->status_changed;
209 $query =
"INSERT INTO ut_lp_marks (mark,u_comment, completed,obj_id,usr_id) " .
211 $ilDB->quote($this->
getMark(),
'text') .
", " .
212 $ilDB->quote($this->
getComment(),
'text') .
", " .
214 $ilDB->quote($this->
getObjId(),
'integer') .
", " .
215 $ilDB->quote($this->
getUserId(),
'integer') .
" " .
218 $this->has_entry =
true;
227 $ilDB->manipulate(
"DELETE FROM ut_lp_marks" .
228 " WHERE obj_id = " . $ilDB->quote($a_obj_id,
"integer") .
229 " AND " . $ilDB->in(
"usr_id", $a_user_ids,
"",
"integer"));
238 $set = $ilDB->query(
"SELECT usr_id FROM ut_lp_marks" .
239 " WHERE obj_id = " . $ilDB->quote($a_obj_id,
"integer"));
240 while (
$row = $ilDB->fetchAssoc($set)) {
static _hasCompleted($a_usr_id, $a_obj_id)
static _getAllUserIds($a_obj_id)
foreach($_POST as $key=> $value) $res
static _deleteForUsers($a_obj_id, array $a_user_ids)
Create styles array
The data for the language used.
static deleteObject($a_obj_id)
Delete object.
__construct($a_obj_id, $a_usr_id)
static _lookupMark($a_usr_id, $a_obj_id)
static _lookupComment($a_usr_id, $a_obj_id)