57 $ilObjDataCache = $DIC[
'ilObjDataCache'];
62 $this->obj_id = $a_obj_id;
63 $this->usr_id = $a_usr_id;
64 $this->obj_type = $ilObjDataCache->lookupType($this->obj_id);
80 $query =
"DELETE FROM ut_lp_marks " .
81 "WHERE obj_id = " .
$ilDB->quote($a_obj_id,
'integer');
93 $this->mark = $a_mark;
109 $this->completed = (bool) $a_status;
129 $ilDB = $DIC[
'ilDB'];
131 if (!$this->has_entry) {
134 $query =
"UPDATE ut_lp_marks " .
135 "SET mark = " .
$ilDB->quote($this->
getMark(),
'text') .
", " .
138 "WHERE obj_id = " .
$ilDB->quote($this->
getObjId(),
'integer') .
" " .
149 $ilDB = $DIC[
'ilDB'];
151 $query =
"SELECT * FROM ut_lp_marks " .
152 "WHERE usr_id = " .
$ilDB->quote($a_usr_id,
'integer') .
" " .
153 "AND obj_id = " .
$ilDB->quote($a_obj_id,
'integer');
157 return (
bool)
$row->completed;
173 $ilDB = $DIC[
'ilDB'];
175 $query =
"SELECT * FROM ut_lp_marks " .
176 "WHERE usr_id = " .
$ilDB->quote($user_id,
'integer') .
178 " AND status_changed >= " .
$ilDB->quote(
$from,
"timestamp") .
179 " AND status_changed <= " .
$ilDB->quote($to,
"timestamp");
182 $completions = array();
183 while ($rec =
$ilDB->fetchAssoc($set)) {
184 $completions[] = $rec;
195 $ilDB = $DIC[
'ilDB'];
197 $query =
"SELECT * FROM ut_lp_marks " .
198 "WHERE usr_id = " .
$ilDB->quote($a_usr_id,
'integer') .
" " .
199 "AND obj_id = " .
$ilDB->quote($a_obj_id,
'integer');
213 $ilDB = $DIC[
'ilDB'];
215 $query =
"SELECT * FROM ut_lp_marks " .
216 "WHERE usr_id = " .
$ilDB->quote($a_usr_id,
'integer') .
" " .
217 "AND obj_id = " .
$ilDB->quote($a_obj_id,
'integer');
221 return $row->u_comment;
231 $ilDB = $DIC[
'ilDB'];
233 $res = $this->db->query(
"SELECT * FROM ut_lp_marks " .
234 "WHERE obj_id = " . $this->db->quote($this->obj_id,
'integer') .
" " .
235 "AND usr_id = " .
$ilDB->quote($this->usr_id,
'integer'));
237 $this->has_entry =
true;
238 $this->completed = (int)
$row->completed;
239 $this->comment =
$row->u_comment;
240 $this->mark =
$row->mark;
241 $this->status_changed =
$row->status_changed;
253 $ilDB = $DIC[
'ilDB'];
255 $query =
"INSERT INTO ut_lp_marks (mark,u_comment, completed,obj_id,usr_id) " .
264 $this->has_entry =
true;
273 $ilDB = $DIC[
'ilDB'];
275 $ilDB->manipulate(
"DELETE FROM ut_lp_marks" .
276 " WHERE obj_id = " .
$ilDB->quote($a_obj_id,
"integer") .
277 " AND " .
$ilDB->in(
"usr_id", $a_user_ids,
"",
"integer"));
284 $ilDB = $DIC[
'ilDB'];
288 $set =
$ilDB->query(
"SELECT usr_id FROM ut_lp_marks" .
289 " WHERE obj_id = " .
$ilDB->quote($a_obj_id,
"integer"));
const LP_STATUS_COMPLETED_NUM
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)
static getCompletionsOfUser($user_id, $from, $to)
Get completions of user.
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)