ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilExcRepoObjAssignmentInfo Class Reference

Repository object assignment information. More...

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

Public Member Functions

 getId ()
 Get assignment id.
Returns
int assignment id
More...
 
 getTitle ()
 Get assignment title.
Returns
int assignment id
More...
 
 getLinks ()
 Get readable link urls to the assignment (key is the ref id)
Returns
string[] assignment link url
More...
 
 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.
Returns
bool
More...
 
 getExerciseId ()
 Get exercise id.
Returns
int
More...
 
 getExerciseTitle ()
 Get exercise title.
Returns
string
More...
 
 getReadableRefIds ()
 Get readable ref IDs.
Returns
int[]
More...
 

Static Public Member Functions

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

Protected Member Functions

 __construct ( $a_assignment_id, $a_assignment_title, $a_ref_ids, $is_user_submission, $a_exc_id, $a_exc_title)
 Constructor. More...
 

Protected Attributes

 $id
 
 $ref_ids
 
 $title
 
 $ass_types
 
 $is_user_submission
 
 $exc_title
 
 $exc_id
 

Detailed Description

Repository object assignment information.

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

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

Constructor & Destructor Documentation

◆ __construct()

ilExcRepoObjAssignmentInfo::__construct (   $a_assignment_id,
  $a_assignment_title,
  $a_ref_ids,
  $is_user_submission,
  $a_exc_id,
  $a_exc_title 
)
protected

Constructor.

Parameters
int$a_assignment_id
int[]$a_ref_ids ref ids

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

References $is_user_submission, and ilExAssignmentTypes\getInstance().

60  {
61  $this->id = $a_assignment_id;
62  $this->title = $a_assignment_title;
63  $this->ref_ids = $a_ref_ids;
64  $this->ass_types = ilExAssignmentTypes::getInstance();
65  $this->is_user_submission = $is_user_submission;
66  $this->exc_id = $a_exc_id;
67  $this->exc_title = $a_exc_title;
68  }
static getInstance()
Get instance.
+ Here is the call graph for this function:

Member Function Documentation

◆ getExerciseId()

ilExcRepoObjAssignmentInfo::getExerciseId ( )

Get exercise id.

Returns
int

Implements ilExcRepoObjAssignmentInfoInterface.

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

References $exc_id.

◆ getExerciseTitle()

ilExcRepoObjAssignmentInfo::getExerciseTitle ( )

Get exercise title.

Returns
string

Implements ilExcRepoObjAssignmentInfoInterface.

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

References $exc_title.

◆ getId()

ilExcRepoObjAssignmentInfo::getId ( )

Get assignment id.

Returns
int assignment id

Implements ilExcRepoObjAssignmentInfoInterface.

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

References $id.

◆ getInfo()

static ilExcRepoObjAssignmentInfo::getInfo (   $a_ref_id,
  $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[]

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

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

Referenced by ilExcRepoObjAssignment\getAssignmentInfoOfObj().

141  {
142  global $DIC;
143 
144  $access = $DIC->access();
145 
147 
148  $repos_ass_type_ids = $ass_types->getIdsForSubmissionType(ilExSubmission::TYPE_REPO_OBJECT);
149  $submissions = ilExSubmission::getSubmissionsForFilename($a_ref_id, $repos_ass_type_ids);
150 
151  $ass_info = array();
152  foreach ($submissions as $s) {
153  $ass_type = $ass_types->getById($s["type"]);
154 
155  // @todo note: this currently only works, if submissions are assigned to the team (like team wikis)
156  // get team of user
157  $team = ilExAssignmentTeam::getInstanceByUserId($s["ass_id"], $a_user_id);
158  $is_user_submission = ($team->getId() > 0 && $team->getId() == $s["team_id"])
159  ? true
160  : false;
161 
162 
163  // determine all readable ref ids of the exercise
164  $ref_ids = ilObject::_getAllReferences($s["exc_id"]);
165  $readable_ref_ids = array();
166  foreach ($ref_ids as $ref_id) {
167  if ($a_user_id > 0 && !$access->checkAccessOfUser($a_user_id, "read", "", $ref_id)) {
168  continue;
169  }
170  $readable_ref_ids[] = $ref_id;
171  }
172  $ass_info[] = new self(
173  $s["ass_id"],
174  $s["title"],
175  $readable_ref_ids,
177  $s["exc_id"],
178  ilObject::_lookupTitle($s["exc_id"])
179  );
180  }
181  return $ass_info;
182  }
static _lookupTitle($a_id)
lookup object title
static _getAllReferences($a_id)
get all reference ids of object
static getInstanceByUserId($a_assignment_id, $a_user_id, $a_create_on_demand=false)
static getInstance()
Get instance.
static getSubmissionsForFilename($a_filename, $a_assignment_types=array())
Get assignment return entries for a filename.
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLinks()

ilExcRepoObjAssignmentInfo::getLinks ( )

Get readable link urls to the assignment (key is the ref id)

Returns
string[] assignment link url

Implements ilExcRepoObjAssignmentInfoInterface.

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

References ilLink\_getLink().

92  {
93  $links = [];
94  foreach ($this->ref_ids as $ref_id) {
95  $links[$ref_id] = ilLink::_getLink($ref_id, "exc", array(), "_" . $this->id);
96  }
97  return $links;
98  }
+ Here is the call graph for this function:

◆ getReadableRefIds()

ilExcRepoObjAssignmentInfo::getReadableRefIds ( )

Get readable ref IDs.

Returns
int[]

Implements ilExcRepoObjAssignmentInfoInterface.

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

References $ref_ids.

◆ getTitle()

ilExcRepoObjAssignmentInfo::getTitle ( )

Get assignment title.

Returns
int assignment id

Implements ilExcRepoObjAssignmentInfoInterface.

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

References $title.

◆ 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.

Returns
bool

Implements ilExcRepoObjAssignmentInfoInterface.

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

References $is_user_submission.

Field Documentation

◆ $ass_types

ilExcRepoObjAssignmentInfo::$ass_types
protected

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

Referenced by getInfo().

◆ $exc_id

ilExcRepoObjAssignmentInfo::$exc_id
protected

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

Referenced by getExerciseId().

◆ $exc_title

ilExcRepoObjAssignmentInfo::$exc_title
protected

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

Referenced by getExerciseTitle().

◆ $id

ilExcRepoObjAssignmentInfo::$id
protected

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

Referenced by getId().

◆ $is_user_submission

ilExcRepoObjAssignmentInfo::$is_user_submission
protected

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

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

◆ $ref_ids

ilExcRepoObjAssignmentInfo::$ref_ids
protected

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

Referenced by getInfo(), and getReadableRefIds().

◆ $title

ilExcRepoObjAssignmentInfo::$title
protected

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

Referenced by getTitle().


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