ILIAS  trunk Revision v11.0_alpha-1861-g09f3d197f78
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\Exercise\BlogExercise Class Reference

Blog Exercise. More...

+ Collaboration diagram for ILIAS\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\Exercise\BlogExercise::__construct ( int  $a_node_id,
\ilTree  $tree,
\ilObjUser  $user 
)

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

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

37  {
38  $this->tree = $tree;
39  $this->user = $user;
40  $this->node_id = $a_node_id;
41  }
+ Here is the call graph for this function:

Member Function Documentation

◆ getAssignmentsOfBlog()

ILIAS\Exercise\BlogExercise::getAssignmentsOfBlog ( )

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

References $exercise, ILIAS\Exercise\BlogExercise\$node_id, $ref_id, ILIAS\Exercise\BlogExercise\$tree, ILIAS\Exercise\BlogExercise\$user, ilObject\_getAllReferences(), and ilExSubmission\findUserFiles().

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 _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:65
static findUserFiles(int $a_user_id, string $a_filetitle)
Check if given file was assigned Used in Blog/Portfolio.
+ Here is the call graph for this function:

Field Documentation

◆ $node_id

int ILIAS\Exercise\BlogExercise::$node_id
protected

◆ $tree

ilTree ILIAS\Exercise\BlogExercise::$tree
protected

◆ $user

ilObjUser ILIAS\Exercise\BlogExercise::$user
protected

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