40 $request =
$DIC->exercise()->internal()->gui()->request();
41 $this->requested_file_hash = $request->getFileHash();
42 $this->peer_review =
$DIC->exercise()->internal()->domain()->peerReview();
55 $file_manager = $this->peer_review->criteriaFile($this->ass->getId());
56 $file = $file_manager->getFile($this->giver_id, $this->peer_id, (
int) $this->
getId());
57 $files = $file ? [$file]
64 $this->peer_review->criteriaFile($this->ass->getId())
65 ->delete($this->giver_id, $this->peer_id, $this->
getId());
73 foreach ($this->
getFiles() as $file) {
74 $existing[] = $file->getTitle();
79 $files->setValue(implode(
"<br />", $existing));
80 $files->setAllowDeletion(
true);
81 $this->
form->addItem($files);
89 $file_manager = $this->peer_review->criteriaFile($this->ass->getId());
90 if ($this->
form->getItemByPostVar(
"prccc_file_" . $this->getId())->getDeletionFlag()) {
91 $file_manager->delete($this->giver_id, $this->peer_id, $this->
getId());
92 $this->
form->getItemByPostVar(
"prccc_file_" . $this->
getId())->setValue(
"");
95 $incoming = $_FILES[
"prccc_file_" . $this->
getId()];
96 if ($incoming[
"tmp_name"]) {
97 $org_name = basename($incoming[
"name"]);
98 $file_manager->addFromLegacyUpload(
109 return count($this->
getFiles()) > 0;
120 $this->
form->getItemByPostVar(
"prccc_file_" . $this->
getId())->setAlert(
$lng->
txt(
"msg_input_is_required"));
130 $hash = trim($this->requested_file_hash);
132 foreach ($this->
getFiles() as $file) {
133 if (md5($file->getTitle()) == $hash) {
145 $crit_id = $this->
getId()
147 $ilCtrl->setParameterByClass(
150 $this->giver_id .
"__" . $this->peer_id .
"__" . $crit_id
154 foreach ($this->
getFiles() as $file) {
155 $ilCtrl->setParameterByClass(
"ilExPeerReviewGUI",
"fuf", md5($file->getTitle()));
156 $dl = $ilCtrl->getLinkTargetByClass(
"ilExPeerReviewGUI",
"downloadPeerReview");
157 $ilCtrl->setParameterByClass(
"ilExPeerReviewGUI",
"fuf",
"");
159 $files[] =
'<a href="' . $dl .
'">' . $file->getTitle() .
'</a>';
162 $ilCtrl->setParameterByClass(
"ilExPeerReviewGUI",
"fu",
"");
164 return implode(
"<br />", $files);
string $requested_file_hash
addToPeerReviewForm($a_value=null)
ILIAS Exercise PeerReview DomainService $peer_review
importFromPeerReviewForm()
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...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
form(?array $class_path, string $cmd, string $submit_caption="")