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']) {
204 if (!is_dir($savepath = $this->getAbsoluteSubmissionPath())) {
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)) {
243 "fullname" => $savepath .
"/" . $prefix .
"_" .
$filename,
259 if ($a_user_id ===
"t") {
263 $dir = $this->getFeedbackPath($a_user_id);
266 while ($file = readdir($dp)) {
267 if (!is_dir($this->path .
'/' . $file) && substr($file, 0, 1) !=
".") {
278 $fbf = $this->getFeedbackFiles($a_user_id);
284 return $this->getAbsolutePath() .
"/" . $a_file;
291 $dir = $this->getFeedbackPath($a_user_id);
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];
308 $this->getAbsolutePath() . DIRECTORY_SEPARATOR . basename(
$name),
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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)
getPathPostfix()
Get directory name.
getAbsoluteSubmissionPath()
countFeedbackFiles(string $a_user_id)
getMultiFeedbackUploadPath(int $a_user_id)
Get multi feedback upload path (each uploader handled in a separate path)
getFeedbackPath(string $a_user_id)
uploadFile(array $a_http_post_file, int $user_id, bool $is_unziped=false)
store delivered file in filesystem
string $multi_feedback_upload_path
getAssignmentFilePath(string $a_file)
create()
Create directory.
getFeedbackFiles(string $a_user_id)
init()
Append ass_<ass_id> to path (assignment id)
string $peer_review_upload_path
getFeedbackFilePath(string $a_user_id, string $a_file)
__construct(int $a_container_id=0, int $a_ass_id=0)
uploadAssignmentFiles(array $a_files)
getPathPrefix()
Get path prefix.
getAbsolutePath()
Calculates the full path on the filesystem.
static makeDirParents(string $a_dir)
Create a new directory and all parent directories.
static makeDir(string $a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
static rename(string $a_source, string $a_target)
static getValidFilename(string $a_filename)
static moveUploadedFile(string $a_file, string $a_name, string $a_target, bool $a_raise_errors=true, string $a_mode="move_uploaded")
move uploaded file
if(!file_exists(getcwd() . '/ilias.ini.php'))
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc