ILIAS  release_8 Revision v8.23
ilBlogExercise 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 ilBlogExercise:

Public Member Functions

 __construct (int $a_node_id)
 
 getAssignmentsOfBlog ()
 

Protected Attributes

ilObjUser $user
 
int $node_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 Blog Exercise

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

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

Constructor & Destructor Documentation

◆ __construct()

ilBlogExercise::__construct ( int  $a_node_id)

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

References $DIC, and ILIAS\Repository\user().

31  {
32  global $DIC;
33 
34  $this->tree = $DIC->repositoryTree();
35  $this->user = $DIC->user();
36  $this->node_id = $a_node_id;
37  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Member Function Documentation

◆ getAssignmentsOfBlog()

ilBlogExercise::getAssignmentsOfBlog ( )

Definition at line 39 of file class.ilBlogExercise.php.

References $exercise, $node_id, $ref_id, $tree, $user, ilObject\_getAllReferences(), ilExSubmission\findUserFiles(), ilObject\getId(), and ilTree\isSaved().

39  : array
40  {
44 
45  $assignments = [];
46 
48  // #0022794
49  if (count($exercises) === 0) {
50  $exercises = ilExSubmission::findUserFiles($user->getId(), $node_id . ".sec");
51  }
52  if (count($exercises) === 0) {
53  $exercises = ilExSubmission::findUserFiles($user->getId(), $node_id . ".zip");
54  }
55  if ($exercises) {
56  foreach ($exercises as $exercise) {
57  // #9988
58  $active_ref = false;
59  foreach (ilObject::_getAllReferences($exercise["obj_id"]) as $ref_id) {
60  if (!$tree->isSaved($ref_id)) {
61  $active_ref = true;
62  break;
63  }
64  }
65  if ($active_ref) {
66  $assignments[] = [
67  "exc_id" => $exercise["obj_id"],
68  "ass_id" => $exercise["ass_id"]
69  ];
70  }
71  }
72  }
73  return $assignments;
74  }
isSaved(int $a_node_id)
Use method isDeleted.
static _getAllReferences(int $id)
get all reference ids for object ID
$ref_id
Definition: ltiauth.php:67
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 ilBlogExercise::$node_id
protected

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

Referenced by getAssignmentsOfBlog().

◆ $tree

ilTree ilBlogExercise::$tree
protected

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

Referenced by getAssignmentsOfBlog().

◆ $user

ilObjUser ilBlogExercise::$user
protected

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

Referenced by getAssignmentsOfBlog().


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