lesson: quiz (true/false) submit without selecting option gives debug error.

Description

when i have a true/false quiz page on a lesson activity, i select submit without selecting a radio button, i get the following error.

using version Moodle 2.2+ (Build: 20111209)
Debug info: SELECT * FROM {lesson_answers} WHERE id IS NULL
[array (
)]
Stack trace:

line 1272 of /lib/dml/moodle_database.php: dml_missing_record_exception thrown
line 1249 of /lib/dml/moodle_database.php: call to moodle_database->get_record_select()
line 85 of /mod/lesson/pagetypes/truefalse.php: call to moodle_database->get_record()
line 1935 of /mod/lesson/locallib.php: call to lesson_page_type_truefalse->check_answer()
line 79 of /mod/lesson/continue.php: call to lesson_page->record_attempt()

Testing Instructions

create a lesson activity with true/false quiz
preview the page, select submit without selecting true or false radio button.

Automated test results

None

Pre-check results

None

Environment

mac osx 10.7.2 PHP Version 5.3.6 mysqlnd 5.0.8-dev - 20102224 - $Revision: 308673 $

Workaround

don't click the submit button until you select an option!

Activity

Michael de Raadt
4 September 2012 at 15:20

Even though this issue was reported earlier, I'm going to close it as the duplicate issue has a solution included.

Michael de Raadt
5 January 2012 at 09:10

Thanks for reporting this.

I've put it on our backlog.

In the meantime feel free to help us work on this issue. If you are able to provide a patch, please add a patch label so we will spot it.

Duplicate

Details

Priority

Affects versions

Components

Labels

Assignee

Reporter

Participants

Michael de Raadt
Peter Gee
Rossiani Wijaya

Clockify

Created 4 January 2012 at 14:59
Updated 4 September 2012 at 15:20
Resolved 4 September 2012 at 15:20