ILIAS  trunk Revision v11.0_alpha-1862-g4e205cb56d4
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\Exercise\SampleSolution\SampleSolutionRepository Class Reference
+ Collaboration diagram for ILIAS\Exercise\SampleSolution\SampleSolutionRepository:

Public Member Functions

 __construct (IRSSWrapper $wrapper, \ilDBInterface $db)
 
 getIdStringForAssId (int $ass_id)
 
 hasFile (int $ass_id)
 
 deliverFile (int $ass_id)
 
 getFilename (int $ass_id)
 
 importFromLegacyUpload (int $ass_id, array $file_input, ResourceStakeholder $stakeholder)
 
 clone (int $from_ass_id, int $to_ass_id)
 

Protected Attributes

IRSSWrapper $wrapper
 
ilDBInterface $db
 

Detailed Description

Definition at line 26 of file SampleSolutionRepository.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Exercise\SampleSolution\SampleSolutionRepository::__construct ( IRSSWrapper  $wrapper,
\ilDBInterface  $db 
)

Member Function Documentation

◆ clone()

ILIAS\Exercise\SampleSolution\SampleSolutionRepository::clone ( int  $from_ass_id,
int  $to_ass_id 
)

Definition at line 98 of file SampleSolutionRepository.php.

References ILIAS\Exercise\SampleSolution\SampleSolutionRepository\getIdStringForAssId().

101  : void {
102  $from_rid = $this->getIdStringForAssId($from_ass_id);
103  $to_rid = $this->wrapper->cloneResource($from_rid);
104  if ($to_rid !== "") {
105  $this->db->update(
106  "exc_assignment",
107  [
108  "solution_rid" => ["text", $to_rid]
109  ],
110  [ // where
111  "id" => ["integer", $to_ass_id]
112  ]
113  );
114  }
115  }
+ Here is the call graph for this function:

◆ deliverFile()

ILIAS\Exercise\SampleSolution\SampleSolutionRepository::deliverFile ( int  $ass_id)

Definition at line 57 of file SampleSolutionRepository.php.

References ILIAS\Exercise\SampleSolution\SampleSolutionRepository\getIdStringForAssId().

57  : void
58  {
59  $rid = $this->getIdStringForAssId($ass_id);
60  $this->wrapper->deliverFile($rid);
61  }
+ Here is the call graph for this function:

◆ getFilename()

ILIAS\Exercise\SampleSolution\SampleSolutionRepository::getFilename ( int  $ass_id)

Definition at line 63 of file SampleSolutionRepository.php.

References ILIAS\Exercise\SampleSolution\SampleSolutionRepository\getIdStringForAssId().

63  : string
64  {
65  $rid = $this->getIdStringForAssId($ass_id);
66  if ($rid !== "") {
67  $info = $this->wrapper->getResourceInfo($rid);
68  return $info->getTitle();
69  }
70  return "";
71  }
+ Here is the call graph for this function:

◆ getIdStringForAssId()

ILIAS\Exercise\SampleSolution\SampleSolutionRepository::getIdStringForAssId ( int  $ass_id)

Definition at line 39 of file SampleSolutionRepository.php.

Referenced by ILIAS\Exercise\SampleSolution\SampleSolutionRepository\clone(), ILIAS\Exercise\SampleSolution\SampleSolutionRepository\deliverFile(), ILIAS\Exercise\SampleSolution\SampleSolutionRepository\getFilename(), and ILIAS\Exercise\SampleSolution\SampleSolutionRepository\hasFile().

39  : string
40  {
41  $set = $this->db->queryF(
42  "SELECT solution_rid FROM exc_assignment " .
43  " WHERE id = %s ",
44  ["integer"],
45  [$ass_id]
46  );
47  $rec = $this->db->fetchAssoc($set);
48  return ($rec["solution_rid"] ?? "");
49  }
+ Here is the caller graph for this function:

◆ hasFile()

ILIAS\Exercise\SampleSolution\SampleSolutionRepository::hasFile ( int  $ass_id)

Definition at line 51 of file SampleSolutionRepository.php.

References ILIAS\Exercise\SampleSolution\SampleSolutionRepository\getIdStringForAssId().

51  : bool
52  {
53  $rid = $this->getIdStringForAssId($ass_id);
54  return ($rid !== "");
55  }
+ Here is the call graph for this function:

◆ importFromLegacyUpload()

ILIAS\Exercise\SampleSolution\SampleSolutionRepository::importFromLegacyUpload ( int  $ass_id,
array  $file_input,
ResourceStakeholder  $stakeholder 
)

Definition at line 74 of file SampleSolutionRepository.php.

78  : string {
79  $rcid = $this->wrapper->importFileFromLegacyUpload(
80  $file_input,
81  $stakeholder
82  );
83  if ($rcid !== "") {
84  $this->db->update(
85  "exc_assignment",
86  [
87  "fb_file" => ["text", $file_input["name"]],
88  "solution_rid" => ["text", $rcid]
89  ],
90  [ // where
91  "id" => ["integer", $ass_id]
92  ]
93  );
94  }
95  return $rcid;
96  }

Field Documentation

◆ $db

ilDBInterface ILIAS\Exercise\SampleSolution\SampleSolutionRepository::$db
protected

◆ $wrapper

IRSSWrapper ILIAS\Exercise\SampleSolution\SampleSolutionRepository::$wrapper
protected

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