19declare(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"] ??
"");
65 $this->wrapper->deleteResource($rid, $stakeholder);
74 $rid = $this->wrapper->importFileFromUploadResult(
82 "tutor_id" => [
"integer", $tutor_id],
83 "ass_id" => [
"integer",
$ass_id],
86 "zip_rid" => [
"text", $rid]
96 $rid = $this->getIdStringForAssAndTutorId(
$ass_id, $tutor_id);
98 $zip = new \ZipArchive();
99 if ($zip->open($this->wrapper->stream($rid)->getMetadata()[
'uri'], \ZipArchive::RDONLY)) {
100 $cnt = $zip->count();
101 for ($i = 0; $i < $cnt; $i++) {
102 $full_entry = $zip->getNameIndex($i);
103 $main_parts = explode(
"/", $full_entry);
104 if (count($main_parts) === 3 && trim($main_parts[2]) !==
""
105 && substr($main_parts[2], 0, 1) !==
".") {
106 $dir = $main_parts[1];
107 $file = $main_parts[2];
108 $dir_parts = explode(
"_", $dir);
109 $user_id = (
int) $dir_parts[count($dir_parts) - 1];
110 if (in_array(
$user_id, $valid_members)) {
114 "lastname" => $name[
"lastname"],
115 "firstname" => $name[
"firstname"],
116 "login" => $name[
"login"],
117 "user_id" => (
int) $name[
"user_id"],
118 "full_entry" => $full_entry,
136 $rid = $this->getIdStringForAssAndTutorId(
$ass_id, $tutor_id);
138 $this->wrapper->addEntryOfZipResourceToCollection(
importFromUploadResult(int $ass_id, int $tutor_id, UploadResult $result, ResourceStakeholder $stakeholder)
getFiles(int $ass_id, int $tutor_id, array $valid_members)
__construct(IRSSWrapper $wrapper, \ilDBInterface $db)
hasFile(int $ass_id, int $tutor_id)
deleteCurrent(int $ass_id, int $tutor_id, ResourceStakeholder $stakeholder)
getIdStringForAssAndTutorId(int $ass_id, int $tutor_id)
addFileFromZipToCollection(int $ass_id, int $tutor_id, string $entry, ResourceCollection $target_collection, ResourceStakeholder $target_stakeholder)
Class ResourceCollection.
static _lookupName(int $a_user_id)
Interface ResourceStakeholder.