ILIAS
trunk Revision v11.0_alpha-2638-g80c1d007f79
◀ 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
}
ilTree
ILIAS\Exercise\BlogExercise\getAssignmentsOfBlog
getAssignmentsOfBlog()
Definition:
class.BlogExercise.php:43
ilObject\_getAllReferences
static _getAllReferences(int $id)
get all reference ids for object ID
Definition:
class.ilObject.php:817
ILIAS\Exercise\BlogExercise
Blog Exercise.
Definition:
class.BlogExercise.php:27
ILIAS\Repository\user
user()
Definition:
trait.GlobalDICDomainServices.php:66
ILIAS\Blog\Exercise
Definition:
class.BlogExercise.php:21
ilObjUser
$ref_id
$ref_id
Definition:
ltiauth.php:65
ILIAS\Exercise\BlogExercise\$user
ilObjUser $user
Definition:
class.BlogExercise.php:29
$exercise
$exercise
Definition:
trait.ilExAssignmentTypeGUIBase.php:35
ILIAS\Exercise\BlogExercise\$node_id
int $node_id
Definition:
class.BlogExercise.php:30
ILIAS\Exercise\BlogExercise\__construct
__construct(int $a_node_id, \ilTree $tree, \ilObjUser $user)
Definition:
class.BlogExercise.php:33
ILIAS\Exercise\BlogExercise\$tree
ilTree $tree
Definition:
class.BlogExercise.php:31
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
components
ILIAS
Blog
Exercise
class.BlogExercise.php
Generated on Sun Aug 31 2025 23:02:23 for ILIAS by
1.8.13 (using
Doxyfile
)