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

mod_quiz_process_attempt web service doesn't allow finishing attempts in grace period

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.5.2
    • Fix Version/s: 3.5.4
    • Component/s: Quiz
    • Testing Instructions:
      Hide
      Prerequisite
      1. Moodle mobile app.
      2. Your Moodle mobile app should be able to connect to your Moodle website. You can either do the following:
        • Ensure that the phone with the mobile app and the web server are on the same network. Or
        • Expose the web server over the internet via ngrok.
      Test
      1. As admin create a quiz activity in a course with the following settings:
        • "Time limit" set to 5 seconds
        • "When time expires" set to "There is a grace period when open attempts can be submitted, but no more questions answered"
        • "Submission grace period". set to 1 day
      2. Configure the quiz and add at least one question to it
      3. Enrol one user as student in the course
      4. Enable "Mobile services": Site administration ► Mobile app ► Mobile settings
      5. Access to the quiz via the mobile app using the student account
      6. Do not submit the quiz, let the timer finish and confirm that
        • You see an Overdue notice
        • You are redirected to the attempts page where the last attempt indicates that is Overdue
        • You have an option/button for "Continue the last attempt"
        • If you click on that button, you go to a new page where you are able to submit the Overdue attempt
      Show
      Prerequisite Moodle mobile app. Your Moodle mobile app should be able to connect to your Moodle website. You can either do the following: Ensure that the phone with the mobile app and the web server are on the same network. Or Expose the web server over the internet via ngrok. Test As admin create a quiz activity in a course with the following settings: "Time limit" set to 5 seconds "When time expires" set to "There is a grace period when open attempts can be submitted, but no more questions answered" "Submission grace period". set to 1 day Configure the quiz and add at least one question to it Enrol one user as student in the course Enable "Mobile services": Site administration ► Mobile app ► Mobile settings Access to the quiz via the mobile app using the student account Do not submit the quiz, let the timer finish and confirm that You see an Overdue notice You are redirected to the attempts page where the last attempt indicates that is Overdue You have an option/button for "Continue the last attempt" If you click on that button, you go to a new page where you are able to submit the Overdue attempt
    • Affected Branches:
      MOODLE_35_STABLE
    • Fixed Branches:
      MOODLE_35_STABLE
    • Pull from Repository:
    • Pull 3.5 Branch:
    • Pull Master Branch:
      MDL-63394-master

      Description

      Steps to reproduce:

      1. Setup a quiz with a small "Time limit", "When time expires" set to "There is a grace period when open attempts can be submitted, but no more questions answered" and a long "Submission grace period".
      2. Start a new quiz attempt and wait for the time limit to reach 0.
      3. Now call the WebService mod_quiz_process_attempt with the attemptid and finishattempt set to 1. Check that the WS always returns an exception.

      I checked the WS code and mod_quiz_process_attempt calls validate_attempt with only 2 parameters. This means that $failifoverdue is set to true, so an exception is returned if the state of the attempt is overdue.

        Attachments

        1. IMG_2587.PNG
          61 kB
          Eloy Lafuente (stronk7)
        2. IMG_2588.PNG
          60 kB
          Eloy Lafuente (stronk7)
        3. IMG_2589.PNG
          51 kB
          Eloy Lafuente (stronk7)
        4. IMG_2590.PNG
          173 kB
          Eloy Lafuente (stronk7)
        5. IMG_2591.PNG
          76 kB
          Eloy Lafuente (stronk7)
        6. IMG_2592.PNG
          64 kB
          Eloy Lafuente (stronk7)
        7. IMG_2593.PNG
          59 kB
          Eloy Lafuente (stronk7)
        8. screenshot-1.png
          148 kB
          Janelle Barcega

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  14/Jan/19

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 31 minutes
                  31m