-
Bug
-
Resolution: Fixed
-
Minor
-
3.6, 3.7, 3.8
-
MOODLE_36_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE
-
MOODLE_36_STABLE, MOODLE_37_STABLE
-
MDL-65845_master -
While working on MDLSITE-5663 the following PHP warning has been repeatedly (like dozens if not hundred times) displayed while running the admin/tool/analytics/cli/evaluate_model.php script:
PHP Warning: count(): Parameter must be an array or an object that implements
|
Countable in /mod/lesson/classes/analytics/indicator/cognitive_depth.php on line 73
|
The code there in the method mod_lesson\analytics\indicator\cognitive_depth::feedback_submitted() only checks if the array item exists and is not empty, and then it clearly assumes that it must be an array.
When debugging, I realized that the actual value of the $this->activitylogs[$contextid][$userid]['\mod_lesson\event\lesson_ended'] item is not an array but an object like
stdClass Object
|
(
|
[eventname] => \mod_lesson\event\lesson_ended
|
[component] => mod_lesson
|
[action] => ended
|
[target] => lesson
|
[objecttable] => lesson
|
[objectid] => 1912
|
[crud] => r
|
[edulevel] => 2
|
[contextid] => 350044
|
[contextlevel] => 70
|
[contextinstanceid] => 94045
|
[userid] => 23699
|
[courseid] => 17297
|
[timecreated] => Array
|
(
|
[0] => 1531609232
|
)
|
|
)
|
There is likely a bug somewhere, and it is also annoying as it causes the script output to scroll away.
- Discovered while testing
-
MDLSITE-5663 Enable Moodle analytics features in learn.moodle.org
- Resolved
- is blocked by
-
MDL-65829 Enrolments whose start date is after the analysis time start should not be discarded
- Closed