26 $this->obj_id = $a_exc->getId();
27 $this->ref_id = $a_exc->getRefId();
52 $this->obj_id = $a_obj_id;
60 return $this->members ? $this->members : array();
68 $this->members = $a_members;
81 $tmp_user->addDesktopItem($this->
getRefId(),
"exc");
83 $ilDB->manipulate(
"DELETE FROM exc_members ".
84 "WHERE obj_id = ".$ilDB->quote($this->getObjId(),
"integer").
" ".
85 "AND usr_id = ".$ilDB->quote($a_usr_id,
"integer").
" ");
88 $ilDB->manipulateF(
"INSERT INTO exc_members (obj_id, usr_id, status, sent, feedback) ".
89 " VALUES (%s,%s,%s,%s,%s)",
90 array(
"integer",
"integer",
"text",
"integer",
"integer"),
91 array($this->
getObjId(), $a_usr_id,
'notgraded', 0, 0));
93 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
98 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
118 if(is_array($a_members))
120 foreach($a_members as $member)
132 if($assigned == count($a_members))
152 $tmp_user->dropDesktopItem($this->
getRefId(),
"exc");
154 $query =
"DELETE FROM exc_members ".
155 "WHERE obj_id = ".$ilDB->quote($this->
getObjId(),
"integer").
" ".
156 "AND usr_id = ".$ilDB->quote($a_usr_id,
"integer").
" ";
158 $ilDB->manipulate(
$query);
162 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
166 $this->exc->deleteAllDeliveredFilesOfUser($a_usr_id);
178 if(is_array($a_members))
180 foreach($a_members as $member)
198 $tmp_arr_members = array();
200 $query =
"SELECT * FROM exc_members ".
201 "WHERE obj_id = ".$ilDB->quote($this->
getObjId(),
"integer");
204 while(
$row = $ilDB->fetchObject(
$res))
206 $tmp_arr_members[] =
$row->usr_id;
220 $query =
"SELECT * FROM exc_members ".
221 "WHERE obj_id = ".$ilDB->quote($this->
getObjId(),
"integer");
224 while(
$row = $ilDB->fetchObject(
$res))
226 $data[] = array(
"usr_id" =>
$row->usr_id,
227 "notice" =>
$row->notice,
228 "returned" =>
$row->returned,
229 "status" =>
$row->status,
230 "sent" =>
$row->sent,
231 "feedback" =>
$row->feedback
236 $ilDB->manipulateF(
"INSERT INTO exc_members ".
237 " (obj_id, usr_id, notice, returned, status, feedback, sent) VALUES ".
238 " (%s,%s,%s,%s,%s,%s,%s)",
239 array (
"integer",
"integer",
"text",
"integer",
"text",
"integer",
"integer"),
240 array ($a_new_id, $row[
"usr_id"], $row[
"notice"], (
int) $row[
"returned"],
241 $row[
"status"], (
int) $row[
"feedback"], (
int) $row[
"sent"])
244 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
255 $query =
"DELETE FROM exc_members WHERE obj_id = ".
256 $ilDB->quote($this->
getObjId(),
"integer");
257 $ilDB->manipulate(
$query);
259 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
269 $query =
"SELECT DISTINCT(usr_id) as ud FROM exc_members ".
270 "WHERE obj_id = ".$ilDB->quote($a_obj_id,
"integer");
273 while(
$row = $ilDB->fetchObject(
$res))
275 $usr_ids[] =
$row->ud;
278 return $usr_ids ? $usr_ids : array();
290 $query =
"SELECT DISTINCT(usr_id) as ud FROM exc_members ".
291 "WHERE obj_id = ".$ilDB->quote($a_obj_id,
"integer").
" ".
295 while(
$row = $ilDB->fetchObject(
$res))
297 $usr_ids[] =
$row->ud;
300 return $usr_ids ? $usr_ids : array();
314 $set = $ilDB->query(
"SELECT DISTINCT(usr_id) FROM exc_members WHERE ".
315 " obj_id = ".$ilDB->quote($a_obj_id,
"integer").
" AND ".
316 " returned = ".$ilDB->quote(1,
"integer").
" AND ".
317 " usr_id = ".$ilDB->quote($a_user_id,
"integer")
319 if ($rec = $ilDB->fetchAssoc($set))
333 $query =
"SELECT DISTINCT(usr_id) FROM exc_members ".
334 "WHERE obj_id = ".$ilDB->quote($a_obj_id,
"integer").
" ".
335 "AND status = ".$ilDB->quote(
"passed",
"text");
337 while(
$row = $ilDB->fetchObject(
$res))
339 $usr_ids[] =
$row->usr_id;
341 return $usr_ids ? $usr_ids : array();
351 $query =
"SELECT DISTINCT(usr_id) FROM exc_members ".
352 "WHERE obj_id = ".$ilDB->quote($a_obj_id,
"integer").
" ".
353 "AND status = ".$ilDB->quote(
"failed",
"text");
355 while(
$row = $ilDB->fetchObject(
$res))
357 $usr_ids[] =
$row->usr_id;
359 return $usr_ids ? $usr_ids : array();
376 $query =
"SELECT status FROM exc_members ".
377 "WHERE obj_id = ".$ilDB->quote($a_obj_id,
"integer").
378 " AND usr_id = ".$ilDB->quote($a_user_id,
"integer");
383 return $row[
"status"];
404 $ilDB->manipulate(
"UPDATE exc_members SET ".
405 " status = ".$ilDB->quote($a_status,
"text").
406 " WHERE obj_id = ".$ilDB->quote($a_obj_id,
"integer").
407 " AND usr_id = ".$ilDB->quote($a_user_id,
"integer")
410 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
430 $ilDB->manipulate(
"UPDATE exc_members SET ".
431 " returned = ".$ilDB->quote($a_status,
"text").
432 " WHERE obj_id = ".$ilDB->quote($a_obj_id,
"integer").
433 " AND usr_id = ".$ilDB->quote($a_user_id,
"integer")
436 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");