ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ILIAS\Exercise\SampleSolution\SampleSolutionManager Class Reference
+ Collaboration diagram for ILIAS\Exercise\SampleSolution\SampleSolutionManager:

Public Member Functions

 __construct (int $ass_id, SampleSolutionRepository $repo, \ilExcSampleSolutionStakeholder $stakeholder, InternalDomainService $domain)
 
 getStakeholder ()
 
 importFromLegacyUpload (array $file_input)
 
 deliver ()
 
 cloneTo (int $to_ass_id)
 

Protected Attributes

ilExcSampleSolutionStakeholder $stakeholder
 
int $ass_id
 
ILIAS FileUpload FileUpload $upload
 
InternalDomainService $domain
 
SampleSolutionRepository $repo
 

Detailed Description

Definition at line 27 of file SampleSolutionManager.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Exercise\SampleSolution\SampleSolutionManager::__construct ( int  $ass_id,
SampleSolutionRepository  $repo,
\ilExcSampleSolutionStakeholder  $stakeholder,
InternalDomainService  $domain 
)

Member Function Documentation

◆ cloneTo()

ILIAS\Exercise\SampleSolution\SampleSolutionManager::cloneTo ( int  $to_ass_id)

Definition at line 82 of file SampleSolutionManager.php.

References ilExAssignment\lookupExerciseId(), and ilFileUtils\rCopy().

84  : void {
85  // IRSS
86  if ($this->repo->hasFile($this->ass_id)) {
87  $this->repo->clone($this->ass_id, $to_ass_id);
88  } else { // NO IRSS
89  $old_exc_id = \ilExAssignment::lookupExerciseId($this->ass_id);
90  $new_exc_id = \ilExAssignment::lookupExerciseId($to_ass_id);
91 
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());
97  }
98  }
99  }
static rCopy(string $a_sdir, string $a_tdir, bool $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
static lookupExerciseId(int $a_ass_id)
+ Here is the call graph for this function:

◆ deliver()

ILIAS\Exercise\SampleSolution\SampleSolutionManager::deliver ( )

Definition at line 69 of file SampleSolutionManager.php.

References ilFileDelivery\deliverFileLegacy().

69  : void
70  {
71  if ($this->repo->hasFile($this->ass_id)) {
72  $this->repo->deliverFile($this->ass_id);
73  } else {
74  $ass = $this->domain->assignment()->getAssignment($this->ass_id);
76  $ass->getGlobalFeedbackFilePath(),
77  $ass->getFeedbackFile()
78  );
79  }
80  }
static deliverFileLegacy(string $a_file, ?string $a_filename=null, ?string $a_mime=null, ?bool $isInline=false, ?bool $removeAfterDelivery=false, ?bool $a_exit_after=true)
+ Here is the call graph for this function:

◆ getStakeholder()

ILIAS\Exercise\SampleSolution\SampleSolutionManager::getStakeholder ( )

Definition at line 51 of file SampleSolutionManager.php.

References ILIAS\Exercise\SampleSolution\SampleSolutionManager\$stakeholder.

51  : ResourceStakeholder
52  {
53  return $this->stakeholder;
54  }

◆ importFromLegacyUpload()

ILIAS\Exercise\SampleSolution\SampleSolutionManager::importFromLegacyUpload ( array  $file_input)

Definition at line 57 of file SampleSolutionManager.php.

57  : string
58  {
59  if (!isset($file_input["tmp_name"])) {
60  return "";
61  }
62  return $this->repo->importFromLegacyUpload(
63  $this->ass_id,
64  $file_input,
65  $this->stakeholder
66  );
67  }

Field Documentation

◆ $ass_id

int ILIAS\Exercise\SampleSolution\SampleSolutionManager::$ass_id
protected

◆ $domain

InternalDomainService ILIAS\Exercise\SampleSolution\SampleSolutionManager::$domain
protected

◆ $repo

SampleSolutionRepository ILIAS\Exercise\SampleSolution\SampleSolutionManager::$repo
protected

◆ $stakeholder

ilExcSampleSolutionStakeholder ILIAS\Exercise\SampleSolution\SampleSolutionManager::$stakeholder
protected

◆ $upload

ILIAS FileUpload FileUpload ILIAS\Exercise\SampleSolution\SampleSolutionManager::$upload
protected

Definition at line 31 of file SampleSolutionManager.php.


The documentation for this class was generated from the following file: