19 declare(strict_types=1);
31 protected \ILIAS\FileUpload\FileUpload
$upload;
43 $this->
upload = $DIC->upload();
59 if (!isset($file_input[
"tmp_name"])) {
62 return $this->repo->importFromLegacyUpload(
71 if ($this->repo->hasFile($this->ass_id)) {
72 $this->repo->deliverFile($this->ass_id);
74 $ass = $this->domain->assignment()->getAssignment($this->ass_id);
76 $ass->getGlobalFeedbackFilePath(),
77 $ass->getFeedbackFile()
86 if ($this->repo->hasFile($this->ass_id)) {
87 $this->repo->clone($this->ass_id, $to_ass_id);
92 $old_storage = new \ilFSStorageExercise($old_exc_id, $this->ass_id);
93 $new_storage = new \ilFSStorageExercise($new_exc_id, $to_ass_id);
94 $new_storage->create();
95 if (is_dir($old_storage->getGlobalFeedbackPath())) {
96 \ilFileUtils::rCopy($old_storage->getGlobalFeedbackPath(), $new_storage->getGlobalFeedbackPath());
ilExcSampleSolutionStakeholder $stakeholder
ILIAS FileUpload FileUpload $upload
static rCopy(string $a_sdir, string $a_tdir, bool $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
importFromLegacyUpload(array $file_input)
static deliverFileLegacy(string $a_file, ?string $a_filename=null, ?string $a_mime=null, ?bool $isInline=false, ?bool $removeAfterDelivery=false, ?bool $a_exit_after=true)
SampleSolutionRepository $repo
InternalDomainService $domain
__construct(int $ass_id, SampleSolutionRepository $repo, \ilExcSampleSolutionStakeholder $stakeholder, InternalDomainService $domain)
Interface ResourceStakeholder.
static lookupExerciseId(int $a_ass_id)