32 int $a_container_id = 0,
35 $this->ass_id = $a_ass_id;
42 public function init(): bool
45 if ($this->ass_id > 0) {
82 $path = $this->feedb_path .
"/" . $a_user_id;
83 if (!file_exists(
$path)) {
91 $path = $this->feedb_path .
"/0";
92 if (!file_exists(
$path)) {
105 $path = $this->multi_feedback_upload_path .
"/" . $a_user_id;
106 if (!file_exists(
$path)) {
119 ?
int $a_crit_id = null
121 $path = $this->peer_review_upload_path .
"/" . $a_peer_id .
"/" . $a_giver_id .
"/";
123 if ((
int) $a_crit_id !== 0) {
126 if (!file_exists(
$path)) {
138 if (!file_exists($this->submission_path)) {
141 if (!file_exists($this->tmp_path)) {
144 if (!file_exists($this->feedb_path)) {
152 if (!is_dir($this->path)) {
156 $dp = opendir($this->path);
157 while ($file = readdir($dp)) {
158 if (!is_dir($this->path .
'/' . $file)) {
161 'size' => filesize($this->path .
'/' . $file),
162 'ctime' => filectime($this->path .
'/' . $file),
163 'fullpath' => $this->path .
'/' . $file);
185 array $a_http_post_file,
187 bool $is_unziped =
false 195 if (isset($a_http_post_file) && $a_http_post_file[
'size']) {
207 $savepath .=
'/' . $user_id;
208 if (!is_dir($savepath)) {
213 if (!is_dir($savepath)) {
218 "%04d%02d%02d%02d%02d%02d",
229 $a_http_post_file[
"tmp_name"],
231 $savepath .
"/" . $prefix .
"_" . $filename
235 $a_http_post_file[
'tmp_name'],
236 $savepath .
"/" . $prefix .
"_" .
$filename 240 if (is_file($savepath .
"/" . $prefix .
"_" .
$filename)) {
242 "filename" => $prefix .
"_" . $filename,
243 "fullname" => $savepath .
"/" . $prefix .
"_" . $filename,
259 if ($a_user_id ===
"t") {
266 while ($file = readdir($dp)) {
267 if (!is_dir($this->path .
'/' . $file) && substr($file, 0, 1) !=
".") {
292 return $dir .
"/" . $a_file;
301 if (is_array($a_files[
"name"])) {
302 foreach ($a_files[
"name"] as $k =>
$name) {
304 $tmp_name = $a_files[
"tmp_name"][$k];
getFeedbackPath(string $a_user_id)
getAbsoluteSubmissionPath()
init()
Append ass_<ass_id> to path (assignment id)
getMultiFeedbackUploadPath(int $a_user_id)
Get multi feedback upload path (each uploader handled in a separate path)
getFeedbackFilePath(string $a_user_id, string $a_file)
static getValidFilename(string $a_filename)
getPeerReviewUploadPath(int $a_peer_id, int $a_giver_id, ?int $a_crit_id=null)
Get pear review upload path (each peer handled in a separate path)
static makeDirParents(string $a_dir)
Create a new directory and all parent directories.
countFeedbackFiles(string $a_user_id)
string $multi_feedback_upload_path
static moveUploadedFile(string $a_file, string $a_name, string $a_target, bool $a_raise_errors=true, string $a_mode="move_uploaded")
move uploaded file
getAbsolutePath()
Calculates the full path on the filesystem.
__construct(int $a_container_id=0, int $a_ass_id=0)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
create()
Create directory.
__construct(Container $dic, ilPlugin $plugin)
uploadAssignmentFiles(array $a_files)
static rename(string $a_source, string $a_target)
getFeedbackFiles(string $a_user_id)
getAssignmentFilePath(string $a_file)
uploadFile(array $a_http_post_file, int $user_id, bool $is_unziped=false)
store delivered file in filesystem
static makeDir(string $a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
string $peer_review_upload_path
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)