19 declare(strict_types=1);
32 protected \ilDBInterface
$db;
44 $new_id = $this->wrapper->createEmptyCollection();
48 "if_rcid" => [
"text", $new_id]
51 "id" => [
"integer", $ass_id]
58 $set = $this->db->queryF(
59 "SELECT if_rcid FROM exc_assignment " .
64 $rec = $this->db->fetchAssoc($set);
65 return ($rec[
"if_rcid"] ??
"");
71 return ($rcid !==
"");
78 return $this->wrapper->getCollectionForIdString($rcid);
90 $this->wrapper->importFilesFromLegacyUploadToCollection(
105 $this->wrapper->importFilesFromDirectoryToCollection(
113 public function deliverFile($ass_id, $file):
void 117 if ($file === $info->getTitle()) {
118 $this->wrapper->deliverFile($info->getRid());
121 throw new \ilExerciseException(
"Resource $file not found.");
128 return $this->wrapper->getCollectionResourcesInfo($collection);
139 $this->wrapper->deleteCollectionForIdString(
150 $to_rcid = $this->wrapper->clone($from_rcid);
151 if ($to_rcid !==
"") {
155 "if_rcid" => [
"text", $to_rcid]
158 "id" => [
"integer", $to_ass_id]
getCollectionResourcesInfo(int $ass_id)
deleteCollection(int $ass_id, ResourceStakeholder $stakeholder)
CollectionWrapper $wrapper
Class ResourceCollection.
getCollection(int $ass_id)
clone(int $from_ass_id, int $to_ass_id)
createCollection(int $ass_id)
CollectionWrapper $collection
hasCollection(int $ass_id)
getIdStringForAssId(int $ass_id)
__construct(CollectionWrapper $wrapper, \ilDBInterface $db)
importFromLegacyUpload(int $ass_id, array $file_input, ResourceStakeholder $stakeholder)
Interface ResourceStakeholder.
importFromDirectory(int $ass_id, string $dir, ResourceStakeholder $stakeholder)