Moodle
  1. Moodle
  2. MDL-9375

Each attempt builds on last with multi-page quizzes gives the wrong score on the second and later attempts

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 1.6.5, 1.7.3, 1.8.3
    • Fix Version/s: 1.6.6, 1.7.4, 1.8.4
    • Component/s: Quiz
    • Labels:
      None
    • Environment:
      Postgres 8.2.0, PHP 4.3.9, Mdl 1.6.5+ (dated April 13th) CVS.
    • Database:
      PostgreSQL
    • Affected Branches:
      MOODLE_16_STABLE, MOODLE_17_STABLE, MOODLE_18_STABLE
    • Fixed Branches:
      MOODLE_16_STABLE, MOODLE_17_STABLE, MOODLE_18_STABLE
    • Rank:
      29555

      Description

      It seems that there is still something wrong with the "builds up on the last" feature when the questions are distributed on several quiz pages. The problem is that when a quiz with several pages is taken, the answers are recorded correctly for the first page.

      Steps to reproduce:

      1) Use Mdl 1.6.5+ code and create a quiz with e.g. 30 random questions on 6 pages (5 questions per page)

      2) Take the exam and answer the questions on the 1st page: everything OK here, grade is OK and the answers are saved and shown correctly after the quiz. You might have e.g. 130 points at this moment.

      3) Take the exam again and answer a question (or more) on the second or latter question pages.

      4) Submit the quiz. Now your grade should be 160 point or more. What happens, however, is that your score goes down from 130 to 30, that is: your answers from the 1st question page are not calculated at all, even though you can see your answers for the 1st page (at the review quiz -situation). The answers are correct, but the resulting grade is not.

      This bug must be closely linked to the bug I submitted some weeks earlier: http://tracker.moodle.org/browse/MDL-8958

      At that time, the bug got fixed OK with one single question page, but apparently having questions distributed on several pages was a thing which none of us remembered to check.

        Issue Links

          Activity

          Hide
          Wen Hao Chuang added a comment -

          is this just an issue for PostgreSQL or does it also apply to MySQL?

          Show
          Wen Hao Chuang added a comment - is this just an issue for PostgreSQL or does it also apply to MySQL?
          Hide
          Wen Hao Chuang added a comment -

          Is this (and MDL-8958) an issue just for Postgres or is it also an issue for MySQL? Thx!

          Show
          Wen Hao Chuang added a comment - Is this (and MDL-8958 ) an issue just for Postgres or is it also an issue for MySQL? Thx!
          Hide
          Olli Salo added a comment -

          On the MDL-8958 page Paulo Matos replies: "Ok as far as I could understand this is not related to MDL3684, neither is Postgresql specific." I cannot confirm this, however, since we do not run Mdl on MySql.

          Show
          Olli Salo added a comment - On the MDL-8958 page Paulo Matos replies: "Ok as far as I could understand this is not related to MDL3684, neither is Postgresql specific." I cannot confirm this, however, since we do not run Mdl on MySql.
          Hide
          Paulo Matos added a comment -

          This is really strange I could swear I did some tests with multiple pages because I though was MDL-7631 that had break the code.
          I'll redo the tests and will post here my results.

          Paulo

          Show
          Paulo Matos added a comment - This is really strange I could swear I did some tests with multiple pages because I though was MDL-7631 that had break the code. I'll redo the tests and will post here my results. Paulo
          Hide
          Tim Hunt added a comment -

          I can't reproduce this on Moodle 1.9 when I tried just now. Two question quiz on two pages. Shortanswer questions. I have a meeting now. Will try again afterwards.

          Show
          Tim Hunt added a comment - I can't reproduce this on Moodle 1.9 when I tried just now. Two question quiz on two pages. Shortanswer questions. I have a meeting now. Will try again afterwards.
          Hide
          Tim Hunt added a comment -

          It turns out that this was already fixed in Moodle 1.9 (part of commit 1.115 -> 1.116) so I have just backported the relevant changes.

          I have tested that this fixes the reported problem. I have not had time to test that it does not break one of the other billion possible combinations of settings possible with the quiz.

          Code review and testing welcome. I think we have ample evidence that this is a very fragile area of the code.

          Show
          Tim Hunt added a comment - It turns out that this was already fixed in Moodle 1.9 (part of commit 1.115 -> 1.116) so I have just backported the relevant changes. I have tested that this fixes the reported problem. I have not had time to test that it does not break one of the other billion possible combinations of settings possible with the quiz. Code review and testing welcome. I think we have ample evidence that this is a very fragile area of the code.
          Hide
          Peter Sereinigg added a comment -

          Thanks a lot Tim, first Test works fine for that bug!
          Peter

          Show
          Peter Sereinigg added a comment - Thanks a lot Tim, first Test works fine for that bug! Peter
          Hide
          Peter Ruthven-Stuart added a comment -

          Hello Tim,

          Thank you very much for working on this problem.

          I have just created a quiz on the http://demo.moodle.org/ site, only to find that the bug still remains.

          When the quiz is set to 'each attempt builds on last', and there are multiple pages in the quiz, questions that were answered correctly in previous attempts are ignored in the calculation of the new grade.

          Note that if students answer a hither to incorrect or un-attempted question on a page that contains questions that were correct in previous attempts, the calculation for that page of questions is correct. The bug occurs when questions on other pages are correctly answered. Then, all previously correctly answered questions are ignored in the calculation.

          I hope this makes sense.

          The moodle demo site is version 1.8.2+, has this currently stable version in fact been fixed by you?

          Show
          Peter Ruthven-Stuart added a comment - Hello Tim, Thank you very much for working on this problem. I have just created a quiz on the http://demo.moodle.org/ site, only to find that the bug still remains. When the quiz is set to 'each attempt builds on last', and there are multiple pages in the quiz, questions that were answered correctly in previous attempts are ignored in the calculation of the new grade. Note that if students answer a hither to incorrect or un-attempted question on a page that contains questions that were correct in previous attempts, the calculation for that page of questions is correct. The bug occurs when questions on other pages are correctly answered. Then, all previously correctly answered questions are ignored in the calculation. I hope this makes sense. The moodle demo site is version 1.8.2+, has this currently stable version in fact been fixed by you?
          Hide
          Tim Hunt added a comment -

          As you can see from http://download.moodle.org/, the current stable version is 1.8.3+. So http://demo.moodle.org/ probably does not include the fix.

          Show
          Tim Hunt added a comment - As you can see from http://download.moodle.org/ , the current stable version is 1.8.3+. So http://demo.moodle.org/ probably does not include the fix.

            People

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

              Dates

              • Created:
                Updated:
                Resolved: