Moodle

no answer in lesson gives errors!

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Duplicate
  • Affects Version/s: 1.9
  • Fix Version/s: None
  • Component/s: Lesson
  • Labels:
    None
  • Environment:
    linux
  • Database:
    MySQL
  • Affected Branches:
    MOODLE_19_STABLE

Description

if you press the answer button with no answers selected (multichoice), there are 2 "notice" errors, which lead to broken page an weird aspect
:

  • $nodefaultresponse is not defined
  • $feedback is not defined

This is because the following defaults were not present at the start of the script in ROOT/mod/lesson/action/continue.php

$nodefaultresponse = false; // Flag for redirecting when default feedback is turned off
$feedback = get_string('noanswer', 'lesson');

I added these 2 lines where the defaults are set up (near line 63) and everything worked fine again!

Issue Links

Activity

Hide
Mark Nielsen added a comment -

Having trouble reproducing this. I created a multiple choice question and hit the submit button while answering it with no choices filled out and I get the expected result, which is a message saying "No answer given. Please go back and submit an answer." with a Continue button.

Show
Mark Nielsen added a comment - Having trouble reproducing this. I created a multiple choice question and hit the submit button while answering it with no choices filled out and I get the expected result, which is a message saying "No answer given. Please go back and submit an answer." with a Continue button.
Hide
Christian Deligant added a comment -

You should create a multiple choice question with custom values and multiple correct answers

I noticed it on the new (as of the post) updated version of the MOODLE_19_BETA branch, turning on the advanced debugging options

Show
Christian Deligant added a comment - You should create a multiple choice question with custom values and multiple correct answers I noticed it on the new (as of the post) updated version of the MOODLE_19_BETA branch, turning on the advanced debugging options
Hide
Jonathan Harker added a comment -

I am not able to reproduce this on MOODLE_19_STABLE or CVSHEAD. I am using a lesson with a multi-choice question multiple correct answers, with debugging messages turned up to 11.

Hi Christian, can you please post a course backup of a lesson question that causes this behaviour.

Otherwise if this has been fixed in HEAD we should close this.

Show
Jonathan Harker added a comment - I am not able to reproduce this on MOODLE_19_STABLE or CVSHEAD. I am using a lesson with a multi-choice question multiple correct answers, with debugging messages turned up to 11. Hi Christian, can you please post a course backup of a lesson question that causes this behaviour. Otherwise if this has been fixed in HEAD we should close this.
Hide
Jonathan Harker added a comment -

This is a lesson question I tested.

Show
Jonathan Harker added a comment - This is a lesson question I tested.
Hide
Mark Nielsen added a comment -

Turns out this is a duplicate bug, which has been fixed and that is why we cannot reproduce.

Show
Mark Nielsen added a comment - Turns out this is a duplicate bug, which has been fixed and that is why we cannot reproduce.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: