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;
80 if($this->exc->hasAddToDesktop())
83 $tmp_user->addDesktopItem($this->
getRefId(),
"exc");
86 $ilDB->manipulate(
"DELETE FROM exc_members ".
87 "WHERE obj_id = ".$ilDB->quote($this->getObjId(),
"integer").
" ".
88 "AND usr_id = ".$ilDB->quote($a_usr_id,
"integer").
" ");
91 $ilDB->manipulateF(
"INSERT INTO exc_members (obj_id, usr_id, status, sent, feedback) ".
92 " VALUES (%s,%s,%s,%s,%s)",
93 array(
"integer",
"integer",
"text",
"integer",
"integer"),
94 array($this->
getObjId(), $a_usr_id,
'notgraded', 0, 0));
96 include_once(
"./Modules/Exercise/classes/class.ilExAssignment.php");
101 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
121 if(is_array($a_members))
123 foreach($a_members as $member)
135 if($assigned == count($a_members))
155 $tmp_user->dropDesktopItem($this->
getRefId(),
"exc");
157 $query =
"DELETE FROM exc_members ".
158 "WHERE obj_id = ".$ilDB->quote($this->
getObjId(),
"integer").
" ".
159 "AND usr_id = ".$ilDB->quote($a_usr_id,
"integer").
" ";
161 $ilDB->manipulate(
$query);
165 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
169 $this->exc->deleteAllDeliveredFilesOfUser($a_usr_id);
181 if(is_array($a_members))
183 foreach($a_members as $member)
201 $tmp_arr_members = array();
203 $query =
"SELECT * FROM exc_members ".
204 "WHERE obj_id = ".$ilDB->quote($this->
getObjId(),
"integer");
207 while(
$row = $ilDB->fetchObject(
$res))
209 $tmp_arr_members[] =
$row->usr_id;
223 $query =
"SELECT * FROM exc_members ".
224 "WHERE obj_id = ".$ilDB->quote($this->
getObjId(),
"integer");
227 while(
$row = $ilDB->fetchObject(
$res))
229 $data[] = array(
"usr_id" =>
$row->usr_id,
230 "notice" =>
$row->notice,
231 "returned" =>
$row->returned,
232 "status" =>
$row->status,
233 "sent" =>
$row->sent,
234 "feedback" =>
$row->feedback
237 foreach($data as
$row)
239 $ilDB->manipulateF(
"INSERT INTO exc_members ".
240 " (obj_id, usr_id, notice, returned, status, feedback, sent) VALUES ".
241 " (%s,%s,%s,%s,%s,%s,%s)",
242 array (
"integer",
"integer",
"text",
"integer",
"text",
"integer",
"integer"),
243 array ($a_new_id, $row[
"usr_id"], $row[
"notice"], (
int) $row[
"returned"],
244 $row[
"status"], (
int) $row[
"feedback"], (
int) $row[
"sent"])
247 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
258 $query =
"DELETE FROM exc_members WHERE obj_id = ".
259 $ilDB->quote($this->
getObjId(),
"integer");
260 $ilDB->manipulate(
$query);
262 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
273 $query =
"SELECT DISTINCT(excm.usr_id) ud".
274 " FROM exc_members excm".
275 " JOIN object_data od ON (od.obj_id = excm.usr_id)".
276 " WHERE excm.obj_id = ".$ilDB->quote($a_obj_id,
"integer").
277 " AND od.type = ".$ilDB->quote(
"usr",
"text");
280 while(
$row = $ilDB->fetchObject(
$res))
282 $usr_ids[] =
$row->ud;
285 return $usr_ids ? $usr_ids : array();
297 $query =
"SELECT DISTINCT(usr_id) as ud FROM exc_members ".
298 "WHERE obj_id = ".$ilDB->quote($a_obj_id,
"integer").
" ".
302 while(
$row = $ilDB->fetchObject(
$res))
304 $usr_ids[] =
$row->ud;
307 return $usr_ids ? $usr_ids : array();
321 $set = $ilDB->query(
"SELECT DISTINCT(usr_id) FROM exc_members WHERE ".
322 " obj_id = ".$ilDB->quote($a_obj_id,
"integer").
" AND ".
323 " returned = ".$ilDB->quote(1,
"integer").
" AND ".
324 " usr_id = ".$ilDB->quote($a_user_id,
"integer")
326 if ($rec = $ilDB->fetchAssoc($set))
340 $query =
"SELECT DISTINCT(usr_id) FROM exc_members ".
341 "WHERE obj_id = ".$ilDB->quote($a_obj_id,
"integer").
" ".
342 "AND status = ".$ilDB->quote(
"passed",
"text");
344 while(
$row = $ilDB->fetchObject(
$res))
346 $usr_ids[] =
$row->usr_id;
348 return $usr_ids ? $usr_ids : array();
358 $query =
"SELECT DISTINCT(usr_id) FROM exc_members ".
359 "WHERE obj_id = ".$ilDB->quote($a_obj_id,
"integer").
" ".
360 "AND status = ".$ilDB->quote(
"failed",
"text");
362 while(
$row = $ilDB->fetchObject(
$res))
364 $usr_ids[] =
$row->usr_id;
366 return $usr_ids ? $usr_ids : array();
383 $query =
"SELECT status FROM exc_members ".
384 "WHERE obj_id = ".$ilDB->quote($a_obj_id,
"integer").
385 " AND usr_id = ".$ilDB->quote($a_user_id,
"integer");
390 return $row[
"status"];
411 $ilDB->manipulate(
"UPDATE exc_members SET ".
412 " status = ".$ilDB->quote($a_status,
"text").
413 " WHERE obj_id = ".$ilDB->quote($a_obj_id,
"integer").
414 " AND usr_id = ".$ilDB->quote($a_user_id,
"integer")
417 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");
437 $ilDB->manipulate(
"UPDATE exc_members SET ".
438 " returned = ".$ilDB->quote($a_status,
"text").
439 " WHERE obj_id = ".$ilDB->quote($a_obj_id,
"integer").
440 " AND usr_id = ".$ilDB->quote($a_user_id,
"integer")
443 include_once(
"./Services/Tracking/classes/class.ilLPStatusWrapper.php");