ILIAS
release_8 Revision v8.24
◀ ilDoc Overview
class.ilBlogExercise.php
Go to the documentation of this file.
1
<?php
2
23
class
ilBlogExercise
24
{
25
protected
ilObjUser
$user
;
26
protected
int
$node_id
;
27
protected
ilTree
$tree
;
28
29
public
function
__construct
(
30
int
$a_node_id
31
) {
32
global
$DIC
;
33
34
$this->tree =
$DIC
->repositoryTree();
35
$this->
user
= $DIC->user();
36
$this->node_id = $a_node_id;
37
}
38
39
public
function
getAssignmentsOfBlog
(): array
40
{
41
$user
=
$this->user
;
42
$node_id
=
$this->node_id
;
43
$tree
=
$this->tree
;
44
45
$assignments = [];
46
47
$exercises =
ilExSubmission::findUserFiles
(
$user
->
getId
(),
$node_id
);
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
}
75
}
ilBlogExercise
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition:
class.ilBlogExercise.php:24
ilBlogExercise\$node_id
int $node_id
Definition:
class.ilBlogExercise.php:26
ilBlogExercise\$tree
ilTree $tree
Definition:
class.ilBlogExercise.php:27
ilBlogExercise\__construct
__construct(int $a_node_id)
Definition:
class.ilBlogExercise.php:29
ilBlogExercise\getAssignmentsOfBlog
getAssignmentsOfBlog()
Definition:
class.ilBlogExercise.php:39
ilBlogExercise\$user
ilObjUser $user
Definition:
class.ilBlogExercise.php:25
ilExSubmission\findUserFiles
static findUserFiles(int $a_user_id, string $a_filetitle)
Check if given file was assigned Used in Blog/Portfolio.
Definition:
class.ilExSubmission.php:623
ilObjUser
User class.
Definition:
class.ilObjUser.php:28
ilObject\_getAllReferences
static _getAllReferences(int $id)
get all reference ids for object ID
Definition:
class.ilObject.php:816
ilObject\getId
getId()
Definition:
class.ilObject.php:270
ilTree
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition:
class.ilTree.php:30
ilTree\isSaved
isSaved(int $a_node_id)
Use method isDeleted.
Definition:
class.ilTree.php:1409
$DIC
global $DIC
Definition:
feed.php:28
$ref_id
$ref_id
Definition:
ltiauth.php:67
ILIAS\Repository\user
user()
Definition:
trait.GlobalDICDomainServices.php:61
$exercise
$exercise
Definition:
trait.ilExAssignmentTypeGUIBase.php:35
Modules
Blog
Exercise
class.ilBlogExercise.php
Generated on Sun Nov 2 2025 22:01:03 for ILIAS by
1.9.4 (using
Doxyfile
)