Fix compatibility with Moodle >= 5.1 - #7
Merged
Merged
Conversation
…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).
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? |
Contributor
Author
|
Hi @sangwinc, thanks for reviewing. If accepted, the plugin will require Moodle 4.2 since this is where the new 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 |
Member
|
Thanks for sorting this out so carefully @ngandrass, much appreciated. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On Moodle 5.1 an up, accessing the STACK response analysis report throws the following error:

This is due to the final removal of
/mod/quiz/report/attemptsreport.phpin favor of\mod_quiz\local\reports\attempts_report. The oldattemptsreport.phpwas 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.