ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilExcRepoObjAssignmentInfo Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilExcRepoObjAssignmentInfo:
+ Collaboration diagram for ilExcRepoObjAssignmentInfo:

Public Member Functions

 getId ()
 
 getTitle ()
 
 getLinks ()
 
 isUserSubmission ()
 Check if this object has been submitted by the user provided or its team. More...
 
 getExerciseId ()
 
 getExerciseTitle ()
 
 getReadableRefIds ()
 

Static Public Member Functions

static getInfo (int $a_ref_id, int $a_user_id)
 Get all info objects for a ref id of an repo object. More...
 

Protected Member Functions

 __construct (int $a_assignment_id, string $a_assignment_title, array $a_ref_ids, bool $is_user_submission, int $a_exc_id, string $a_exc_title)
 

Protected Attributes

int $id
 
array $ref_ids
 
string $title
 
ilExAssignmentTypes $ass_types
 
bool $is_user_submission
 
string $exc_title
 
int $exc_id
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Repository object assignment information

Author
Alex Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 24 of file class.ilExcRepoObjAssignmentInfo.php.

Constructor & Destructor Documentation

◆ __construct()

ilExcRepoObjAssignmentInfo::__construct ( int  $a_assignment_id,
string  $a_assignment_title,
array  $a_ref_ids,
bool  $is_user_submission,
int  $a_exc_id,
string  $a_exc_title 
)
protected
Parameters
int[]$a_ref_ids

Definition at line 42 of file class.ilExcRepoObjAssignmentInfo.php.

References $is_user_submission, and ilExAssignmentTypes\getInstance().

49  {
50  $this->id = $a_assignment_id;
51  $this->title = $a_assignment_title;
52  $this->ref_ids = $a_ref_ids;
53  $this->ass_types = ilExAssignmentTypes::getInstance();
54  $this->is_user_submission = $is_user_submission;
55  $this->exc_id = $a_exc_id;
56  $this->exc_title = $a_exc_title;
57  }
+ Here is the call graph for this function:

Member Function Documentation

◆ getExerciseId()

ilExcRepoObjAssignmentInfo::getExerciseId ( )

Implements ilExcRepoObjAssignmentInfoInterface.

Definition at line 87 of file class.ilExcRepoObjAssignmentInfo.php.

References $exc_id.

87  : int
88  {
89  return $this->exc_id;
90  }

◆ getExerciseTitle()

ilExcRepoObjAssignmentInfo::getExerciseTitle ( )

Implements ilExcRepoObjAssignmentInfoInterface.

Definition at line 92 of file class.ilExcRepoObjAssignmentInfo.php.

References $exc_title.

92  : string
93  {
94  return $this->exc_title;
95  }

◆ getId()

ilExcRepoObjAssignmentInfo::getId ( )

Implements ilExcRepoObjAssignmentInfoInterface.

Definition at line 60 of file class.ilExcRepoObjAssignmentInfo.php.

References $id.

60  : int
61  {
62  return $this->id;
63  }

◆ getInfo()

static ilExcRepoObjAssignmentInfo::getInfo ( int  $a_ref_id,
int  $a_user_id 
)
static

Get all info objects for a ref id of an repo object.

Parameters
int$a_ref_idref id
int$a_user_iduser id
Returns
ilExcRepoObjAssignmentInfo[]
Exceptions
ilExcUnknownAssignmentTypeException

Definition at line 113 of file class.ilExcRepoObjAssignmentInfo.php.

References $DIC, $is_user_submission, $ref_id, ilObject\_getAllReferences(), ilObject\_lookupTitle(), ilExAssignmentTypes\getIdsForSubmissionType(), ilExAssignmentTypes\getInstance(), ilExAssignmentTeam\getInstanceByUserId(), ilExSubmission\getSubmissionsForFilename(), and ilExSubmission\TYPE_REPO_OBJECT.

Referenced by ilExcRepoObjAssignment\getAssignmentInfoOfObj().

113  : array
114  {
115  global $DIC;
116 
117  $access = $DIC->access();
118 
120 
122  $submissions1 = ilExSubmission::getSubmissionsForFilename($a_ref_id, $repos_ass_type_ids);
123  $submissions2 = ilExSubmission::getSubmissionsForFilename($a_ref_id . ".zip", $repos_ass_type_ids);
124  $submissions = array_merge($submissions1, $submissions2);
125  $ass_info = array();
126  foreach ($submissions as $s) {
127  //$ass_type = $ass_types->getById($s["type"]);
128 
129  // @todo note: this currently only works, if submissions are assigned to the team (like team wikis)
130  // get team of user
131  $team = ilExAssignmentTeam::getInstanceByUserId($s["ass_id"], $a_user_id);
132  $is_user_submission = $team->getId() > 0 && $team->getId() == $s["team_id"];
133 
134  // determine all readable ref ids of the exercise
135  $ref_ids = ilObject::_getAllReferences($s["exc_id"]);
136  $readable_ref_ids = array();
137  foreach ($ref_ids as $ref_id) {
138  if ($a_user_id > 0 && !$access->checkAccessOfUser($a_user_id, "read", "", $ref_id)) {
139  continue;
140  }
141  $readable_ref_ids[] = $ref_id;
142  }
143  $ass_info[] = new self(
144  $s["ass_id"],
145  $s["title"],
146  $readable_ref_ids,
148  $s["exc_id"],
149  ilObject::_lookupTitle($s["exc_id"])
150  );
151  }
152  return $ass_info;
153  }
static _getAllReferences(int $id)
get all reference ids for object ID
static getInstanceByUserId(int $a_assignment_id, int $a_user_id, bool $a_create_on_demand=false)
global $DIC
Definition: feed.php:28
$ref_id
Definition: ltiauth.php:67
static _lookupTitle(int $obj_id)
getIdsForSubmissionType(string $a_submission_type)
Get assignment type IDs for given submission type.
static getSubmissionsForFilename(string $a_filename, array $a_assignment_types=array())
Get assignment return entries for a filename.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLinks()

ilExcRepoObjAssignmentInfo::getLinks ( )
Returns
string[]

Implements ilExcRepoObjAssignmentInfoInterface.

Definition at line 73 of file class.ilExcRepoObjAssignmentInfo.php.

References $ref_id, and ilLink\_getLink().

73  : array
74  {
75  $links = [];
76  foreach ($this->ref_ids as $ref_id) {
77  $links[$ref_id] = ilLink::_getLink($ref_id, "exc", array(), "_" . $this->id);
78  }
79  return $links;
80  }
$ref_id
Definition: ltiauth.php:67
+ Here is the call graph for this function:

◆ getReadableRefIds()

ilExcRepoObjAssignmentInfo::getReadableRefIds ( )
Returns
int[]

Implements ilExcRepoObjAssignmentInfoInterface.

Definition at line 100 of file class.ilExcRepoObjAssignmentInfo.php.

References $ref_ids.

100  : array
101  {
102  return $this->ref_ids;
103  }

◆ getTitle()

ilExcRepoObjAssignmentInfo::getTitle ( )

Implements ilExcRepoObjAssignmentInfoInterface.

Definition at line 65 of file class.ilExcRepoObjAssignmentInfo.php.

References $title.

65  : string
66  {
67  return $this->title;
68  }

◆ isUserSubmission()

ilExcRepoObjAssignmentInfo::isUserSubmission ( )

Check if this object has been submitted by the user provided or its team.

If not, the repository object is related to an assignment, but has been submitted by another user/team.

Implements ilExcRepoObjAssignmentInfoInterface.

Definition at line 82 of file class.ilExcRepoObjAssignmentInfo.php.

References $is_user_submission.

82  : bool
83  {
85  }

Field Documentation

◆ $ass_types

ilExAssignmentTypes ilExcRepoObjAssignmentInfo::$ass_types
protected

Definition at line 34 of file class.ilExcRepoObjAssignmentInfo.php.

◆ $exc_id

int ilExcRepoObjAssignmentInfo::$exc_id
protected

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

Referenced by getExerciseId().

◆ $exc_title

string ilExcRepoObjAssignmentInfo::$exc_title
protected

Definition at line 36 of file class.ilExcRepoObjAssignmentInfo.php.

Referenced by getExerciseTitle().

◆ $id

int ilExcRepoObjAssignmentInfo::$id
protected

Definition at line 26 of file class.ilExcRepoObjAssignmentInfo.php.

Referenced by getId().

◆ $is_user_submission

bool ilExcRepoObjAssignmentInfo::$is_user_submission
protected

Definition at line 35 of file class.ilExcRepoObjAssignmentInfo.php.

Referenced by __construct(), getInfo(), and isUserSubmission().

◆ $ref_ids

array ilExcRepoObjAssignmentInfo::$ref_ids
protected

Definition at line 31 of file class.ilExcRepoObjAssignmentInfo.php.

Referenced by getReadableRefIds().

◆ $title

string ilExcRepoObjAssignmentInfo::$title
protected

Definition at line 33 of file class.ilExcRepoObjAssignmentInfo.php.

Referenced by getTitle().


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