Skip to content

Fix compatibility with Moodle >= 5.1 - #7

Merged
sangwinc merged 2 commits into
maths:masterfrom
ngandrass:master
Sep 22, 2026
Merged

sangwinc merged 2 commits into
maths:masterfrom
ngandrass:master

Conversation

@ngandrass

@ngandrass ngandrass commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

On Moodle 5.1 an up, accessing the STACK response analysis report throws the following error:
image

This is due to the final removal of /mod/quiz/report/attemptsreport.php in favor of \mod_quiz\local\reports\attempts_report. The old attemptsreport.php was deprecated in Moodle 4.2 and finally removed in Moodle 5.1.

Since any Moodle >= 4.2 ships the new class and any Moodle <= 4.1 is EOL for at least three years, this PR replaces the old library with the new class. This is compatible with any Moodle >= 4.2 and fixes the fatal error on Moodle >= 5.1.

…reports\attempts_report

The quiz_attempts_report class was deprecated in Moodle 4.2 (2023-04-24) and finally
removed in Moodle 5.1 (2025-10-06).
@sangwinc

Copy link
Copy Markdown
Member

@ngandrass thanks for this Niels. If we accept this into "master" as you suggest, then the plugin will work on Moodle 5.1, but not on earlier versions. Is that correct?

@ngandrass

Copy link
Copy Markdown
Contributor Author

Hi @sangwinc,

thanks for reviewing. If accepted, the plugin will require Moodle 4.2 since this is where the new \mod_quiz\local\reports\attempts_report class was introduced. See the above linked Moodle 4.2 migration notes. I just raised the required Moodle release inside version.php as per 8717b9c to clearly indicate this requirement.

Any Moodle version below 4.2 is EOL for at least three years by now. So this should be fine to merge into master IMHO. But please decide for yourself.

Kind regards
Niels

@sangwinc

Copy link
Copy Markdown
Member

Thanks for sorting this out so carefully @ngandrass, much appreciated.

@sangwinc
sangwinc merged commit e360cba into maths:master Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants