32 protected \ilDBInterface
$db;
38 $this->db = (is_null(
$db))
45 $q =
"SELECT user_id FROM " . self::TABLE_NAME .
46 " WHERE returned_id = " . $this->db->quote($submission_id,
"integer");
47 $usr_set = $this->db->query($q);
49 $rec = $this->db->fetchAssoc($usr_set);
50 return (
int) ($rec[
"user_id"] ?? 0);
55 $query =
"SELECT * FROM " . self::TABLE_NAME .
56 " WHERE ass_id = " . $this->db->quote($assignment_id,
"integer") .
57 " AND (filename IS NOT NULL OR atext IS NOT NULL)" .
58 " AND ts IS NOT NULL";
60 return $res->numRows();
66 $this->db->manipulate(
"UPDATE " . self::TABLE_NAME .
67 " SET web_dir_access_time = " . $this->db->quote(\
ilUtil::now(),
"timestamp") .
68 " WHERE ass_id = " . $this->db->quote($assignment_id,
"integer") .
69 " AND user_id = " . $this->db->quote($member_id,
"integer"));
83 foreach ($assignment_ids as
$id) {
84 $submitted[(
int)
$id] =
false;
88 "SELECT ass_id FROM " . self::TABLE_NAME .
89 " WHERE " .
$db->
in(
"ass_id", $assignment_ids,
false,
"integer") .
90 " AND user_id = %s " .
91 " AND (filename IS NOT NULL OR atext IS NOT NULL)" .
92 " AND ts IS NOT NULL",
97 $submitted[(
int) $rec[
"ass_id"]] =
true;
101 "SELECT ret.ass_id FROM " . self::TABLE_NAME .
" ret JOIN " .
102 self::TEAM_TABLE_NAME .
" team ON (ret.team_id = team.id AND ret.ass_id = team.ass_id) " .
103 " WHERE " .
$db->
in(
"ret.ass_id", $assignment_ids,
false,
"integer") .
104 " AND team.user_id = %s " .
105 " AND (ret.filename IS NOT NULL OR ret.atext IS NOT NULL)" .
106 " AND ret.ts IS NOT NULL",
111 $submitted[(
int) $rec[
"ass_id"]] =
true;
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
hasSubmissions(int $assignment_id)
__construct(\ilDBInterface $db=null)
getUserSubmissionState(int $user_id, array $assignment_ids)
Checks if a user has submitted anything for a number of assignments.
updateWebDirAccessTime(int $assignment_id, int $member_id)
getUserId(int $submission_id)
static now()
Return current timestamp in Y-m-d H:i:s format.
Submission repository Interface.
fetchAssoc(ilDBStatement $statement)
queryF(string $query, array $types, array $values)
in(string $field, array $values, bool $negate=false, string $type="")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...