Moodle
  1. Moodle
  2. MDL-27860

Delete quiz attempts does not reset user attempts

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.1, 2.1
    • Fix Version/s: 2.0.4
    • Component/s: Quiz
    • Labels:
    • Environment:
      Centos 5 php 5.2.16
    • Database:
      MySQL
    • Testing Instructions:
      Hide

      1. Create a quiz that allows 2 attempts.
      2. As a Student, attempt the quiz twice.
      3. Verify that you cannot attempt it a third time.
      4. As Teacher/Admin, delete the second attempt.
      5. As student verify that you can make an new attempt 2.
      6. As Teacher/Admin, delete the first attempt.
      7. As student verify that you can make an new attempt, that gets numbered attempt 3., so you now have two attempts numbered 2. and 3.
      8. Verify no more attempts are possible

      Show
      1. Create a quiz that allows 2 attempts. 2. As a Student, attempt the quiz twice. 3. Verify that you cannot attempt it a third time. 4. As Teacher/Admin, delete the second attempt. 5. As student verify that you can make an new attempt 2. 6. As Teacher/Admin, delete the first attempt. 7. As student verify that you can make an new attempt, that gets numbered attempt 3., so you now have two attempts numbered 2. and 3. 8. Verify no more attempts are possible
    • Workaround:
      Hide

      Choose to delete most recent or all attempts.

      Show
      Choose to delete most recent or all attempts.
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE
    • Pull from Repository:
    • Pull Master Branch:
    • Rank:
      17549

      Description

      When a quiz is created and set to allow more than one attempts if a teacher deletes student attempts other than the most recent the quiz attempts are not reset.
      In researching this more I found that the attempts are stored in mdl_data_attempts / attempts column as attempt 1 attempt 2 and so on. For each attempt a new column is written to the database and given an attempt id. When you delete an attempt is deletes the whole row for in the database. The problem is moodle gets the value from the attempt column in the database. So if you allow 8 attempts and delete all attempts accept the most recent when moodle fetches the attempt value it reads 2 4 or 6 and matches the attempt limit. So the student is recieves a message stating all attempts have been used.

      I have tested this on two different servers one running 2.0.1+ and am fairly sure this affects 2.0 and up.

        Issue Links

          Activity

          Hide
          Eloy Lafuente (stronk7) added a comment -

          Integrated, thanks!

          Show
          Eloy Lafuente (stronk7) added a comment - Integrated, thanks!
          Hide
          Eloy Lafuente (stronk7) added a comment -

          All git & cvs servers have been updated with these cool changes, so closing, many thanks!

          Show
          Eloy Lafuente (stronk7) added a comment - All git & cvs servers have been updated with these cool changes, so closing, many thanks!

            People

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

              Dates

              • Created:
                Updated:
                Resolved: