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

Delete quiz attempts does not reset user attempts

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 2.0.4
    • 2.0.1, 2.1
    • Quiz
    • Centos 5 php 5.2.16
    • MySQL
    • MOODLE_20_STABLE, MOODLE_21_STABLE
    • MOODLE_20_STABLE
    • Hide

      Choose to delete most recent or all attempts.

      Show
      Choose to delete most recent or all attempts.
    • 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

      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.

            timhunt Tim Hunt
            cparment Chad Parmentier
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Marina Glancy Marina Glancy
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.