Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-38542

Short answer questions don't handle zeros with wild cards well when "0" is given by a student.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.3.6, 2.4.3, 2.5
    • Fix Version/s: 2.3.7, 2.4.4
    • Component/s: Quiz
    • Testing Instructions:
      Hide

      1) Import the attached question file (MoodleXML) (or otherwise create the example Cloze question below).
      2) Preview the question.
      3) Enter an answer of "0" for each question. Verify that all parts are marked correct.
      4) Enter an answer of "0 pairs" for each question. Verify that ONLY Parts 2 and 3 are marked correct.
      5) Enter an answer of "The answer is 0" for each question. Verify that ONLY Parts 2 and 4 are marked correct.
      6) You may also wish to check stand-alone Short-answer questions that are no embedded in a Cloze question.

      Show
      1) Import the attached question file (MoodleXML) (or otherwise create the example Cloze question below). 2) Preview the question. 3) Enter an answer of "0" for each question. Verify that all parts are marked correct. 4) Enter an answer of "0 pairs" for each question. Verify that ONLY Parts 2 and 3 are marked correct. 5) Enter an answer of "The answer is 0" for each question. Verify that ONLY Parts 2 and 4 are marked correct. 6) You may also wish to check stand-alone Short-answer questions that are no embedded in a Cloze question.
    • Affected Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      This is an issue in both normal Short Answer and SHORTANSWER questions in an Embedded Answers (Cloze) question. I've attached a Cloze question to make it easy to see all the possibilities.

      1) Import the attached question file (MoodleXML).
      2) Preview the question.
      3) Enter an answer of "0" for each question. Only the first question is marked as correct. All should be marked as correct.
      4) Enter an answer of "0 pairs" for each question. All are marked as expected.
      5) Enter an answer of "The answer is 0" for each question. All are marked as expected.

      I recently upgraded from 2.4.1+ to 2.4.3. Many students before the upgrade took a quiz with a similar question and it was graded correctly. A student doing a makeup after the upgrade was graded incorrectly.

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            timhunt Tim Hunt added a comment -

            Just to make it clearer, here is the sample Cloze question:

            <p>This is a test performed after upgrading to 2.4.3</p>
            <p>How many lone pairs are on the central atom in the ammonium ion?</p>
            <p>This question the answer is listed as 0 {1:SHORTANSWER:=0}</p>
            <p>This question has the answer as *0* {1:SHORTANSWER:=*0*}</p>
            <p>This question has the answer as 0* {1:SHORTANSWER:=0*}</p>
            <p>This question has the answer as *0 {1:SHORTANSWER:=*0}</p>

            This looks like a classic PHP '' == '0' bug. I will look into it.

            Show
            timhunt Tim Hunt added a comment - Just to make it clearer, here is the sample Cloze question: < p >This is a test performed after upgrading to 2.4.3</ p > < p >How many lone pairs are on the central atom in the ammonium ion?</ p > < p >This question the answer is listed as 0 {1:SHORTANSWER:=0}</ p > < p >This question has the answer as *0* {1:SHORTANSWER:=*0*}</ p > < p >This question has the answer as 0* {1:SHORTANSWER:=0*}</ p > < p >This question has the answer as *0 {1:SHORTANSWER:=*0}</ p > This looks like a classic PHP '' == '0' bug. I will look into it.
            Hide
            timhunt Tim Hunt added a comment -

            MDL-37157 is where the problem was introduced.

            Show
            timhunt Tim Hunt added a comment - MDL-37157 is where the problem was introduced.
            Hide
            timhunt Tim Hunt added a comment -

            Or, more specifically, MDL-37746.

            Show
            timhunt Tim Hunt added a comment - Or, more specifically, MDL-37746 .
            Hide
            timhunt Tim Hunt added a comment -

            Thanks for finding this.

            Show
            timhunt Tim Hunt added a comment - Thanks for finding this.
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            Integrated (23, 24 & master), thanks!

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - Integrated (23, 24 & master), thanks!
            Hide
            fred Frédéric Massart added a comment -

            Sorry for the noise, I mistyped my issue number :-/.

            Show
            fred Frédéric Massart added a comment - Sorry for the noise, I mistyped my issue number :-/.
            Hide
            ankit_frenz Ankit Agarwal added a comment -

            Sorry this is failing at step 4 and 5. Attached a pic for the same.
            Thanks

            Show
            ankit_frenz Ankit Agarwal added a comment - Sorry this is failing at step 4 and 5. Attached a pic for the same. Thanks
            Hide
            worfds91 Joshua Bragg added a comment -

            I took the liberty of updating the testing instructions. My initial directions were simplified too much and I messed up Tim. The behavior you saw Ankit was the correct behavior.

            Show
            worfds91 Joshua Bragg added a comment - I took the liberty of updating the testing instructions. My initial directions were simplified too much and I messed up Tim. The behavior you saw Ankit was the correct behavior.
            Hide
            timhunt Tim Hunt added a comment -

            Thanks Joshua.

            Ankit, 'marked correct' should have said 'marked correctLY' meaning, marked the way they should be given the question definition – which Josua has now made clear.

            I am sure this will be a pass when you re-test.

            Show
            timhunt Tim Hunt added a comment - Thanks Joshua. Ankit, 'marked correct' should have said 'marked correctLY' meaning, marked the way they should be given the question definition – which Josua has now made clear. I am sure this will be a pass when you re-test.
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            (sending back to another testing round, thanks!)

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - (sending back to another testing round, thanks!)
            Hide
            ankit_frenz Ankit Agarwal added a comment -

            Passing. All good.
            Thanks

            Show
            ankit_frenz Ankit Agarwal added a comment - Passing. All good. Thanks
            Hide
            damyon Damyon Wiese added a comment -

            This issue has been integrated upstream and is now available via git (and in some hours, via mirrors and downloads).

            Thanks for your contributions!

            Show
            damyon Damyon Wiese added a comment - This issue has been integrated upstream and is now available via git (and in some hours, via mirrors and downloads). Thanks for your contributions!

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  13/May/13