ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\Blog\Exercise\BlogExercise Class Reference

Blog Exercise. More...

+ Collaboration diagram for ILIAS\Blog\Exercise\BlogExercise:

Public Member Functions

 __construct (int $a_node_id, \ilTree $tree, \ilObjUser $user)
 
 getAssignmentsOfBlog ()
 

Protected Attributes

ilObjUser $user
 
int $node_id
 
ilTree $tree
 

Detailed Description

Blog Exercise.

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

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

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Blog\Exercise\BlogExercise::__construct ( int  $a_node_id,
\ilTree  $tree,
\ilObjUser  $user 
)

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

37 {
38 $this->tree = $tree;
39 $this->user = $user;
40 $this->node_id = $a_node_id;
41 }

References ILIAS\Blog\Exercise\BlogExercise\$tree, ILIAS\Blog\Exercise\BlogExercise\$user, and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ getAssignmentsOfBlog()

ILIAS\Blog\Exercise\BlogExercise::getAssignmentsOfBlog ( )

Definition at line 43 of file class.BlogExercise.php.

43 : array
44 {
48
49 $assignments = [];
50
51 $exercises = \ilExSubmission::findUserFiles($user->getId(), (string) $node_id);
52 // #0022794
53 if (count($exercises) === 0) {
54 $exercises = \ilExSubmission::findUserFiles($user->getId(), $node_id . ".sec");
55 }
56 if (count($exercises) === 0) {
57 $exercises = \ilExSubmission::findUserFiles($user->getId(), $node_id . ".zip");
58 }
59 if ($exercises) {
60 foreach ($exercises as $exercise) {
61 // #9988
62 $active_ref = false;
63 foreach (\ilObject::_getAllReferences($exercise["obj_id"]) as $ref_id) {
64 if (!$tree->isDeleted($ref_id)) {
65 $active_ref = true;
66 break;
67 }
68 }
69 if ($active_ref) {
70 $assignments[] = [
71 "exc_id" => $exercise["obj_id"],
72 "ass_id" => $exercise["ass_id"]
73 ];
74 }
75 }
76 }
77 return $assignments;
78 }
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, ILIAS\Blog\Exercise\BlogExercise\$node_id, $ref_id, ILIAS\Blog\Exercise\BlogExercise\$tree, ILIAS\Blog\Exercise\BlogExercise\$user, ilObject\_getAllReferences(), ilExSubmission\findUserFiles(), ilObject\getId(), and ilTree\isDeleted().

+ Here is the call graph for this function:

Field Documentation

◆ $node_id

int ILIAS\Blog\Exercise\BlogExercise::$node_id
protected

◆ $tree

ilTree ILIAS\Blog\Exercise\BlogExercise::$tree
protected

◆ $user

ilObjUser ILIAS\Blog\Exercise\BlogExercise::$user
protected

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