ILIAS
trunk Revision v11.0_alpha-3011-gc6b235a2e85
◀ ilDoc Overview
class.BlogExercise.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\Blog\Exercise
;
22
27
class
BlogExercise
28
{
29
protected \ilObjUser
$user
;
30
protected
int
$node_id
;
31
protected \ilTree
$tree
;
32
33
public
function
__construct
(
34
int
$a_node_id,
35
\
ilTree
$tree
,
36
\
ilObjUser
$user
37
) {
38
$this->tree =
$tree
;
39
$this->
user
=
$user
;
40
$this->node_id = $a_node_id;
41
}
42
43
public
function
getAssignmentsOfBlog
(): array
44
{
45
$user
=
$this->user
;
46
$node_id
=
$this->node_id
;
47
$tree
=
$this->tree
;
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
}
79
}
ILIAS\Blog\Exercise\BlogExercise
Blog Exercise.
Definition:
class.BlogExercise.php:28
ILIAS\Blog\Exercise\BlogExercise\$tree
ilTree $tree
Definition:
class.BlogExercise.php:31
ILIAS\Blog\Exercise\BlogExercise\$node_id
int $node_id
Definition:
class.BlogExercise.php:30
ILIAS\Blog\Exercise\BlogExercise\$user
ilObjUser $user
Definition:
class.BlogExercise.php:29
ILIAS\Blog\Exercise\BlogExercise\__construct
__construct(int $a_node_id, \ilTree $tree, \ilObjUser $user)
Definition:
class.BlogExercise.php:33
ILIAS\Blog\Exercise\BlogExercise\getAssignmentsOfBlog
getAssignmentsOfBlog()
Definition:
class.BlogExercise.php:43
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:351
ilObjUser
User class.
Definition:
class.ilObjUser.php:46
ilObject\_getAllReferences
static _getAllReferences(int $id)
get all reference ids for object ID
Definition:
class.ilObject.php:826
ilObject\getId
getId()
Definition:
class.ilObject.php:304
ilTree
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
Definition:
class.ilTree.php:30
ilTree\isDeleted
isDeleted(int $a_node_id)
This is a wrapper for isSaved() with a more useful name.
Definition:
class.ilTree.php:1390
$ref_id
$ref_id
Definition:
ltiauth.php:66
ILIAS\Blog\Exercise
Definition:
class.BlogExercise.php:21
ILIAS\Repository\user
user()
Definition:
trait.GlobalDICDomainServices.php:66
$exercise
$exercise
Definition:
trait.ilExAssignmentTypeGUIBase.php:35
components
ILIAS
Blog
Exercise
class.BlogExercise.php
Generated on Sat Oct 18 2025 23:02:39 for ILIAS by
1.9.4 (using
Doxyfile
)