ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilExcTutorFeedbackZipStakeholder Class Reference
+ Inheritance diagram for ilExcTutorFeedbackZipStakeholder:
+ Collaboration diagram for ilExcTutorFeedbackZipStakeholder:

Public Member Functions

 getId ()
 
 getOwnerOfNewResources ()
 
 canBeAccessedByCurrentUser (ResourceIdentification $identification)
 
 resourceHasBeenDeleted (ResourceIdentification $identification)
 
 getLocationURIForResourceUsage (ResourceIdentification $identification)
 
- Public Member Functions inherited from ILIAS\ResourceStorage\Stakeholder\AbstractResourceStakeholder
 __construct (?int $user_id_of_owner=null)
 
 setOwner (int $user_id_of_owner)
 
 getFullyQualifiedClassName ()
 
 isResourceInUse (ResourceIdentification $identification)
 
 canBeAccessedByCurrentUser (ResourceIdentification $identification)
 
 resourceHasBeenDeleted (ResourceIdentification $identification)
 
 getOwnerOfResource (ResourceIdentification $identification)
 
 getConsumerNameForPresentation ()
 
 getLocationURIForResourceUsage (ResourceIdentification $identification)
 
- Public Member Functions inherited from ILIAS\ResourceStorage\Stakeholder\ResourceStakeholder
 __construct ()
 Constructor must not have any parameters. More...
 

Protected Attributes

ilDBInterface $database = null
 
- Protected Attributes inherited from ILIAS\ResourceStorage\Stakeholder\AbstractResourceStakeholder
int $default_owner
 
int $current_user
 

Private Member Functions

 resolveObjectId (ResourceIdentification $identification)
 
 initDB ()
 

Detailed Description

Definition at line 23 of file class.ilExcTutorFeedbackZipStakeholder.php.

Member Function Documentation

◆ canBeAccessedByCurrentUser()

ilExcTutorFeedbackZipStakeholder::canBeAccessedByCurrentUser ( ResourceIdentification  $identification)

Implements ILIAS\ResourceStorage\Stakeholder\ResourceStakeholder.

Definition at line 37 of file class.ilExcTutorFeedbackZipStakeholder.php.

References $DIC, $ref_id, ilObject\_getAllReferences(), null, and resolveObjectId().

37  : bool
38  {
39  global $DIC;
40 
41  $object_id = $this->resolveObjectId($identification);
42  if ($object_id === null) {
43  return true;
44  }
45 
46  $ref_ids = ilObject2::_getAllReferences($object_id);
47  foreach ($ref_ids as $ref_id) {
48  // one must have read permissions on the exercise to see the instruction files
49  if ($DIC->access()->checkAccessOfUser($this->current_user, 'write', '', $ref_id)) {
50  return true;
51  }
52  }
53 
54  return false;
55  }
static _getAllReferences(int $id)
get all reference ids for object ID
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
$ref_id
Definition: ltiauth.php:65
global $DIC
Definition: shib_login.php:22
resolveObjectId(ResourceIdentification $identification)
+ Here is the call graph for this function:

◆ getId()

ilExcTutorFeedbackZipStakeholder::getId ( )
Returns
string not longer than 64 characters

Implements ILIAS\ResourceStorage\Stakeholder\ResourceStakeholder.

Definition at line 27 of file class.ilExcTutorFeedbackZipStakeholder.php.

27  : string
28  {
29  return 'exc_tutor_feedback_zip';
30  }

◆ getLocationURIForResourceUsage()

ilExcTutorFeedbackZipStakeholder::getLocationURIForResourceUsage ( ResourceIdentification  $identification)

Implements ILIAS\ResourceStorage\Stakeholder\ResourceStakeholder.

Definition at line 64 of file class.ilExcTutorFeedbackZipStakeholder.php.

References $ref_id, ilObject\_getAllReferences(), initDB(), null, and resolveObjectId().

64  : ?string
65  {
66  $this->initDB();
67  $object_id = $this->resolveObjectId($identification);
68  if ($object_id !== null) {
69  $references = ilObject::_getAllReferences($object_id);
70  $ref_id = array_shift($references);
71 
72  // we currently deliver the goto-url of the exercise in which the resource is used. if possible, you could deliver a more speficic url wo the assignment as well.
73  return ilLink::_getLink($ref_id, 'exc');
74  }
75  return null;
76  }
static _getAllReferences(int $id)
get all reference ids for object ID
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
$ref_id
Definition: ltiauth.php:65
resolveObjectId(ResourceIdentification $identification)
+ Here is the call graph for this function:

◆ getOwnerOfNewResources()

◆ initDB()

ilExcTutorFeedbackZipStakeholder::initDB ( )
private

Definition at line 91 of file class.ilExcTutorFeedbackZipStakeholder.php.

References $DIC, and null.

Referenced by getLocationURIForResourceUsage(), and resolveObjectId().

91  : void
92  {
93  global $DIC;
94  if ($this->database === null) {
95  $this->database = $DIC->database();
96  }
97  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
global $DIC
Definition: shib_login.php:22
+ Here is the caller graph for this function:

◆ resolveObjectId()

ilExcTutorFeedbackZipStakeholder::resolveObjectId ( ResourceIdentification  $identification)
private

Definition at line 78 of file class.ilExcTutorFeedbackZipStakeholder.php.

References Vendor\Package\$d, $r, initDB(), null, and ILIAS\ResourceStorage\Identification\AbstractIdentification\serialize().

Referenced by canBeAccessedByCurrentUser(), and getLocationURIForResourceUsage().

78  : ?int
79  {
80  $this->initDB();
81  $r = $this->database->queryF(
82  "SELECT exc_id FROM exc_assignment ass, exc_multi_feedback mf ON (ass.id = mf.ass_id) WHERE mf.zip_rid = %s;",
83  ['text'],
84  [$identification->serialize()]
85  );
86  $d = $this->database->fetchObject($r);
87 
88  return (isset($d->exc_id) ? (int) $d->exc_id : null);
89  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
$r
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resourceHasBeenDeleted()

ilExcTutorFeedbackZipStakeholder::resourceHasBeenDeleted ( ResourceIdentification  $identification)
Returns
bool true: if the Stakeholder could handle the deletion; false: if the Stakeholder could not handle the deletion of the resource.

Implements ILIAS\ResourceStorage\Stakeholder\ResourceStakeholder.

Definition at line 57 of file class.ilExcTutorFeedbackZipStakeholder.php.

57  : bool
58  {
59  // at this place we could handle de deletion of a resource. not needed for instruction files IMO.
60 
61  return true;
62  }

Field Documentation

◆ $database

ilDBInterface ilExcTutorFeedbackZipStakeholder::$database = null
protected

Definition at line 25 of file class.ilExcTutorFeedbackZipStakeholder.php.


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