24 include_once(
'Services/FileSystem/classes/class.ilFileSystemStorage.php');
39 public function __construct($a_container_id = 0, $a_ass_id = 0)
41 $this->ass_id = $a_ass_id;
42 parent::__construct(self::STORAGE_DATA,
true, $a_container_id);
51 if ($this->ass_id > 0) {
52 $this->submission_path = $this->path .
"/subm_" . $this->ass_id;
53 $this->tmp_path = $this->path .
"/tmp_" . $this->ass_id;
54 $this->feedb_path = $this->path .
"/feedb_" . $this->ass_id;
55 $this->multi_feedback_upload_path = $this->path .
"/mfb_up_" . $this->ass_id;
56 $this->peer_review_upload_path = $this->path .
"/peer_up_" . $this->ass_id;
57 $this->path .=
"/ass_" . $this->ass_id;
93 return $this->submission_path;
101 return $this->tmp_path;
109 $path = $this->feedb_path .
"/" . $a_user_id;
110 if (!file_exists(
$path)) {
118 $path = $this->feedb_path .
"/0";
119 if (!file_exists(
$path)) {
131 $path = $this->multi_feedback_upload_path .
"/" . $a_user_id;
132 if (!file_exists(
$path)) {
144 $path = $this->peer_review_upload_path .
"/" . $a_peer_id .
"/" . $a_giver_id .
"/";
146 if ((
int) $a_crit_id) {
147 $path .= (int) $a_crit_id .
"/";
149 if (!file_exists(
$path)) {
164 if (!file_exists($this->submission_path)) {
167 if (!file_exists($this->tmp_path)) {
170 if (!file_exists($this->feedb_path)) {
182 if (!is_dir($this->path)) {
186 $dp = opendir($this->path);
187 while ($file = readdir($dp)) {
188 if (!is_dir($this->path .
'/' . $file)) {
191 'size' => filesize($this->path .
'/' . $file),
192 'ctime' => filectime($this->path .
'/' . $file),
193 'fullpath' => $this->path .
'/' . $file);
213 public function uploadFile($a_http_post_file, $user_id, $is_unziped =
false)
222 if (isset($a_http_post_file) && $a_http_post_file[
'size']) {
225 include_once(
"./Services/Utilities/classes/class.ilFileUtils.php");
236 $savepath .=
'/' . $user_id;
237 if (!is_dir($savepath)) {
242 if (!is_dir($savepath)) {
247 "%04d%02d%02d%02d%02d%02d",
257 ilUtil::moveUploadedFile(
258 $a_http_post_file[
"tmp_name"],
260 $savepath .
"/" . $prefix .
"_" . $filename
264 $a_http_post_file[
'tmp_name'],
265 $savepath .
"/" . $prefix .
"_" .
$filename 269 require_once
"./Services/MediaObjects/classes/class.ilObjMediaObject.php";
270 if (is_file($savepath .
"/" . $prefix .
"_" .
$filename)) {
272 "filename" => $prefix .
"_" . $filename,
273 "fullname" => $savepath .
"/" . $prefix .
"_" . $filename,
291 while ($file = readdir($dp)) {
292 if (!is_dir($this->path .
'/' . $file) && substr($file, 0, 1) !=
".") {
324 return $dir .
"/" . $a_file;
333 if (is_array($a_files[
"name"])) {
334 foreach ($a_files[
"name"] as $k =>
$name) {
336 $type = $a_files[
"type"][$k];
337 $tmp_name = $a_files[
"tmp_name"][$k];
338 $size = $a_files[
"size"][$k];
339 ilUtil::moveUploadedFile(
342 $this->path . DIRECTORY_SEPARATOR . basename(
$name),
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
static makeDirParents($a_dir)
Create a new directory and all parent directories.
getAbsoluteSubmissionPath()
Get submission path.
init()
Append ass_<ass_id> to path (assignment id)
uploadFile($a_http_post_file, $user_id, $is_unziped=false)
store delivered file in filesystem
__construct($a_container_id=0, $a_ass_id=0)
Constructor.
getFeedbackFiles($a_user_id)
Get number of feedback files.
getTempPath()
Get submission path.
getAssignmentFilePath($a_file)
Get path for assignment file.
uploadAssignmentFiles($a_files)
Upload assignment files (e.g.
getFeedbackPath($a_user_id)
Get feedback path.
getFiles()
Get assignment files.
getPeerReviewUploadPath($a_peer_id, $a_giver_id, $a_crit_id)
Get pear review upload path (each peer handled in a separate path)
getAbsolutePath()
Get absolute path of storage directory.
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
create()
Create directory.
getMultiFeedbackUploadPath($a_user_id)
Get multi feedback upload path (each uploader handled in a separate path)
countFeedbackFiles($a_user_id)
Count number of feedback files for a user.
while(count($oldTaskList) > 0) foreach(array_keys($newTaskList) as $task) init()
getPathPostfix()
Implementation of abstract method.
static getValidFilename($a_filename)
Get valid filename.
getFeedbackFilePath($a_user_id, $a_file)
Get path for feedback file.
getPathPrefix()
Implementation of abstract method.