KQMATH / moodle-mod_capquiz

:mushroom: Computer adaptive practice activity module for Moodle
https://moodle.org/plugins/mod_capquiz
GNU General Public License v3.0
4 stars 5 forks source link

Exception on entering quiz as student #81

Closed andstor closed 5 years ago

andstor commented 5 years ago

Guessing this has to do with the recent commits 09ca4cf6257812bd4172b65ef9961c3eb66602bf and a82ca9702951b5abe8f536c23641a78d8c4d2064, regarding the removal of nullable return types? Only happens in newly created instances.

Running php 7.2.9-1

Error message:

Exception - Call to a member function attempt_for_user() on null.
Stack trace:
line 46 of /mod/capquiz/classes/output/question_attempt_renderer.php: Error thrown
line 42 of /mod/capquiz/classes/output/question_attempt_renderer.php: call to mod_capquiz\output\question_attempt_renderer->render_question_head_html()
line 101 of /mod/capquiz/classes/output/renderer.php: call to mod_capquiz\output\question_attempt_renderer->__construct()
line 49 of /mod/capquiz/view.php: call to mod_capquiz\output\renderer->display_question_attempt_view()
hgeorgsch commented 5 years ago

I get this error on a previously created quiz, but not on a newly created one.

sebastsg commented 5 years ago

This happened if the quiz was not yet published, and has been fixed.