39 $request = $DIC->exercise()->internal()->gui()->request();
40 $this->requested_file_hash = $request->getFileHash();
41 $this->peer_review = $DIC->exercise()->internal()->domain()->peerReview();
54 $file_manager = $this->peer_review->criteriaFile($this->ass->getId());
55 $file = $file_manager->getFile($this->giver_id, $this->peer_id, (
int) $this->
getId());
56 $files = $file ? [$file]
63 $this->peer_review->criteriaFile($this->ass->getId())
64 ->
delete($this->giver_id, $this->peer_id, $this->
getId());
72 foreach ($this->
getFiles() as $file) {
73 $existing[] = $file->getTitle();
78 $files->setValue(implode(
"<br />", $existing));
79 $files->setAllowDeletion(
true);
80 $this->
form->addItem($files);
88 $file_manager = $this->peer_review->criteriaFile($this->ass->getId());
89 if ($this->
form->getItemByPostVar(
"prccc_file_" . $this->getId())->getDeletionFlag()) {
90 $file_manager->delete($this->giver_id, $this->peer_id, $this->
getId());
91 $this->
form->getItemByPostVar(
"prccc_file_" . $this->
getId())->setValue(
"");
94 $incoming = $_FILES[
"prccc_file_" . $this->
getId()];
95 if ($incoming[
"tmp_name"]) {
96 $org_name = basename($incoming[
"name"]);
97 $file_manager->addFromLegacyUpload(
108 return count($this->
getFiles()) > 0;
119 $this->
form->getItemByPostVar(
"prccc_file_" . $this->
getId())->setAlert(
$lng->
txt(
"msg_input_is_required"));
132 $hash = trim($this->requested_file_hash);
134 foreach ($this->
getFiles() as $file) {
135 if (md5($file->getTitle()) == $hash) {
147 $crit_id = $this->
getId()
149 $ilCtrl->setParameterByClass(
152 $this->giver_id .
"__" . $this->peer_id .
"__" . $crit_id
156 foreach ($this->
getFiles() as $file) {
157 $ilCtrl->setParameterByClass(
"ilExPeerReviewGUI",
"fuf", md5($file->getTitle()));
158 $dl = $ilCtrl->getLinkTargetByClass(
"ilExPeerReviewGUI",
"downloadPeerReview");
159 $ilCtrl->setParameterByClass(
"ilExPeerReviewGUI",
"fuf",
"");
161 $files[] =
'<a href="' . $dl .
'">' . $file->getTitle() .
'</a>';
164 $ilCtrl->setParameterByClass(
"ilExPeerReviewGUI",
"fu",
"");
166 return implode(
"<br />", $files);
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
string $requested_file_hash
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
addToPeerReviewForm($a_value=null)
form( $class_path, string $cmd, string $submit_caption="")
__construct(Container $dic, ilPlugin $plugin)
ILIAS Exercise PeerReview DomainService $peer_review
importFromPeerReviewForm()