ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 12 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 55 of file class.ilExcRepoObjAssignmentInfo.php.

References $is_user_submission, and ilExAssignmentTypes\getInstance().

62  {
63  $this->id = $a_assignment_id;
64  $this->title = $a_assignment_title;
65  $this->ref_ids = $a_ref_ids;
66  $this->ass_types = ilExAssignmentTypes::getInstance();
67  $this->is_user_submission = $is_user_submission;
68  $this->exc_id = $a_exc_id;
69  $this->exc_title = $a_exc_title;
70  }
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 113 of file class.ilExcRepoObjAssignmentInfo.php.

References $exc_id.

◆ getExerciseTitle()

ilExcRepoObjAssignmentInfo::getExerciseTitle ( )

Get exercise title.

Returns
string

Implements ilExcRepoObjAssignmentInfoInterface.

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

References $exc_title.

◆ getId()

ilExcRepoObjAssignmentInfo::getId ( )

Get assignment id.

Returns
int assignment id

Implements ilExcRepoObjAssignmentInfoInterface.

Definition at line 76 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 142 of file class.ilExcRepoObjAssignmentInfo.php.

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

Referenced by ilExcRepoObjAssignment\getAssignmentInfoOfObj().

143  {
144  global $DIC;
145 
146  $access = $DIC->access();
147 
148  include_once("./Modules/Exercise/AssignmentTypes/classes/class.ilExAssignmentTypes.php");
150 
151  $repos_ass_type_ids = $ass_types->getIdsForSubmissionType(ilExSubmission::TYPE_REPO_OBJECT);
152  include_once("./Modules/Exercise/classes/class.ilExSubmission.php");
153  $submissions = ilExSubmission::getSubmissionsForFilename($a_ref_id, $repos_ass_type_ids);
154 
155  $ass_info = array();
156  foreach ($submissions as $s) {
157  $ass_type = $ass_types->getById($s["type"]);
158 
159  // @todo note: this currently only works, if submissions are assigned to the team (like team wikis)
160  // get team of user
161  include_once "Modules/Exercise/classes/class.ilExAssignmentTeam.php";
162  $team = ilExAssignmentTeam::getInstanceByUserId($s["ass_id"], $a_user_id);
163  $is_user_submission = ($team->getId() > 0 && $team->getId() == $s["team_id"])
164  ? true
165  : false;
166 
167 
168  // determine all readable ref ids of the exercise
169  $ref_ids = ilObject::_getAllReferences($s["exc_id"]);
170  $readable_ref_ids = array();
171  foreach ($ref_ids as $ref_id) {
172  if ($a_user_id > 0 && !$access->checkAccessOfUser($a_user_id, "read", "", $ref_id)) {
173  continue;
174  }
175  $readable_ref_ids[] = $ref_id;
176  }
177  $ass_info[] = new self(
178  $s["ass_id"],
179  $s["title"],
180  $readable_ref_ids,
182  $s["exc_id"],
183  ilObject::_lookupTitle($s["exc_id"])
184  );
185  }
186  return $ass_info;
187  }
global $DIC
Definition: saml.php:7
static _lookupTitle($a_id)
lookup object title
$s
Definition: pwgen.php:45
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.
+ 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 93 of file class.ilExcRepoObjAssignmentInfo.php.

References $links, and ilLink\_getLink().

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

◆ getReadableRefIds()

ilExcRepoObjAssignmentInfo::getReadableRefIds ( )

Get readable ref IDs.

Returns
int[]

Implements ilExcRepoObjAssignmentInfoInterface.

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

References $ref_ids.

◆ getTitle()

ilExcRepoObjAssignmentInfo::getTitle ( )

Get assignment title.

Returns
int assignment id

Implements ilExcRepoObjAssignmentInfoInterface.

Definition at line 84 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 105 of file class.ilExcRepoObjAssignmentInfo.php.

References $is_user_submission.

Field Documentation

◆ $ass_types

ilExcRepoObjAssignmentInfo::$ass_types
protected

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

Referenced by getInfo().

◆ $exc_id

ilExcRepoObjAssignmentInfo::$exc_id
protected

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

Referenced by getExerciseId().

◆ $exc_title

ilExcRepoObjAssignmentInfo::$exc_title
protected

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

Referenced by getExerciseTitle().

◆ $id

ilExcRepoObjAssignmentInfo::$id
protected

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

Referenced by getId().

◆ $is_user_submission

ilExcRepoObjAssignmentInfo::$is_user_submission
protected

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

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

◆ $ref_ids

ilExcRepoObjAssignmentInfo::$ref_ids
protected

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

Referenced by getInfo(), and getReadableRefIds().

◆ $title

ilExcRepoObjAssignmentInfo::$title
protected

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

Referenced by getTitle().


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