Skip to content
GitLab
Explore
Sign in
ilias-core
ILIAS
Compare revisions
ac2dc5e50c5dc92304bfca951448f165729c53f3 to f27c88113a69e65e005e2e9b751062619afdaa18
Commits on Source (3)
fix error for stale db entries
· 850c58a1
ingoj
authored
Apr 15, 2024
850c58a1
adjust log level to warning
· 5cb61d38
ingoj
authored
May 07, 2024
5cb61d38
Merge pull request #7487 from ingoj/release_8-crs-objectives
· f27c8811
Stefan Meyer
authored
May 07, 2024
Fix for stale question entries
f27c8811
Hide whitespace changes
Inline
Side-by-side
Modules/Course/classes/Objectives/class.ilCourseObjectiveResult.php
View file @
f27c8811
...
@@ -392,14 +392,20 @@ class ilCourseObjectiveResult
...
@@ -392,14 +392,20 @@ class ilCourseObjectiveResult
public
static
function
__isFullfilled
(
array
$question_points
,
array
$objective_data
):
bool
public
static
function
__isFullfilled
(
array
$question_points
,
array
$objective_data
):
bool
{
{
global
$DIC
;
if
(
!
is_array
(
$objective_data
[
'questions'
]))
{
if
(
!
is_array
(
$objective_data
[
'questions'
]))
{
return
false
;
return
false
;
}
}
$max_points
=
0
;
$max_points
=
0
;
$reached_points
=
0
;
$reached_points
=
0
;
foreach
(
$objective_data
[
'questions'
]
as
$question_id
)
{
foreach
(
$objective_data
[
'questions'
]
as
$question_id
)
{
$max_points
+=
$question_points
[
$question_id
][
'max_points'
];
if
(
array_key_exists
(
$question_id
,
$question_points
))
{
$reached_points
+=
$question_points
[
$question_id
][
'reached_points'
]
??
0
;
$max_points
+=
$question_points
[
$question_id
][
'max_points'
];
$reached_points
+=
$question_points
[
$question_id
][
'reached_points'
]
??
0
;
}
else
{
$DIC
->
logger
()
->
crs
()
->
warning
(
'stale question in course objective assignment table id '
.
$question_id
);
}
}
}
if
(
!
$max_points
)
{
if
(
!
$max_points
)
{
return
false
;
return
false
;
...
...