27 $this->db = (is_null(
$db))
44 "SELECT * FROM exc_mandatory_random " .
45 " WHERE usr_id = %s " .
47 array(
"integer",
"integer"),
48 array($user_id, $exc_id)
51 while ($rec =
$db->fetchAssoc($set)) {
53 $ass_ids[] = $rec[
"ass_id"];
71 "DELETE FROM exc_mandatory_random WHERE " .
74 array(
"integer",
"integer"),
75 array($exc_id, $user_id)
78 foreach ($ass_ids as $ass_id) {
80 $db->replace(
"exc_mandatory_random", array(
81 "usr_id" => array(
"integer", $user_id),
82 "exc_id" => array(
"integer", $exc_id),
83 "ass_id" => array(
"integer", $ass_id)
Stores info about random assignments for users in exercises.
saveAssignmentsOfUser(int $user_id, int $exc_id, array $ass_ids)
Save assignments of user.
getAssignmentsOfUser(int $user_id, int $exc_id)
Get mandatory assignments of user.
__construct(ilDBInterface $db=null)
Constructor.
static isInExercise($a_ass_id, $a_ex_id)
Is assignment in exercise?