5 include_once
"Modules/Exercise/classes/class.ilExcCriteria.php";
32 parent::__construct();
34 $this->lng = $DIC->language();
35 $this->ctrl = $DIC->ctrl();
45 include_once(
"./Modules/Exercise/classes/class.ilFSStorageExercise.php");
58 include_once(
"./Modules/Exercise/classes/class.ilFSStorageExercise.php");
60 $storage->
deleteDirectory($storage->getPeerReviewUploadPath($this->peer_id, $this->giver_id, $this->getId()));
70 $existing[] = basename($file);
76 $files->setValue(implode(
"<br />", $existing));
77 $files->setALlowDeletion(
true);
78 $this->form->addItem(
$files);
85 if ($this->form->getItemByPostVar(
"prccc_file_" . $this->getId())->getDeletionFlag()) {
87 $this->form->getItemByPostVar(
"prccc_file_" . $this->
getId())->setValue(null);
90 $incoming = $_FILES[
"prccc_file_" . $this->
getId()];
91 if ($incoming[
"tmp_name"]) {
92 $org_name = basename($incoming[
"name"]);
94 ilUtil::moveUploadedFile(
95 $incoming[
"tmp_name"],
105 return (
bool)
sizeof($this->
getFiles());
116 $this->form->getItemByPostVar(
"prccc_file_" . $this->
getId())->setAlert(
$lng->txt(
"msg_input_is_required"));
126 $hash = trim(
$_GET[
"fuf"]);
129 if (md5($file) == $hash) {
140 $crit_id = $this->
getId()
143 $ilCtrl->setParameterByClass(
"ilExPeerReviewGUI",
"fu", $this->giver_id .
"__" . $this->peer_id .
"__" . $crit_id);
147 $ilCtrl->setParameterByClass(
"ilExPeerReviewGUI",
"fuf", md5($file));
148 $dl =
$ilCtrl->getLinkTargetByClass(
"ilExPeerReviewGUI",
"downloadPeerReview");
149 $ilCtrl->setParameterByClass(
"ilExPeerReviewGUI",
"fuf",
"");
151 $files[] =
'<a href="' . $dl .
'">' . basename($file) .
'</a>';
154 $ilCtrl->setParameterByClass(
"ilExPeerReviewGUI",
"fu",
"");
156 return implode(
"<br />",
$files);
deleteDirectory($a_abs_name)
Delete directory.
addToPeerReviewForm($a_value=null)
getPeerReviewUploadPath($a_peer_id, $a_giver_id, $a_crit_id)
Get pear review upload path (each peer handled in a separate path)
Create styles array
The data for the language used.
__construct()
Constructor.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
importFromPeerReviewForm()