ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilPortfolioExercise Class Reference

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

+ Collaboration diagram for ilPortfolioExercise:

Public Member Functions

 __construct (int $a_user_id, int $a_obj_id)
 
 getAssignmentsOfPortfolio ()
 

Protected Attributes

int $user_id
 
int $obj_id
 
ilTree $tree
 

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 Exercise info for portfolios

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

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

Constructor & Destructor Documentation

◆ __construct()

ilPortfolioExercise::__construct ( int  $a_user_id,
int  $a_obj_id 
)

Definition at line 29 of file class.ilPortfolioExercise.php.

32 {
33 global $DIC;
34
35 $this->tree = $DIC->repositoryTree();
36 $this->user_id = $a_user_id;
37 $this->obj_id = $a_obj_id;
38 }
global $DIC
Definition: shib_login.php:26

References $DIC.

Member Function Documentation

◆ getAssignmentsOfPortfolio()

ilPortfolioExercise::getAssignmentsOfPortfolio ( )

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

40 : array
41 {
45
46 $assignments = [];
47
49 // #0022794
50 if (count($exercises) === 0) {
51 $exercises = ilExSubmission::findUserFiles($user_id, $obj_id . ".sec");
52 }
53 if (count($exercises) === 0) {
54 $exercises = ilExSubmission::findUserFiles($user_id, $obj_id . ".zip");
55 }
56 if ($exercises) {
57 foreach ($exercises as $exercise) {
58 // #9988
59 $active_ref = false;
60 foreach (ilObject::_getAllReferences($exercise["obj_id"]) as $ref_id) {
61 if (!$tree->isDeleted($ref_id)) {
62 $active_ref = true;
63 break;
64 }
65 }
66 if ($active_ref) {
67 $assignments[] = [
68 "exc_id" => $exercise["obj_id"],
69 "ass_id" => $exercise["ass_id"]
70 ];
71 }
72 }
73 }
74 return $assignments;
75 }
static findUserFiles(int $a_user_id, string $a_filetitle)
Check if given file was assigned Used in Blog/Portfolio.
static _getAllReferences(int $id)
get all reference ids for object ID
isDeleted(int $a_node_id)
This is a wrapper for isSaved() with a more useful name.
$ref_id
Definition: ltiauth.php:66

References $exercise, $obj_id, $ref_id, $tree, $user_id, ilObject\_getAllReferences(), ilExSubmission\findUserFiles(), and ilTree\isDeleted().

Referenced by ilPortfolioExerciseGUI\checkExercise(), and ilPortfolioExerciseGUI\getActionButtons().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $obj_id

int ilPortfolioExercise::$obj_id
protected

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

Referenced by getAssignmentsOfPortfolio().

◆ $tree

ilTree ilPortfolioExercise::$tree
protected

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

Referenced by getAssignmentsOfPortfolio().

◆ $user_id

int ilPortfolioExercise::$user_id
protected

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

Referenced by getAssignmentsOfPortfolio().


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