19 declare(strict_types=1);
31 protected \ilDBInterface
$db;
43 $set = $this->db->queryF(
44 "SELECT zip_rid FROM exc_multi_feedback " .
45 " WHERE ass_id = %s AND tutor_id = %s ",
46 [
"integer",
"integer"],
49 $rec = $this->db->fetchAssoc($set);
50 return ($rec[
"zip_rid"] ??
"");
72 $this->wrapper->deleteResource($rid, $stakeholder);
81 $rid = $this->wrapper->importFileFromUploadResult(
89 "tutor_id" => [
"integer", $tutor_id],
90 "ass_id" => [
"integer", $ass_id],
93 "zip_rid" => [
"text", $rid]
105 $zip = new \ZipArchive();
106 if ($zip->open($this->wrapper->stream($rid)->getMetadata()[
'uri'], \ZipArchive::RDONLY)) {
107 $cnt = $zip->count();
108 for ($i = 0; $i < $cnt; $i++) {
109 $full_entry = $zip->getNameIndex($i);
110 $main_parts = explode(
"/", $full_entry);
111 if (count($main_parts) === 3 && trim($main_parts[2]) !==
"" 112 && substr($main_parts[2], 0, 1) !==
".") {
113 $dir = $main_parts[1];
114 $file = $main_parts[2];
115 $dir_parts = explode(
"_", $dir);
116 $user_id = (
int) $dir_parts[count($dir_parts) - 1];
117 if (in_array(
$user_id, $valid_members)) {
121 "lastname" => $name[
"lastname"],
122 "firstname" => $name[
"firstname"],
123 "login" => $name[
"login"],
124 "user_id" => (
int) $name[
"user_id"],
125 "full_entry" => $full_entry,
145 $this->wrapper->addEntryOfZipResourceToCollection(
getIdStringForAssAndTutorId(int $ass_id, int $tutor_id)
static _lookupName(int $a_user_id)
lookup user name
Class ResourceCollection.
getFiles(int $ass_id, int $tutor_id, array $valid_members)
importFromUploadResult(int $ass_id, int $tutor_id, UploadResult $result, ResourceStakeholder $stakeholder)
hasFile(int $ass_id, int $tutor_id)
__construct(IRSSWrapper $wrapper, \ilDBInterface $db)
addFileFromZipToCollection(int $ass_id, int $tutor_id, string $entry, ResourceCollection $target_collection, ResourceStakeholder $target_stakeholder)
deleteCurrent(int $ass_id, int $tutor_id, ResourceStakeholder $stakeholder)
Interface ResourceStakeholder.