19 declare(strict_types=1);
32 protected \ilDBInterface
$db;
44 $set = $this->db->queryF(
45 "SELECT id FROM il_exc_team " .
46 " WHERE ass_id = %s AND user_id = %s",
47 [
"integer",
"integer"],
50 if ($rec = $this->db->fetchAssoc($set)) {
51 return (
int) $rec[
"id"];
58 $team_id = $this->
getTeamId($ass_id, $user_id);
62 $new_id = $this->wrapper->createEmptyCollection();
66 "feedback_rcid" => [
"text", $new_id]
69 "id" => [
"integer", $team_id]
76 $set = $this->db->queryF(
77 "SELECT id FROM exc_team_data " .
78 " WHERE feedback_rcid = %s",
82 $rec = $this->db->fetchAssoc($set);
83 return (
int) ($rec[
"id"] ?? 0);
89 $team_id = $this->
getTeamId($ass_id, $user_id);
93 $set = $this->db->queryF(
94 "SELECT feedback_rcid FROM exc_team_data " .
99 $rec = $this->db->fetchAssoc($set);
100 return ($rec[
"if_rcid"] ??
"");
106 return ($rcid !==
"");
113 return $this->wrapper->getCollectionForIdString($rcid);
120 if (!is_null($collection = $this->
getCollection($ass_id, $user_id))) {
121 return $collection->count();
126 public function deliverFile(
$ass_id, $participant_id, $file):
void 130 if ($file === $info->getTitle()) {
131 $this->wrapper->deliverFile($info->getRid());
134 throw new \ilExerciseException(
"Resource $file not found.");
140 if ($rid === $info->getRid()) {
141 $this->wrapper->deliverFile($info->getRid());
142 return $info->getTitle();
153 return $this->wrapper->getCollectionResourcesInfo($collection);
161 throw new \ilExerciseException(
"Collection cannot be deleted for user in team assignment $ass_id.");
168 $set = $this->db->queryF(
169 "SELECT feedback_rcid FROM exc_team_data " .
174 $rec = $this->db->fetchAssoc($set);
175 $rcid = $rec[
"feedback_rcid"] ??
"";
177 $this->wrapper->deleteCollectionForIdString($rcid, $stakeholder);
deleteCollection(int $ass_id, int $user_id, ResourceStakeholder $stakeholder)
getIdStringForAssIdAndUserId(int $ass_id, int $user_id)
hasCollection(int $ass_id, int $user_id)
createCollection(int $ass_id, int $user_id)
getTeamId(int $ass_id, int $user_id)
Class ResourceCollection.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
__construct(IRSSWrapper $wrapper, \ilDBInterface $db)
getFilenameForRid(int $ass_id, int $part_id, string $rid)
getCollectionResourcesInfo(int $ass_id, int $user_id)
deleteTeamCollection(int $team_id, ResourceStakeholder $stakeholder)
count(int $ass_id, int $user_id)
Interface ResourceStakeholder.
getParticipantIdForRcid(int $ass_id, string $rcid)
getCollection(int $ass_id, int $user_id)