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

Quiz overall feedback incorrect as based on rounded result

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.7
    • Fix Version/s: 1.9.11
    • Component/s: Quiz
    • Labels:
    • Difficulty:
      Moderate
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      1. Create a quiz with 15 questions
      2. Set the overall feedback to display "You passed!" for 70% => 100% and "Try again" for 0% => 70%
      3. Attempt the quiz and get 10 questions right (i.e. 66.7%)
      4. View any of the feedback reports

      Expected result:
      "Try again" is displayed (as student did not reach the 70% pass mark)

      Actual result:
      "You passed!" is displayed

      The problem seems to be that 'quiz_report_feedback_for_grade' is called using the output of 'quiz_rescale_grade'. However, the third parameter is left as the default 'true', so the grade is rounded to 7 (out of 10), before it is returned.

        Gliffy Diagrams

          Activity

          Hide
          davosmith Davo Smith added a comment -

          After a little more playing around, I realise that this is only an issue if displaying 0 decimal places.

          Is this by design?

          Show
          davosmith Davo Smith added a comment - After a little more playing around, I realise that this is only an issue if displaying 0 decimal places. Is this by design?
          Hide
          timhunt Tim Hunt added a comment -

          No, it is a bug, I think.

          However, rounding quiz results to too few decimal places is not a good idea because it leads to weird behaviour like this. Wouldn't it be sensible to have the quiz marked out of 15, if there are 15 questions, then no rounding is needed.

          Show
          timhunt Tim Hunt added a comment - No, it is a bug, I think. However, rounding quiz results to too few decimal places is not a good idea because it leads to weird behaviour like this. Wouldn't it be sensible to have the quiz marked out of 15, if there are 15 questions, then no rounding is needed.
          Hide
          davosmith Davo Smith added a comment -

          Ah, just found the 'maximum score' bit, I'd not noticed that before (I'd been looking on the 'update this quiz' screen).

          The quizzes I've used before have all been more about the answers than the overall score (which is why I'd not worried about what the final mark was out of), except for a couple that were 70% to pass (which is where I hit this bug).

          Show
          davosmith Davo Smith added a comment - Ah, just found the 'maximum score' bit, I'd not noticed that before (I'd been looking on the 'update this quiz' screen). The quizzes I've used before have all been more about the answers than the overall score (which is why I'd not worried about what the final mark was out of), except for a couple that were 70% to pass (which is where I hit this bug).
          Hide
          timhunt Tim Hunt added a comment -

          The bug/fix only applies to 1.9.x. It is already working in 2.0.

          Show
          timhunt Tim Hunt added a comment - The bug/fix only applies to 1.9.x. It is already working in 2.0.
          Hide
          stronk7 Eloy Lafuente (stronk7) added a comment -

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

          Thanks!

          Show
          stronk7 Eloy Lafuente (stronk7) added a comment - This has been integrated and is now available both via git and cvs (and in some hours, via mirrors and downloads). Thanks!

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                21/Feb/11