Moodle
  1. Moodle
  2. MDL-3030

Late quiz attempts should be closed automatically

    Details

    • Testing Instructions:
      Hide

      You may wish to read http://docs.moodle.org/dev/Quiz_time_controls_on_attempts to understand what is going on.

      The following are the proposed MDLQA tests for this that I have sent to Tim B.

      MDLQA-297 A teacher can set a time limit for a quiz

      This test requires a quiz containing several questions, and When time expires set to Submit attempt automatically.

      1. Login as a teacher, edit the settings for the quiz and set a time limit.
      2. Login as a student, access the quiz and check that the time limit is stated.
      3. Attempt the quiz and check that the time left is displayed on each page, including the summary page.
      4. Answer some but not all of the questions, then leave the browser window open until time expires.
      5. Check that when the time runs out, the quiz is submitted automatically with whatever answers have been filled in.

      MDLQA-new1 When time expires, the quiz may be submitted automatically

      1. As teacher, edit the settings for the quiz and set a time limit and/or a close date.
      2. ... and set When time expires to Submit attempt automatically.

      3. As student, start a quiz attempt and answer some questions. Then log out of Moodle.
      4. Wait until a few seconds time limit has expired, or the close date has passed, then log back in as a teacher, and make sure that the attempt is still shown as In-progress.
      5. Then, also very soon after time expired, log in as a student, and go to the quiz info page. This should cause the quiz attempt to be automatically submitted, so you should see that your attempt is finished, with those questions you had answered graded.

      6. As another student, start a quiz attempt and answer some questions. Then log out of Moodle.
      7. Wait until time has expired, and then a further hour has passed (so that the quiz cron, which runs once per hour, has had a chance to do its thing).
      8. Log in as teacher, and you should be able to see that the attempt has been updated to be finished.
      9. Log in as student, and you should see that the attempt has been submitted.

      Ideally test both cases in 1. That is, do one attempt that is brought to an end because time time limit runs out before the close date, and another test where the quiz is brought to an end because the close date passes before the time limit runs out.

      MDLQA-new2 When time expires, the student may be out of luck

      This test is similar to MDLQA-new1.

      1. As teacher, edit the settings for the quiz and set a time limit and/or a close
      2. ... and set When time expires to 'that is it. The attempt must be submitted before time expires, or it is not counted'

      ... Steps 3. to 9. as for MDLQA-new1, except that being submitted, the attempt goes into a 'Never submitted' state, where no grades are counted.

      10. As student, start a quiz attempt and answer some questions. Then leave that browser window open until time expires.
      11. When time expires, you quiz attempt should be submitted automatically, and the grade counted.

      MDLQA-new3 When time expires, the student may be allowed extra time to submit

      This test is similar to MDLQA-new1.

      1. As teacher, edit the settings for the quiz and set a time limit and/or a close date.
      2. ... and set When time expires to Allow a grace period to submit, but not change any responses. Set Submission grace period to a suitable amount of time to let you do the tests below.

      3. As student, start a quiz attempt and answer some questions. Then leave the browser tab open until time expires.
      4. You should be automatically redirected to the review page, and the quiz should move into the overdue state. The timer should count down telling you how long you have in which to submit.
      5. Click the submit button, and your attempt should be submitted and counted.

      6. As student, start a quiz attempt and answer some questions. Then lot out of Moodle.
      7. Wait until a few seconds time limit has expired, or the close date has passed, then log back in as a teacher, and make sure that the attempt is still shown as In-progress.
      8. Then, also very soon after time expired, log in as a student, and go to the quiz info page. This should cause the quiz attempt to be automatically moved to the Overdue state. There should be a Continue last attempt button.
      9. Click that button, and you should be taken to the summary page, where you are told you can still submit up to a certain time.
      10. Submit, and make sure your score is counted.

      11. As another student, start a quiz attempt and answer some questions. Then log out of Moodle.
      12. Wait until time has expired, and then a further hour has passed (so that the quiz cron, which runs once per hour, has had a chance to do its thing).
      13. Log in as teacher, and you should be able to see that the attempt has been updated to be Overdue.
      14. Log in as student, and repeat steps 8. to 10.

      MDLQA-new4 When time expires, the student may be allowed extra time to submit, but does not need to do so

      This test is similar to MDLQA-new3, but with changes at steps 5, 10 and 14.

      1. As teacher, edit the settings for the quiz and set a time limit and/or a close date.
      2. ... and set When time expires to Allow a grace period to submit, but not change any responses. Set Submission grace period to a suitable amount of time to let you do the tests below.

      3. As student, start a quiz attempt and answer some questions. Then leave the browser tab open until time expires.
      4. You should be automatically redirected to the review page, and the quiz should move into the overdue state. The timer should count down telling you how long you have in which to submit.
      5. Do nothing. After the end of the grace period, the attempt should move to the Never submitted state (as in MDLQA-new2).

      6. As student, start a quiz attempt and answer some questions. Then lot out of Moodle.
      7. Wait until a few seconds time limit has expired, or the close date has passed, then log back in as a teacher, and make sure that the attempt is still shown as In-progress.
      8. Then, also very soon after time expired, log in as a student, and go to the quiz info page. This should cause the quiz attempt to be automatically moved to the Overdue state. There should be a Continue last attempt button.
      9. Click that button, and you should be taken to the summary page, where you are told you can still submit up to a certain time.
      10. Do nothing. After the end of the grace period, the attempt should move to the Never submitted state (as in MDLQA-new2).

      11. As another student, start a quiz attempt and answer some questions. Then log out of Moodle.
      12. Wait until time has expired, and then a further hour has passed (so that the quiz cron, which runs once per hour, has had a chance to do its thing).
      13. Log in as teacher, and you should be able to see that the attempt has been updated to be Overdue.
      14. Log in as student, and repeat steps 8. to 10.

      Show
      You may wish to read http://docs.moodle.org/dev/Quiz_time_controls_on_attempts to understand what is going on. The following are the proposed MDLQA tests for this that I have sent to Tim B. MDLQA-297 A teacher can set a time limit for a quiz This test requires a quiz containing several questions, and When time expires set to Submit attempt automatically. 1. Login as a teacher, edit the settings for the quiz and set a time limit. 2. Login as a student, access the quiz and check that the time limit is stated. 3. Attempt the quiz and check that the time left is displayed on each page, including the summary page. 4. Answer some but not all of the questions, then leave the browser window open until time expires. 5. Check that when the time runs out, the quiz is submitted automatically with whatever answers have been filled in. MDLQA-new1 When time expires, the quiz may be submitted automatically 1. As teacher, edit the settings for the quiz and set a time limit and/or a close date. 2. ... and set When time expires to Submit attempt automatically. 3. As student, start a quiz attempt and answer some questions. Then log out of Moodle. 4. Wait until a few seconds time limit has expired, or the close date has passed, then log back in as a teacher, and make sure that the attempt is still shown as In-progress. 5. Then, also very soon after time expired, log in as a student, and go to the quiz info page. This should cause the quiz attempt to be automatically submitted, so you should see that your attempt is finished, with those questions you had answered graded. 6. As another student, start a quiz attempt and answer some questions. Then log out of Moodle. 7. Wait until time has expired, and then a further hour has passed (so that the quiz cron, which runs once per hour, has had a chance to do its thing). 8. Log in as teacher, and you should be able to see that the attempt has been updated to be finished. 9. Log in as student, and you should see that the attempt has been submitted. Ideally test both cases in 1. That is, do one attempt that is brought to an end because time time limit runs out before the close date, and another test where the quiz is brought to an end because the close date passes before the time limit runs out. MDLQA-new2 When time expires, the student may be out of luck This test is similar to MDLQA-new1. 1. As teacher, edit the settings for the quiz and set a time limit and/or a close 2. ... and set When time expires to 'that is it. The attempt must be submitted before time expires, or it is not counted' ... Steps 3. to 9. as for MDLQA-new1, except that being submitted, the attempt goes into a 'Never submitted' state, where no grades are counted. 10. As student, start a quiz attempt and answer some questions. Then leave that browser window open until time expires. 11. When time expires, you quiz attempt should be submitted automatically, and the grade counted. MDLQA-new3 When time expires, the student may be allowed extra time to submit This test is similar to MDLQA-new1. 1. As teacher, edit the settings for the quiz and set a time limit and/or a close date. 2. ... and set When time expires to Allow a grace period to submit, but not change any responses. Set Submission grace period to a suitable amount of time to let you do the tests below. 3. As student, start a quiz attempt and answer some questions. Then leave the browser tab open until time expires. 4. You should be automatically redirected to the review page, and the quiz should move into the overdue state. The timer should count down telling you how long you have in which to submit. 5. Click the submit button, and your attempt should be submitted and counted. 6. As student, start a quiz attempt and answer some questions. Then lot out of Moodle. 7. Wait until a few seconds time limit has expired, or the close date has passed, then log back in as a teacher, and make sure that the attempt is still shown as In-progress. 8. Then, also very soon after time expired, log in as a student, and go to the quiz info page. This should cause the quiz attempt to be automatically moved to the Overdue state. There should be a Continue last attempt button. 9. Click that button, and you should be taken to the summary page, where you are told you can still submit up to a certain time. 10. Submit, and make sure your score is counted. 11. As another student, start a quiz attempt and answer some questions. Then log out of Moodle. 12. Wait until time has expired, and then a further hour has passed (so that the quiz cron, which runs once per hour, has had a chance to do its thing). 13. Log in as teacher, and you should be able to see that the attempt has been updated to be Overdue. 14. Log in as student, and repeat steps 8. to 10. MDLQA-new4 When time expires, the student may be allowed extra time to submit, but does not need to do so This test is similar to MDLQA-new3, but with changes at steps 5, 10 and 14. 1. As teacher, edit the settings for the quiz and set a time limit and/or a close date. 2. ... and set When time expires to Allow a grace period to submit, but not change any responses. Set Submission grace period to a suitable amount of time to let you do the tests below. 3. As student, start a quiz attempt and answer some questions. Then leave the browser tab open until time expires. 4. You should be automatically redirected to the review page, and the quiz should move into the overdue state. The timer should count down telling you how long you have in which to submit. 5. Do nothing. After the end of the grace period, the attempt should move to the Never submitted state (as in MDLQA-new2). 6. As student, start a quiz attempt and answer some questions. Then lot out of Moodle. 7. Wait until a few seconds time limit has expired, or the close date has passed, then log back in as a teacher, and make sure that the attempt is still shown as In-progress. 8. Then, also very soon after time expired, log in as a student, and go to the quiz info page. This should cause the quiz attempt to be automatically moved to the Overdue state. There should be a Continue last attempt button. 9. Click that button, and you should be taken to the summary page, where you are told you can still submit up to a certain time. 10. Do nothing. After the end of the grace period, the attempt should move to the Never submitted state (as in MDLQA-new2). 11. As another student, start a quiz attempt and answer some questions. Then log out of Moodle. 12. Wait until time has expired, and then a further hour has passed (so that the quiz cron, which runs once per hour, has had a chance to do its thing). 13. Log in as teacher, and you should be able to see that the attempt has been updated to be Overdue. 14. Log in as student, and repeat steps 8. to 10.
    • Affected Branches:
      MOODLE_18_STABLE, MOODLE_19_STABLE, MOODLE_20_STABLE, MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE
    • Pull from Repository:
    • Pull Master Branch:
    • Rank:
      1591

      Description

      In the new quiz code, when an attempt is past its time limit or when the closing date for a quiz has closed, the attempt should automatically be marked and closed.

      1. smurf_aftermerge.xml
        21 kB
        Eloy Lafuente (stronk7)

        Issue Links

          Activity

          Hide
          Harry Smith added a comment -

          Would also be good if it could be linked to session time whether or not the quiz is timed - just had four people have to resit as the session timed out before they submitted . . . they weren't happy people! (quiz set to open in secure window, guessing the session cookie doesn't take account of that?)

          Perhaps a warning could pop up say 1 minute before it times out?

          Show
          Harry Smith added a comment - Would also be good if it could be linked to session time whether or not the quiz is timed - just had four people have to resit as the session timed out before they submitted . . . they weren't happy people! (quiz set to open in secure window, guessing the session cookie doesn't take account of that?) Perhaps a warning could pop up say 1 minute before it times out?
          Hide
          Tim Hunt added a comment -

          I'm not sure if automatic attempt closing is the right thing to do. The alternative is to give teachers an interface to close attempts selectively. http://moodle.org/mod/forum/discuss.php?d=47561 has useful discussion.

          (Session timeouts are a separate issue. I you insist on having a huge long quiz as a single page, and don't encourage your students to save their work periodically as they go along, then there are plenty of other hazards. What if their browser crashes. Anway, please don't disucss session issues in this report. Please take it to the quiz forum in the first instance.)

          Show
          Tim Hunt added a comment - I'm not sure if automatic attempt closing is the right thing to do. The alternative is to give teachers an interface to close attempts selectively. http://moodle.org/mod/forum/discuss.php?d=47561 has useful discussion. (Session timeouts are a separate issue. I you insist on having a huge long quiz as a single page, and don't encourage your students to save their work periodically as they go along, then there are plenty of other hazards. What if their browser crashes. Anway, please don't disucss session issues in this report. Please take it to the quiz forum in the first instance.)
          Hide
          Gustav W Delius added a comment -

          Why wouldn't closing the attempt be the right thing to do? Student's don't have a chance to make changes to their answers any more anyway, so the attempt can just as well be closed.

          I am surprised that people have been willing to live with this bug for over two years! Of course it was my fault to create the bug in the first place.

          Show
          Gustav W Delius added a comment - Why wouldn't closing the attempt be the right thing to do? Student's don't have a chance to make changes to their answers any more anyway, so the attempt can just as well be closed. I am surprised that people have been willing to live with this bug for over two years! Of course it was my fault to create the bug in the first place.
          Hide
          Elena Ivanova added a comment -

          Same issue with 1.8, by the way.
          Student click "Save without Submit" button, instead of submitting, then the quiz closes, but the attempt will be sitting as "open".
          The worst part - grade will not show up in the gradebook, and there is no way for the instructor to manually overwrite anything in such attempt, or "force"/close submission.

          Show
          Elena Ivanova added a comment - Same issue with 1.8, by the way. Student click "Save without Submit" button, instead of submitting, then the quiz closes, but the attempt will be sitting as "open". The worst part - grade will not show up in the gradebook, and there is no way for the instructor to manually overwrite anything in such attempt, or "force"/close submission.
          Hide
          Anthony Borrow added a comment -

          Tim - Giving the teacher a convenient way to close open quizzes would be quite useful. One thought I have is that it would be nice to add to the list of options when selecting attempts. I think it would be helpful to add Close Selected Attempts and Regrade Selected Attempts in addition to Delete. Given the suggestions on: http://moodle.org/mod/forum/discuss.php?d=47561 giving teacher the ability to close all attempts should be fairly simple. I'd be interested in your thoughts on the matter. It seems to be enough of an issue to periodically come up (most recently at http://moodle.org/mod/forum/discuss.php?d=62465). I know as a teacher I found this to be occasionally frustrating. The only workaround that I know of is to login as the student and have the teacher submit it for them; however, this is very time consuming if there are multiple attempts. Peace - Anthony

          Show
          Anthony Borrow added a comment - Tim - Giving the teacher a convenient way to close open quizzes would be quite useful. One thought I have is that it would be nice to add to the list of options when selecting attempts. I think it would be helpful to add Close Selected Attempts and Regrade Selected Attempts in addition to Delete. Given the suggestions on: http://moodle.org/mod/forum/discuss.php?d=47561 giving teacher the ability to close all attempts should be fairly simple. I'd be interested in your thoughts on the matter. It seems to be enough of an issue to periodically come up (most recently at http://moodle.org/mod/forum/discuss.php?d=62465 ). I know as a teacher I found this to be occasionally frustrating. The only workaround that I know of is to login as the student and have the teacher submit it for them; however, this is very time consuming if there are multiple attempts. Peace - Anthony
          Hide
          Tim Hunt added a comment -

          The trouble is that the code that finishes an attempt is all mixed up in attempt.php. This certainly needs to be implemented, but it requires a bit of refactoring to pull off, so it is a bit of work.

          Show
          Tim Hunt added a comment - The trouble is that the code that finishes an attempt is all mixed up in attempt.php. This certainly needs to be implemented, but it requires a bit of refactoring to pull off, so it is a bit of work.
          Hide
          Steve Hannah added a comment -

          Could an automatic "warning" be populated on the quiz template or as a popup as Harry suggests that if the student does not "Save and Submit" before the timer runs out their quiz will not be graded? This would probably be an easier interim fix. But I also vote for automatic closing for a number of reasons.

          Show
          Steve Hannah added a comment - Could an automatic "warning" be populated on the quiz template or as a popup as Harry suggests that if the student does not "Save and Submit" before the timer runs out their quiz will not be graded? This would probably be an easier interim fix. But I also vote for automatic closing for a number of reasons.
          Hide
          Matt Jenner added a comment -

          We struggle though this problem too.

          We have a Course Administrator role (which isn't too dissimilar from Tutor) which we wondered about adding the capability of 'Log in as other users' to give chosen users the ability to close off open quiz submissions. Does anyone does this, or recommend against it?

          Ideally a tutor would be able to close off open but yet Closed submissions, or indeed for the Moodle system to do such a task automatically in a cron job when the quiz time has passed?

          Keep up the good work Tim.

          Show
          Matt Jenner added a comment - We struggle though this problem too. We have a Course Administrator role (which isn't too dissimilar from Tutor) which we wondered about adding the capability of 'Log in as other users' to give chosen users the ability to close off open quiz submissions. Does anyone does this, or recommend against it? Ideally a tutor would be able to close off open but yet Closed submissions, or indeed for the Moodle system to do such a task automatically in a cron job when the quiz time has passed? Keep up the good work Tim.
          Hide
          Clark Shah-Nelson added a comment -

          This is definitely needed - seeing too many students start an attempt and leave it open, then have the time run out, the quiz close, and the attempt is still marked as open - so the instructor must re-open the quiz, login as the student and click on "save and submit" to get the quiz graded. The functionality in the description above is what is needed to resolve that.

          Show
          Clark Shah-Nelson added a comment - This is definitely needed - seeing too many students start an attempt and leave it open, then have the time run out, the quiz close, and the attempt is still marked as open - so the instructor must re-open the quiz, login as the student and click on "save and submit" to get the quiz graded. The functionality in the description above is what is needed to resolve that.
          Hide
          Tim Hunt added a comment -

          Just updating the summary, having struggled to find this in a search.

          Show
          Tim Hunt added a comment - Just updating the summary, having struggled to find this in a search.
          Hide
          Ian Wilson added a comment -

          This is also an issue in 1.9. I am running Moodle 1.9.5+ (Build: 20090902) on a Mac Pro with Mac OS 10.5.8.

          An interesting point is that even if a student "saves without submitting" his/her answers before the time limit (and the system knows this because it shows the (non-zero) raw score), the student still ends up with a grade of 0 if s/he doesn't "submit all and finish" before the time limit.

          Show
          Ian Wilson added a comment - This is also an issue in 1.9. I am running Moodle 1.9.5+ (Build: 20090902) on a Mac Pro with Mac OS 10.5.8. An interesting point is that even if a student "saves without submitting" his/her answers before the time limit (and the system knows this because it shows the (non-zero) raw score), the student still ends up with a grade of 0 if s/he doesn't "submit all and finish" before the time limit.
          Hide
          Juan Raul Garcia Canet added a comment -

          I have tested the Sigurdur Smarason's solution in http://moodle.org/mod/forum/discuss.php?d=118343 and it worked correctly in my version 1.9.5 +.

          Could be a good solution.

          Show
          Juan Raul Garcia Canet added a comment - I have tested the Sigurdur Smarason's solution in http://moodle.org/mod/forum/discuss.php?d=118343 and it worked correctly in my version 1.9.5 +. Could be a good solution.
          Hide
          Luis de Vasconcelos added a comment -

          Another related discussion:

          The old problem the late quiz attempts are not closed automatically ...
          http://moodle.org/mod/forum/discuss.php?d=138660

          It links to: http://docs.moodle.org/en/Development:States_of_a_quiz_attempt

          Show
          Luis de Vasconcelos added a comment - Another related discussion: The old problem the late quiz attempts are not closed automatically ... http://moodle.org/mod/forum/discuss.php?d=138660 It links to: http://docs.moodle.org/en/Development:States_of_a_quiz_attempt
          Hide
          Wen Hao Chuang added a comment -

          Seems like this issue also affects 1.9.x, should we change the "Affects Version/s" in this ticket to reflect this fact as well? Just my 2 cents..

          Show
          Wen Hao Chuang added a comment - Seems like this issue also affects 1.9.x, should we change the "Affects Version/s" in this ticket to reflect this fact as well? Just my 2 cents..
          Hide
          Tim Hunt added a comment -

          No. Don't bother.

          Show
          Tim Hunt added a comment - No. Don't bother.
          Hide
          Cay Horstmann added a comment -

          This is particularly frustrating when you use a "quiz" to collect homework problem, each of which takes the student some effort. They come to the question, paste in their first solution, click on "Save without submitting", work on their next problem, come back, etc.

          When they are done, they get to choose between "Submit page" and "Submit all and finish".

          "Submit page" sounds like a reasonable choice, so some of them click it and walk away, have the time expire, and wonder why they get an F.

          What is URGENTLY needed is an option "Close quiz after it expires"!

          Show
          Cay Horstmann added a comment - This is particularly frustrating when you use a "quiz" to collect homework problem, each of which takes the student some effort. They come to the question, paste in their first solution, click on "Save without submitting", work on their next problem, come back, etc. When they are done, they get to choose between "Submit page" and "Submit all and finish". "Submit page" sounds like a reasonable choice, so some of them click it and walk away, have the time expire, and wonder why they get an F. What is URGENTLY needed is an option "Close quiz after it expires"!
          Hide
          Dennis Meyer added a comment -

          Tim wrote "The alternative is to give teachers an interface to close attempts selectively".
          That would be nice and functionally for me It directly shows the teacher: oh... maybe there was an error on the internet-connection and this Student couldn't close the test by himself...

          Would be nice to be fixed that way.

          Show
          Dennis Meyer added a comment - Tim wrote "The alternative is to give teachers an interface to close attempts selectively". That would be nice and functionally for me It directly shows the teacher: oh... maybe there was an error on the internet-connection and this Student couldn't close the test by himself... Would be nice to be fixed that way.
          Hide
          Richard Lobb added a comment -

          I teach a class of 400 students who each sit 10 quizzes in a one semester course and another class of 120 students who each sit 15 quizzes. That's a total of around 5800 quiz-sittings. The quizzes count towards students' final grades. In all cases the quizzes are open for a week or more, while students work through associated laboratory exercises. Further, the quizzes are set up so students can submit each question as they do it. This means the green ticks steadily mount day by day as do their apparent total marks. Under these circumstances it's very easy and natural for students to forget to click the "Submit all and finish" button. Even if only 1% do so (and the actual number is probably around that), I still have 58 disgruntled students to deal with, for each of whom I have to open the quiz (for everyone in the class) and wait while the student logs in and clicks that silly close button and then I can close the quiz again.

          This is the first year I've used Moodle after years of using Blackboard. I love the Moodle quiz module except for this one ghastly bug. Even the thoroughly inferior Blackboard quiz module would let me force submission of all incomplete quizzes. The proposal to allow me to manually log on as each student and force submission of that student's quizzes would help slightly but would still be a poor substitute for a global closure of incomplete submissions.

          Show
          Richard Lobb added a comment - I teach a class of 400 students who each sit 10 quizzes in a one semester course and another class of 120 students who each sit 15 quizzes. That's a total of around 5800 quiz-sittings. The quizzes count towards students' final grades. In all cases the quizzes are open for a week or more, while students work through associated laboratory exercises. Further, the quizzes are set up so students can submit each question as they do it. This means the green ticks steadily mount day by day as do their apparent total marks. Under these circumstances it's very easy and natural for students to forget to click the "Submit all and finish" button. Even if only 1% do so (and the actual number is probably around that), I still have 58 disgruntled students to deal with, for each of whom I have to open the quiz (for everyone in the class) and wait while the student logs in and clicks that silly close button and then I can close the quiz again. This is the first year I've used Moodle after years of using Blackboard. I love the Moodle quiz module except for this one ghastly bug. Even the thoroughly inferior Blackboard quiz module would let me force submission of all incomplete quizzes. The proposal to allow me to manually log on as each student and force submission of that student's quizzes would help slightly but would still be a poor substitute for a global closure of incomplete submissions.
          Hide
          Tim Hunt added a comment -

          The good news, for people who care about this bug, is that the OU now cares about this, so it is now on my priority list. It is not at the top yet, but it is getting there.

          Also note that having had some time to think about it, the solution on http://docs.moodle.org/en/Development:States_of_a_quiz_attempt seems about right to me. (Sorry that page is a bit long and rambling, the key stuff is at the end when it gets to specific proposals.)

          If you can, please review that page and comment on whether the solution suggested there fixes the problem for you.

          Show
          Tim Hunt added a comment - The good news, for people who care about this bug, is that the OU now cares about this, so it is now on my priority list. It is not at the top yet, but it is getting there. Also note that having had some time to think about it, the solution on http://docs.moodle.org/en/Development:States_of_a_quiz_attempt seems about right to me. (Sorry that page is a bit long and rambling, the key stuff is at the end when it gets to specific proposals.) If you can, please review that page and comment on whether the solution suggested there fixes the problem for you.
          Hide
          Elena Ivanova added a comment -

          Great news, Tim

          I think those 3 would be the most useful from the list in wiki:

          • Teacher should have the option to submit an attempt when the student forgot.
          • If allowed, Students should have the option to submit an attempt late (but not answer any more questions) when they forgot.
          • Quiz has an option set to automatically submit any quiz attempt the moment time has expired.

          So, I imagine "Submit attempt" button/link in the Results area
          And 2 checkboxes for the quiz settings page:

          • Force quiz submission after the time expires
          • Allow students to submit late attempts
          Show
          Elena Ivanova added a comment - Great news, Tim I think those 3 would be the most useful from the list in wiki: Teacher should have the option to submit an attempt when the student forgot. If allowed, Students should have the option to submit an attempt late (but not answer any more questions) when they forgot. Quiz has an option set to automatically submit any quiz attempt the moment time has expired. So, I imagine "Submit attempt" button/link in the Results area And 2 checkboxes for the quiz settings page: Force quiz submission after the time expires Allow students to submit late attempts
          Hide
          Barbara Taylor added a comment -

          Any update to getting this fixed? Will it be fixed for 2.0?

          Show
          Barbara Taylor added a comment - Any update to getting this fixed? Will it be fixed for 2.0?
          Hide
          Tim Hunt added a comment -

          No. Not in 2.0. Hopefully in 2.1.

          Show
          Tim Hunt added a comment - No. Not in 2.0. Hopefully in 2.1.
          Hide
          Dennis Meyer added a comment -

          Any chance for a fix in 1.9.x?

          Show
          Dennis Meyer added a comment - Any chance for a fix in 1.9.x?
          Hide
          Angela Sivia added a comment -

          Dennis, I assume it won't be fixed in 1.9x since Moodle 2 is out. My institution is on 1.9.11 and we would like this to be fixed, too but after reading this, it doesn't look like it will be (I have no proof - just an assumption).

          Show
          Angela Sivia added a comment - Dennis, I assume it won't be fixed in 1.9x since Moodle 2 is out. My institution is on 1.9.11 and we would like this to be fixed, too but after reading this, it doesn't look like it will be (I have no proof - just an assumption).
          Hide
          Kyle Temkin added a comment - - edited

          Since this is still marked unresolved, I thought I'd share my not-quite-solution. This doesn't resolve the issue, but it does provide a workaround, and I use a variant of it to currently address the issue on my Moodle 2.0 server.

          http://labs.ktemkin.com/simple/closeattempt.zip
          Unzip to /mod/quiz/reports/.

          Similar to the 1.9 hack above, this adds a report to the Quiz module. Unlike the hack above, this allows you to select which attempts to close, and has some nice filtering that make the process more convenient.

          Screenshot: http://labs.ktemkin.com/simple/closeattempt_sshot.png

          The filter options allow you to filter the view by:
          -Quiz attempts open after the due date, after overrides are factored in
          -Quiz attempts open after the due date, ignoring overrides
          -All attempts

          A few days after the quiz is due, I typically close all quiz attempts still open after the due date, counting overrides; this only takes me two clicks (select all, close attempts).

          I can't guarantee that this will work properly on your server, though I've been using it for a few weeks on my 2.0 production server, and everything seems fine. As always, I'm not responsible for anything this could unintentionally do.

          This is most definitely not a solution, but it does make my life a lot easier. I'm hoping it might save you guys some time, as well.

          Show
          Kyle Temkin added a comment - - edited Since this is still marked unresolved, I thought I'd share my not-quite-solution. This doesn't resolve the issue, but it does provide a workaround, and I use a variant of it to currently address the issue on my Moodle 2.0 server. http://labs.ktemkin.com/simple/closeattempt.zip Unzip to /mod/quiz/reports/. Similar to the 1.9 hack above, this adds a report to the Quiz module. Unlike the hack above, this allows you to select which attempts to close, and has some nice filtering that make the process more convenient. Screenshot: http://labs.ktemkin.com/simple/closeattempt_sshot.png The filter options allow you to filter the view by: -Quiz attempts open after the due date, after overrides are factored in -Quiz attempts open after the due date, ignoring overrides -All attempts A few days after the quiz is due, I typically close all quiz attempts still open after the due date, counting overrides; this only takes me two clicks (select all, close attempts). I can't guarantee that this will work properly on your server, though I've been using it for a few weeks on my 2.0 production server, and everything seems fine. As always, I'm not responsible for anything this could unintentionally do. This is most definitely not a solution, but it does make my life a lot easier. I'm hoping it might save you guys some time, as well.
          Hide
          Tim Hunt added a comment -
          Show
          Tim Hunt added a comment - I should not here that a proper solution is being planned. See http://moodle.org/mod/forum/discuss.php?d=188534 http://docs.moodle.org/dev/Better_handling_of_overdue_quiz_attempts
          Hide
          Richard Newton added a comment -

          I tried installing this patch on my moodle 2.1 server with no luck. The report does not appear in the show/download drop down menu on the quiz attempt review page.

          Any advice? Thanks.

          Show
          Richard Newton added a comment - I tried installing this patch on my moodle 2.1 server with no luck. The report does not appear in the show/download drop down menu on the quiz attempt review page. Any advice? Thanks.
          Hide
          Tim Hunt added a comment -

          Which patch?

          My branch (https://github.com/timhunt/moodle/compare/master...MDL-3030) is very much work-in-progress, and does not work yet.

          Show
          Tim Hunt added a comment - Which patch? My branch ( https://github.com/timhunt/moodle/compare/master...MDL-3030 ) is very much work-in-progress, and does not work yet.
          Hide
          Kyle Temkin added a comment -

          I'm assuming he's referring to the hack I posted earlier.

          If so, the reason it doesn't work is very likely the question engine overhaul which was part of the Moodle 2.1 release. When I wrote that patch, my university was still using 2.0, and the old question engine.

          I'm going to be using the winter semester break to try and bring our Moodle setup up to date. Since it looks like the proper solution will come out with Moodle 2.3, which I believe is scheduled for June, I may update my hack to work with the new question engine, as a stand-in. I'll post here if I do.

          Show
          Kyle Temkin added a comment - I'm assuming he's referring to the hack I posted earlier. If so, the reason it doesn't work is very likely the question engine overhaul which was part of the Moodle 2.1 release. When I wrote that patch, my university was still using 2.0, and the old question engine. I'm going to be using the winter semester break to try and bring our Moodle setup up to date. Since it looks like the proper solution will come out with Moodle 2.3, which I believe is scheduled for June, I may update my hack to work with the new question engine, as a stand-in. I'll post here if I do.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          side note: while I'm using this as example branch to test some integration things, I've detected "create mode 100755 mod/quiz/report/attemptsreport_table.php"... ciao

          Show
          Eloy Lafuente (stronk7) added a comment - side note: while I'm using this as example branch to test some integration things, I've detected "create mode 100755 mod/quiz/report/attemptsreport_table.php"... ciao
          Hide
          Eloy Lafuente (stronk7) added a comment -

          100% offtopic:

          Tim, just for experimenting, I've uploaded one xml file showing the automated results of various checks (upgrade savepoints, phpcs, phpdocs against your MDL-3030 branch).

          One of the biggest doubts I've had (and continue having), is if I should run all the static tests against your branch once merged with current master or, simply, against your branch. For sure the dynamic ones (installation, db schema, unit-tests, must be run with the merged branch, but statics... not really sure what will be better for fixing them by the developer, as line numbers can diverge.

          The SMURF file attached above has been calculated after merging with current master.

          If you get some mins, plz take a look to it (the xml format is self-explanatory, imagine it's already html/whatever).

          TIA and ciao

          Show
          Eloy Lafuente (stronk7) added a comment - 100% offtopic: Tim, just for experimenting, I've uploaded one xml file showing the automated results of various checks (upgrade savepoints, phpcs, phpdocs against your MDL-3030 branch). One of the biggest doubts I've had (and continue having), is if I should run all the static tests against your branch once merged with current master or, simply, against your branch. For sure the dynamic ones (installation, db schema, unit-tests, must be run with the merged branch, but statics... not really sure what will be better for fixing them by the developer, as line numbers can diverge. The SMURF file attached above has been calculated after merging with current master. If you get some mins, plz take a look to it (the xml format is self-explanatory, imagine it's already html/whatever). TIA and ciao
          Hide
          Rick Jerz added a comment -

          I too have run into this problem, and I am using 2.2.1+. Here's what happened to me.

          I had a 2 hour timed quiz, ending at 11:55PM. The stuudent started at 11:30PM, seemed to quickly check some remaining answers, but forgot to submit.

          Today, I could view her responses, and manually see which questions were right and wrong, but that was it! I am the system admin too, but I could not grade any question because it was still "open", even though the timer should have closed this quiz. All that I was able to do was put a summary grade for this student into the gradebook, and email her which questions she missed.

          I agree with Tim, the teacher should have a button to "close" this quiz, which of course should also grade it.

          I also agree with some others, that the student should also be able to close the quiz, but not answer any other questions.

          A fix to this problem is still needed because as it is right now, its a real headache.

          Show
          Rick Jerz added a comment - I too have run into this problem, and I am using 2.2.1+. Here's what happened to me. I had a 2 hour timed quiz, ending at 11:55PM. The stuudent started at 11:30PM, seemed to quickly check some remaining answers, but forgot to submit. Today, I could view her responses, and manually see which questions were right and wrong, but that was it! I am the system admin too, but I could not grade any question because it was still "open", even though the timer should have closed this quiz. All that I was able to do was put a summary grade for this student into the gradebook, and email her which questions she missed. I agree with Tim, the teacher should have a button to "close" this quiz, which of course should also grade it. I also agree with some others, that the student should also be able to close the quiz, but not answer any other questions. A fix to this problem is still needed because as it is right now, its a real headache.
          Hide
          Rick Jerz added a comment -

          I did find a work around for this problem.

          I removed the due date and time limit restrictions. Then I logged in as the student, and then went back into this quiz, and submitted it. Of course, I quickly re-added the date and time restrictions. This worked for the one student, but I wouldn't want to do this regularly.

          A fix is still needed.

          Show
          Rick Jerz added a comment - I did find a work around for this problem. I removed the due date and time limit restrictions. Then I logged in as the student, and then went back into this quiz, and submitted it. Of course, I quickly re-added the date and time restrictions. This worked for the one student, but I wouldn't want to do this regularly. A fix is still needed.
          Hide
          Vickie Frohne added a comment -

          The work-around (which I use almost daily) is to collar the offending student, set the quiz deadline to expire in five minutes, and have the student log in and "Submit all and Finish" on the spot, hopefully before anyone else notices that the quiz is open. This isn't the most convenient procedure.

          I think that it is better to let the teacher manually close attempts selectively, rather than have the quizzes automatically close at the deadline. This gives the teacher a bit more flexibility with those late-finishing students. It would also be good if a teacher could selectively re-open attempts and have different time limits for different students (for example, for those whose documented learning disabilities entitle them to more time).

          Show
          Vickie Frohne added a comment - The work-around (which I use almost daily) is to collar the offending student, set the quiz deadline to expire in five minutes, and have the student log in and "Submit all and Finish" on the spot, hopefully before anyone else notices that the quiz is open. This isn't the most convenient procedure. I think that it is better to let the teacher manually close attempts selectively, rather than have the quizzes automatically close at the deadline. This gives the teacher a bit more flexibility with those late-finishing students. It would also be good if a teacher could selectively re-open attempts and have different time limits for different students (for example, for those whose documented learning disabilities entitle them to more time).
          Hide
          Joseph Rézeau added a comment -

          @Vickie,
          As far as I know, Moodle is mostly used as an online teaching platform, not face-to-face. How do you "collar offending students" who may live miles or hundreds of miles away?

          Show
          Joseph Rézeau added a comment - @Vickie, As far as I know, Moodle is mostly used as an online teaching platform, not face-to-face. How do you "collar offending students" who may live miles or hundreds of miles away?
          Hide
          Matt Jenner added a comment -

          BTW to be extra safe:

          1. Make a group and grouping called 'quiz closer'
          2. Add the student who needs their work closed to the group
          3. Hide the quiz for all but that grouping
          4. open the quiz
          5. log-in as student and submit attempt

          It's not great - but it might be slightly more tight.

          I wondered if there was a better workaround with roles and capabilities but we don't have this problem that often (but when we do, a cleaner fix would be advantageous)

          Show
          Matt Jenner added a comment - BTW to be extra safe: 1. Make a group and grouping called 'quiz closer' 2. Add the student who needs their work closed to the group 3. Hide the quiz for all but that grouping 4. open the quiz 5. log-in as student and submit attempt It's not great - but it might be slightly more tight. I wondered if there was a better workaround with roles and capabilities but we don't have this problem that often (but when we do, a cleaner fix would be advantageous)
          Hide
          Dennis Meyer added a comment -

          another way: when all Students has temped at least more than one minute in the test, you can reopen it with a time limit of one minute. Now you can login as Student or let the Students login and the quiz closes immediately - you have to reset the time limit again (Students who spend more than one minute over the time will be grade as zero) and regrade the test

          Even not really great - but maybe helpful for someone

          looking forward the Teacher-Button !

          Show
          Dennis Meyer added a comment - another way: when all Students has temped at least more than one minute in the test, you can reopen it with a time limit of one minute. Now you can login as Student or let the Students login and the quiz closes immediately - you have to reset the time limit again (Students who spend more than one minute over the time will be grade as zero) and regrade the test Even not really great - but maybe helpful for someone looking forward the Teacher-Button !
          Hide
          Kristbjorg Olsen added a comment -

          Version 2.2.1 work around
          I prolong the quiz time , sign in as the student and submit the quiz. To be on the absolute safe side you can make User overrides and prolong the quiz time only for this particular student before you sign in as him and submit.

          Show
          Kristbjorg Olsen added a comment - Version 2.2.1 work around I prolong the quiz time , sign in as the student and submit the quiz. To be on the absolute safe side you can make User overrides and prolong the quiz time only for this particular student before you sign in as him and submit.
          Hide
          Vickie Frohne added a comment -

          @Joseph Rezeau: Moodle is not just for distance learning. If students fail to "Submit all and finish" on time, I collar the students when I see them in class the next day.

          BTW, "Log in as the student" to submit an open quiz attempt is not a valid work-around if one only has a Teacher role and no access to student passwords. As far as I know, I can't "sign in as the student." Only the student can do that.

          Show
          Vickie Frohne added a comment - @Joseph Rezeau: Moodle is not just for distance learning. If students fail to "Submit all and finish" on time, I collar the students when I see them in class the next day. BTW, "Log in as the student" to submit an open quiz attempt is not a valid work-around if one only has a Teacher role and no access to student passwords. As far as I know, I can't "sign in as the student." Only the student can do that.
          Hide
          Jason Ilicic added a comment -

          A client of ours has asked us about the development of this. Understandable that it's in the backlog - is there any expected timeframe for when this is going to hit Moodle?

          Show
          Jason Ilicic added a comment - A client of ours has asked us about the development of this. Understandable that it's in the backlog - is there any expected timeframe for when this is going to hit Moodle?
          Hide
          Tim Hunt added a comment -

          I am trying to get this done in time for the 2.3 code-freeze.

          Show
          Tim Hunt added a comment - I am trying to get this done in time for the 2.3 code-freeze.
          Hide
          Mahmoud Kassaei added a comment -

          I've browsed throgh the massive chnages and could not find anything unsusual in the code. I have not tested it, but assumed that it has been tested. Nonetheless, I found the following (just being pedantic):

          in attemplib.php the function name get_sumitted_date() (typo?)
          in processattempt.php the variable $finishattempt has been chnaged from int to bool and I was wondering if it is initialised as bool.
          in attemptsreport.php the const ALL_WITH is set to string 'any_with', I was wondering if the const should have been called ANY_WITH

          Show
          Mahmoud Kassaei added a comment - I've browsed throgh the massive chnages and could not find anything unsusual in the code. I have not tested it, but assumed that it has been tested. Nonetheless, I found the following (just being pedantic): in attemplib.php the function name get_sumitted_date() (typo?) in processattempt.php the variable $finishattempt has been chnaged from int to bool and I was wondering if it is initialised as bool. in attemptsreport.php the const ALL_WITH is set to string 'any_with', I was wondering if the const should have been called ANY_WITH
          Hide
          Tim Hunt added a comment -

          Thanks Mahmoud. I have fixed these problems by rebasing the branch, so no one will ever know I made these mistakes

          Show
          Tim Hunt added a comment - Thanks Mahmoud. I have fixed these problems by rebasing the branch, so no one will ever know I made these mistakes
          Hide
          Tim Barker added a comment -

          I think a change is required to mod/quiz/lang/en/quiz.php. The value of: $string['overduehandlingautoabandon'] is currently set to 'That\'s it. Tough luck!'.

          I think that the wording of this should be toned down a little bit "That's it. Tough luck!", should be more descriptive, perhaps "Automatically abandon unfinished attempts."

          Show
          Tim Barker added a comment - I think a change is required to mod/quiz/lang/en/quiz.php. The value of: $string ['overduehandlingautoabandon'] is currently set to 'That\'s it. Tough luck!'. I think that the wording of this should be toned down a little bit "That's it. Tough luck!", should be more descriptive, perhaps "Automatically abandon unfinished attempts."
          Hide
          Vickie Frohne added a comment -

          Instead of "That's it. Tough luck!", how about a reassuring "The Quiz ended. Your attempt was automatically submitted." If shorter prose is required, then "Quiz ended, attempts submitted."

          It's better to let the students figure out the "tough luck" aspect of this event by themselves.

          Show
          Vickie Frohne added a comment - Instead of "That's it. Tough luck!", how about a reassuring "The Quiz ended. Your attempt was automatically submitted." If shorter prose is required, then "Quiz ended, attempts submitted." It's better to let the students figure out the "tough luck" aspect of this event by themselves.
          Hide
          Tim Hunt added a comment -

          Yes. I was planning to change that string. It was just that in the middle of making the code function correctly, I decided not to get hung-up trying to find the perfect string. Actually, I don't really like the word 'abandoned' for this. The best alternative we have so far is 'lapsed'. See http://moodle.org/mod/forum/discuss.php?d=201355#p878951

          But, than you for pointing out the issue. We need to get this polished, so better to have these things reported twice than not at all.

          Show
          Tim Hunt added a comment - Yes. I was planning to change that string. It was just that in the middle of making the code function correctly, I decided not to get hung-up trying to find the perfect string. Actually, I don't really like the word 'abandoned' for this. The best alternative we have so far is 'lapsed'. See http://moodle.org/mod/forum/discuss.php?d=201355#p878951 But, than you for pointing out the issue. We need to get this polished, so better to have these things reported twice than not at all.
          Hide
          Tim Hunt added a comment -

          OK, Abandoned -> Never submitted, and the infomral option text has been changed.

          Show
          Tim Hunt added a comment - OK, Abandoned -> Never submitted, and the infomral option text has been changed.
          Hide
          Tim Hunt added a comment -

          Right. I think this is it. Submitting for integration now.

          Show
          Tim Hunt added a comment - Right. I think this is it. Submitting for integration now.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

          TIA and ciao

          Show
          Eloy Lafuente (stronk7) added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
          Hide
          Dan Poltawski added a comment -

          Hi Tim,

          Great work! I've integrated this now! I did a commit on top of your changes to fix some trailing whitespace.

          I noticed a few things that you commented about that might be worth creating new issues for whilst they are 'fresh' (if you care enough about them):

          1. A better check for a faked $USER in mod/quiz/attemptlib.php
          2. The mod_form TODO Formslib does OR logic on disableif
          3. The need for a way to display an error and get original stacktace

          We need to ensure that get_list_of_overdue_attempts is tested in al dbs

          Show
          Dan Poltawski added a comment - Hi Tim, Great work! I've integrated this now! I did a commit on top of your changes to fix some trailing whitespace. I noticed a few things that you commented about that might be worth creating new issues for whilst they are 'fresh' (if you care enough about them): A better check for a faked $USER in mod/quiz/attemptlib.php The mod_form TODO Formslib does OR logic on disableif The need for a way to display an error and get original stacktace We need to ensure that get_list_of_overdue_attempts is tested in al dbs
          Hide
          Tim Hunt added a comment -

          Thanks for fixing the trailing white-space. I can't believe I let that slip through.

          3. is an ancient issue, not fresh. I can't remember if I filed a but for it at the time. There are over 200 open bugs if you search for Exception, so I am not going file a new bug now. One problem is that PHP only introduced $previous to the Exception constructor in 5.3, so it was not built into the Moodle exception API. And API change now will be painful, but it would be nice if someone from HQ could look into it. (Java has had this for ages, it is really useful to be able to throw a new exception, while keeping the details of the original cause of the problem.)

          2. I think is also a long-stand MDL-32682.

          1. is probably covered by MDL-19774 and MDL-25289 - which might be duplicates of each other.

          Show
          Tim Hunt added a comment - Thanks for fixing the trailing white-space. I can't believe I let that slip through. 3. is an ancient issue, not fresh. I can't remember if I filed a but for it at the time. There are over 200 open bugs if you search for Exception, so I am not going file a new bug now. One problem is that PHP only introduced $previous to the Exception constructor in 5.3, so it was not built into the Moodle exception API. And API change now will be painful, but it would be nice if someone from HQ could look into it. (Java has had this for ages, it is really useful to be able to throw a new exception, while keeping the details of the original cause of the problem.) 2. I think is also a long-stand MDL-32682 . 1. is probably covered by MDL-19774 and MDL-25289 - which might be duplicates of each other.
          Hide
          Tim Hunt added a comment -

          I have created MDL-32686 as a meta-bug for all the problems found during testing of this. Please add new sub-tasks there, if necessary.

          Show
          Tim Hunt added a comment - I have created MDL-32686 as a meta-bug for all the problems found during testing of this. Please add new sub-tasks there, if necessary.
          Hide
          Tim Hunt added a comment -

          Dan, there are some lang string improvements in MDL-32687 which you could cheekily integrate this week too.

          Show
          Tim Hunt added a comment - Dan, there are some lang string improvements in MDL-32687 which you could cheekily integrate this week too.
          Hide
          Andrew Davis added a comment -

          Getting the following on my messaging preferences using the code currently in integration. Is this related?

          Invalid get_string() identifier: 'messageprovider:attempt_overdue' or component 'mod_quiz'. Perhaps you are missing $string['messageprovider:attempt_overdue'] = ''; in mod/quiz/lang/en/quiz.php?

          line 6501 of /lib/moodlelib.php: call to debugging()
          line 7125 of /lib/moodlelib.php: call to core_string_manager->get_string()
          line 245 of /message/renderer.php: call to get_string()
          line 197 of /message/edit.php: call to core_message_renderer->manage_messagingoptions()

          Show
          Andrew Davis added a comment - Getting the following on my messaging preferences using the code currently in integration. Is this related? Invalid get_string() identifier: 'messageprovider:attempt_overdue' or component 'mod_quiz'. Perhaps you are missing $string ['messageprovider:attempt_overdue'] = ''; in mod/quiz/lang/en/quiz.php? line 6501 of /lib/moodlelib.php: call to debugging() line 7125 of /lib/moodlelib.php: call to core_string_manager->get_string() line 245 of /message/renderer.php: call to get_string() line 197 of /message/edit.php: call to core_message_renderer->manage_messagingoptions()
          Hide
          Tim Hunt added a comment -

          Sorry. I created MDL-32721 for this.

          Show
          Tim Hunt added a comment - Sorry. I created MDL-32721 for this.
          Hide
          Tim Hunt added a comment -

          And, there is now a patch on MDL-32721 adding the missing language string. Integrators, you might want to add that to this week.

          Show
          Tim Hunt added a comment - And, there is now a patch on MDL-32721 adding the missing language string. Integrators, you might want to add that to this week.
          Hide
          Andrew Davis added a comment -

          Im testing this now. Generally its going well. I am however getting an error every time I delete an attempt.

          When deleting an attempt by going to /mod/quiz/report.php?id=24&mode=overview ticking next to a student then clicking "Delete selected attempts"

          Notice: Undefined variable: cm in /home/andrew/Desktop/code/moodle/int/master/mod/quiz/report/attemptsreport.php on line 289 Notice: Trying to get property of non-object in /home/andrew/Desktop/code/moodle/int/master/mod/quiz/report/attemptsreport.php on line 319 Notice: Trying to get property of non-object in /home/andrew/Desktop/code/moodle/int/master/mod/quiz/report/attemptsreport.php on line 320 Notice: Undefined variable: options in /home/andrew/Desktop/code/moodle/int/master/mod/quiz/report/attemptsreport.php on line 290 Fatal error: Call to a member function get_url() on a non-object in /home/andrew/Desktop/code/moodle/int/master/mod/quiz/report/attemptsreport.php on line 290

          Is this likely to be related to this issue or is it separate?

          Show
          Andrew Davis added a comment - Im testing this now. Generally its going well. I am however getting an error every time I delete an attempt. When deleting an attempt by going to /mod/quiz/report.php?id=24&mode=overview ticking next to a student then clicking "Delete selected attempts" Notice: Undefined variable: cm in /home/andrew/Desktop/code/moodle/int/master/mod/quiz/report/attemptsreport.php on line 289 Notice: Trying to get property of non-object in /home/andrew/Desktop/code/moodle/int/master/mod/quiz/report/attemptsreport.php on line 319 Notice: Trying to get property of non-object in /home/andrew/Desktop/code/moodle/int/master/mod/quiz/report/attemptsreport.php on line 320 Notice: Undefined variable: options in /home/andrew/Desktop/code/moodle/int/master/mod/quiz/report/attemptsreport.php on line 290 Fatal error: Call to a member function get_url() on a non-object in /home/andrew/Desktop/code/moodle/int/master/mod/quiz/report/attemptsreport.php on line 290 Is this likely to be related to this issue or is it separate?
          Hide
          Andrew Davis added a comment - - edited

          From MDLQA-new3

          3. As student, start a quiz attempt and answer some questions. Then leave the browser tab open until time expires.
          4. You should be automatically redirected to the review page, and the quiz should move into the overdue state. The timer should count down telling you how long you have in which to submit.

          I wasnt redirected. Firefox 12.0 on Ubuntu 11.04. Instead the following text was displayed

          "This attempt is now overdue. It should already have been submitted. If you would like this quiz to be graded, you must submit it by Thursday, 3 May 2012, 12:25 PM. If you do not submit it by then, no marks from this attempt will be counted."

          The "return to attempt" button does nothing (actually I think its sending me back to the same page). "submit all and finish" took me to a screen where I could submit the attempt. Not sure if this behaviour is really wrong. Maybe just the QA test wants updating.

          UPDATE: I wasnt redirected because I was already looking at the review screen. I incorrectly believed that the screen after that which lists all of your responses was the review screen.

          Show
          Andrew Davis added a comment - - edited From MDLQA-new3 3. As student, start a quiz attempt and answer some questions. Then leave the browser tab open until time expires. 4. You should be automatically redirected to the review page, and the quiz should move into the overdue state. The timer should count down telling you how long you have in which to submit. I wasnt redirected. Firefox 12.0 on Ubuntu 11.04. Instead the following text was displayed "This attempt is now overdue. It should already have been submitted. If you would like this quiz to be graded, you must submit it by Thursday, 3 May 2012, 12:25 PM. If you do not submit it by then, no marks from this attempt will be counted." The "return to attempt" button does nothing (actually I think its sending me back to the same page). "submit all and finish" took me to a screen where I could submit the attempt. Not sure if this behaviour is really wrong. Maybe just the QA test wants updating. UPDATE: I wasnt redirected because I was already looking at the review screen. I incorrectly believed that the screen after that which lists all of your responses was the review screen.
          Hide
          Andrew Davis added a comment -

          I'm getting a fatal error in cron. Step #12 of MDLQA-new3

          Processing module function quiz_cron ...!!! Error reading from database !!!
          !! Unknown column 'quo.timeclose' in 'having clause'

          SELECT quiza.id,
          quiza.quiz,
          quiza.userid,
          quiza.attempt,
          quiza.uniqueid,
          quiza.layout,
          quiza.currentpage,
          quiza.preview,
          quiza.state,
          quiza.timestart,
          quiza.timefinish,
          quiza.timemodified,
          quiza.sumgrades,
          COALESCE(quo.timeclose, MAX(qgo.timeclose), quiz.timeclose) AS usertimeclose,
          COALESCE(quo.timelimit, MAX(qgo.timelimit), quiz.timelimit) AS usertimelimit

          FROM mdl_quiz_attempts quiza
          JOIN mdl_quiz quiz ON quiz.id = quiza.quiz
          LEFT JOIN mdl_quiz_overrides quo ON quo.quiz = quiz.id AND quo.userid = quiza.userid
          LEFT JOIN mdl_quiz_overrides qgo ON qgo.quiz = quiz.id
          LEFT JOIN mdl_groups_members gm ON gm.userid = quiza.userid AND gm.groupid = qgo.groupid

          WHERE quiza.state IN ('inprogress', 'overdue')
          AND quiza.timemodified >= ?
          AND quiza.timemodified < ?

          GROUP BY quiza.id,
          quiza.quiz,
          quiza.userid,
          quiza.attempt,
          quiza.uniqueid,
          quiza.layout,
          quiza.currentpage,
          quiza.preview,
          quiza.state,
          quiza.timestart,
          quiza.timefinish,
          quiza.timemodified,
          quiza.sumgrades,
          quiz.course,
          quiz.timeclose,
          quiz.timelimit,
          quiz.graceperiod,
          quo.timeclose,
          quo.timelimit

          HAVING (quiza.state = 'inprogress' AND (
          ? > COALESCE(quo.timeclose, MAX(qgo.timeclose), quiz.timeclose)
          OR ? > timestart + COALESCE(quo.timelimit, MAX(qgo.timelimit), quiz.timelimit)))
          OR (quiza.state = 'overdue' AND (
          ? > graceperiod + COALESCE(quo.timeclose, MAX(qgo.timeclose), quiz.timeclose)
          OR ? > timestart + graceperiod + COALESCE(quo.timelimit, MAX(qgo.timelimit), quiz.timelimit)))

          ORDER BY quiz.course, quiza.quiz
          [array (
          0 => 0,
          1 => 1336023276,
          2 => 1336023276,
          3 => 1336023276,
          4 => 1336023276,
          5 => 1336023276,
          )] !!
          !! Stack trace: * line 413 of /lib/dml/moodle_database.php: dml_read_exception thrown

          • line 829 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
          • line 147 of /mod/quiz/cronlib.php: call to mysqli_native_moodle_database->get_recordset_sql()
          • line 50 of /mod/quiz/cronlib.php: call to mod_quiz_overdue_attempt_updater->get_list_of_overdue_attempts()
          • line 464 of /mod/quiz/lib.php: call to mod_quiz_overdue_attempt_updater->update_overdue_attempts()
          • line 260 of /lib/cronlib.php: call to quiz_cron()
          • line 88 of /admin/cron.php: call to cron_run()
            !!
          Show
          Andrew Davis added a comment - I'm getting a fatal error in cron. Step #12 of MDLQA-new3 Processing module function quiz_cron ...!!! Error reading from database !!! !! Unknown column 'quo.timeclose' in 'having clause' SELECT quiza.id, quiza.quiz, quiza.userid, quiza.attempt, quiza.uniqueid, quiza.layout, quiza.currentpage, quiza.preview, quiza.state, quiza.timestart, quiza.timefinish, quiza.timemodified, quiza.sumgrades, COALESCE(quo.timeclose, MAX(qgo.timeclose), quiz.timeclose) AS usertimeclose, COALESCE(quo.timelimit, MAX(qgo.timelimit), quiz.timelimit) AS usertimelimit FROM mdl_quiz_attempts quiza JOIN mdl_quiz quiz ON quiz.id = quiza.quiz LEFT JOIN mdl_quiz_overrides quo ON quo.quiz = quiz.id AND quo.userid = quiza.userid LEFT JOIN mdl_quiz_overrides qgo ON qgo.quiz = quiz.id LEFT JOIN mdl_groups_members gm ON gm.userid = quiza.userid AND gm.groupid = qgo.groupid WHERE quiza.state IN ('inprogress', 'overdue') AND quiza.timemodified >= ? AND quiza.timemodified < ? GROUP BY quiza.id, quiza.quiz, quiza.userid, quiza.attempt, quiza.uniqueid, quiza.layout, quiza.currentpage, quiza.preview, quiza.state, quiza.timestart, quiza.timefinish, quiza.timemodified, quiza.sumgrades, quiz.course, quiz.timeclose, quiz.timelimit, quiz.graceperiod, quo.timeclose, quo.timelimit HAVING (quiza.state = 'inprogress' AND ( ? > COALESCE(quo.timeclose, MAX(qgo.timeclose), quiz.timeclose) OR ? > timestart + COALESCE(quo.timelimit, MAX(qgo.timelimit), quiz.timelimit))) OR (quiza.state = 'overdue' AND ( ? > graceperiod + COALESCE(quo.timeclose, MAX(qgo.timeclose), quiz.timeclose) OR ? > timestart + graceperiod + COALESCE(quo.timelimit, MAX(qgo.timelimit), quiz.timelimit))) ORDER BY quiz.course, quiza.quiz [array ( 0 => 0, 1 => 1336023276, 2 => 1336023276, 3 => 1336023276, 4 => 1336023276, 5 => 1336023276, )] !! !! Stack trace: * line 413 of /lib/dml/moodle_database.php: dml_read_exception thrown line 829 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end() line 147 of /mod/quiz/cronlib.php: call to mysqli_native_moodle_database->get_recordset_sql() line 50 of /mod/quiz/cronlib.php: call to mod_quiz_overdue_attempt_updater->get_list_of_overdue_attempts() line 464 of /mod/quiz/lib.php: call to mod_quiz_overdue_attempt_updater->update_overdue_attempts() line 260 of /lib/cronlib.php: call to quiz_cron() line 88 of /admin/cron.php: call to cron_run() !!
          Hide
          Andrew Davis added a comment -

          MDLQA-new 4

          "4. You should be automatically redirected to the review page, and the quiz should move into the overdue state. The timer should count down telling you how long you have in which to submit."

          There is no count down displayed. There is however the following text.

          "This attempt is now overdue. It should already have been submitted. If you would like this quiz to be graded, you must submit it by Thursday, 3 May 2012, 1:16 PM. If you do not submit it by then, no marks from this attempt will be counted."

          Show
          Andrew Davis added a comment - MDLQA-new 4 "4. You should be automatically redirected to the review page, and the quiz should move into the overdue state. The timer should count down telling you how long you have in which to submit." There is no count down displayed. There is however the following text. "This attempt is now overdue. It should already have been submitted. If you would like this quiz to be graded, you must submit it by Thursday, 3 May 2012, 1:16 PM. If you do not submit it by then, no marks from this attempt will be counted."
          Hide
          Andrew Davis added a comment -

          Ive done as much of the testing as I can. Tim doesn't seem to be online right now so I'm marking this as failed testing. The cron error is the big one. There's multiple bits of the testing that could not be completed because of that.

          Show
          Andrew Davis added a comment - Ive done as much of the testing as I can. Tim doesn't seem to be online right now so I'm marking this as failed testing. The cron error is the big one. There's multiple bits of the testing that could not be completed because of that.
          Hide
          Tim Hunt added a comment -

          Thanks for taking on this mammoth testing task Andrew. I have created some new subtaks of MDL-32686 for the issues, and will try to get them all fixed today.

          Sorry for not making the difference between the summary page and review page clear in the instructions, but you worked it out in the end.

          The message "This attempt is now overdue. ..." rather than the count-down timer is correct. The testing instructions need to be updated.

          Show
          Tim Hunt added a comment - Thanks for taking on this mammoth testing task Andrew. I have created some new subtaks of MDL-32686 for the issues, and will try to get them all fixed today. Sorry for not making the difference between the summary page and review page clear in the instructions, but you worked it out in the end. The message "This attempt is now overdue. ..." rather than the count-down timer is correct. The testing instructions need to be updated.
          Hide
          Tim Hunt added a comment -

          MDL-32738, MDL-32739 and MDL-32740 now all have fixes available. (And Dan P has already integrated the fix for MDL-32739.)

          Show
          Tim Hunt added a comment - MDL-32738 , MDL-32739 and MDL-32740 now all have fixes available. (And Dan P has already integrated the fix for MDL-32739 .)
          Hide
          Dan Poltawski added a comment -

          Restarting testing on this as the identified issues have been fixed.

          Thanks testers - its really worth it!

          Show
          Dan Poltawski added a comment - Restarting testing on this as the identified issues have been fixed. Thanks testers - its really worth it!
          Hide
          Tim Hunt added a comment -

          And another one: MDL-32757

          Show
          Tim Hunt added a comment - And another one: MDL-32757
          Hide
          Andrew Davis added a comment -

          retesting.

          Show
          Andrew Davis added a comment - retesting.
          Hide
          Andrew Davis added a comment -

          I encountered MDL-32338 while testing. To allow me to continue I commented out line 387 of lib/cronlib.php

          $updateschecker->cron();
          Show
          Andrew Davis added a comment - I encountered MDL-32338 while testing. To allow me to continue I commented out line 387 of lib/cronlib.php $updateschecker->cron();
          Hide
          Andrew Davis added a comment - - edited

          I'm having trouble with this section of MDLQA-new1

          6. As another student, start a quiz attempt and answer some questions. Then log out of Moodle.

          7. Wait until time has expired, and then a further hour has passed (so that the quiz cron, which runs once per hour, has had a chance to do its thing).

          8. Log in as teacher, and you should be able to see that the attempt has been updated to be finished.

          I didn't wait an hour. Instead I ran cron a few minutes after the time had expired. Hopefully thats not the cause of this not working :\ The student's attempt is still listed as in progress. The only mentions of quiz I can see in cron's output is the following

          Processing module function quiz_cron ...Starting quiz reports
          Finished quiz reports
          ... used 3 dbqueries
          ... used 0.067873001098633 seconds
          done.

          MDLQA-new2 has the same issue. Attempts not marked as finished by the student dont seem to be getting shifted out of "in progress" by cron. If the student logs in and goes to the quiz it happens but not via cron.

          Show
          Andrew Davis added a comment - - edited I'm having trouble with this section of MDLQA-new1 6. As another student, start a quiz attempt and answer some questions. Then log out of Moodle. 7. Wait until time has expired, and then a further hour has passed (so that the quiz cron, which runs once per hour, has had a chance to do its thing). 8. Log in as teacher, and you should be able to see that the attempt has been updated to be finished. I didn't wait an hour. Instead I ran cron a few minutes after the time had expired. Hopefully thats not the cause of this not working :\ The student's attempt is still listed as in progress. The only mentions of quiz I can see in cron's output is the following Processing module function quiz_cron ...Starting quiz reports Finished quiz reports ... used 3 dbqueries ... used 0.067873001098633 seconds done. MDLQA-new2 has the same issue. Attempts not marked as finished by the student dont seem to be getting shifted out of "in progress" by cron. If the student logs in and goes to the quiz it happens but not via cron.
          Hide
          Andrew Davis added a comment - - edited

          Ok, I asked Dan and that 1 hour wait is significant. The check for overdue quiz attempts has a hard coded 1 hour interval.

          I forced it to run on command by doing the following. It is now working (meaning, working within the context of my testing. It was always working)

          select * from mdl_config_plugins where plugin = "quiz" and name = "overduelastrun"
          update mdl_config_plugins set value = 1 where plugin = "quiz" and name = "overduelastrun"
          
          Show
          Andrew Davis added a comment - - edited Ok, I asked Dan and that 1 hour wait is significant. The check for overdue quiz attempts has a hard coded 1 hour interval. I forced it to run on command by doing the following. It is now working (meaning, working within the context of my testing. It was always working) select * from mdl_config_plugins where plugin = "quiz" and name = "overduelastrun" update mdl_config_plugins set value = 1 where plugin = "quiz" and name = "overduelastrun"
          Hide
          Andrew Davis added a comment -

          Run into a slight difference between the code and the testing instructions.

          "10. Do nothing. After the end of the grace period, the attempt should move to the Never submitted state (as in MDLQA-new2)."

          I have a time set for "Close the quiz". No time limit. I have "when the time expires" set to "there is a grace period..." The grace period is 2 minutes.

          Student logs in, answers some questions, logs out. Teacher sees the attempt as in progress.

          Student waits for the "close the quiz" time to pass. Logs back in during the grace period. Is able to continue. The student is taken to a summary screen that says this:

          "This attempt is now overdue. It should already have been submitted. If you would like this quiz to be graded, you must submit it by Friday, 4 May 2012, 11:29 AM. If you do not submit it by then, no marks from this attempt will be counted."

          If the student just sits and waits for the grace period to elapse the page doesn't redirect. If, after the grace period has passed, the student clicks "submit all and finish" the attempts status changes to finished and they have a grade in the gradebook.

          Show
          Andrew Davis added a comment - Run into a slight difference between the code and the testing instructions. "10. Do nothing. After the end of the grace period, the attempt should move to the Never submitted state (as in MDLQA-new2)." I have a time set for "Close the quiz". No time limit. I have "when the time expires" set to "there is a grace period..." The grace period is 2 minutes. Student logs in, answers some questions, logs out. Teacher sees the attempt as in progress. Student waits for the "close the quiz" time to pass. Logs back in during the grace period. Is able to continue. The student is taken to a summary screen that says this: "This attempt is now overdue. It should already have been submitted. If you would like this quiz to be graded, you must submit it by Friday, 4 May 2012, 11:29 AM. If you do not submit it by then, no marks from this attempt will be counted." If the student just sits and waits for the grace period to elapse the page doesn't redirect. If, after the grace period has passed, the student clicks "submit all and finish" the attempts status changes to finished and they have a grade in the gradebook.
          Hide
          Tim Hunt added a comment -

          If I am reading this correctly, then everything is OK up to your last comment (about step 10 in test new4).

          And everything there is OK until the last paragraph. I think the page is not meant to redirect at the end of the grade period. So, to trigger the transition to abandoned (or Never submitted, as it is now).

          Right, there is a bug: MDL-32686. I think this is quite an obscure edge case, so we should try to wrap this issue up this week, and I will submit a fix for MDL-32686 for integration next week.

          Show
          Tim Hunt added a comment - If I am reading this correctly, then everything is OK up to your last comment (about step 10 in test new4). And everything there is OK until the last paragraph. I think the page is not meant to redirect at the end of the grade period. So, to trigger the transition to abandoned (or Never submitted, as it is now). Right, there is a bug: MDL-32686 . I think this is quite an obscure edge case, so we should try to wrap this issue up this week, and I will submit a fix for MDL-32686 for integration next week.
          Hide
          Dan Poltawski added a comment -

          OK, I agree, this all sounds under control so passing this issue now.

          Thanks Andrew for all your work on the test and Tim for the feature!

          Show
          Dan Poltawski added a comment - OK, I agree, this all sounds under control so passing this issue now. Thanks Andrew for all your work on the test and Tim for the feature!
          Hide
          Andrew Davis added a comment -

          You read my stream of consciousness correctly Tim

          Show
          Andrew Davis added a comment - You read my stream of consciousness correctly Tim
          Hide
          Eloy Lafuente (stronk7) added a comment -
          UPDATE tracker_issues
             SET status = 'Closed',
                comment = 'Thanks!'
          WHEN participants = 'Did a gorgeous work'
          

          This landed upstream some hours ago (some - me - developer fell slept in the sofa yesterday before spamming this).

          Show
          Eloy Lafuente (stronk7) added a comment - UPDATE tracker_issues SET status = 'Closed', comment = 'Thanks!' WHEN participants = 'Did a gorgeous work' This landed upstream some hours ago (some - me - developer fell slept in the sofa yesterday before spamming this).
          Hide
          Tim Barker added a comment -

          What's the difference between the "Move" button and the "Reorder questions" button on the Order and paging tab?

          Show
          Tim Barker added a comment - What's the difference between the "Move" button and the "Reorder questions" button on the Order and paging tab?
          Hide
          Tim Barker added a comment -

          I've added tests to 2.3 based upon Tim's advice. Whilst test coverage is not exhaustive it is adequate for 2.3 testing. I do need and answer on my previous comment about the Move and re-order questions buttons though otherwise I will not be able to add coverage to 2.3 for these.

          Show
          Tim Barker added a comment - I've added tests to 2.3 based upon Tim's advice. Whilst test coverage is not exhaustive it is adequate for 2.3 testing. I do need and answer on my previous comment about the Move and re-order questions buttons though otherwise I will not be able to add coverage to 2.3 for these.
          Hide
          Dan Poltawski added a comment -

          I'm sure Tim will get back to you today/tomorrow, it was a public holiday in the UK yesterday.

          (p.s. this is sure a lot more exhaustive tests than most other areas of Moodle)

          Show
          Dan Poltawski added a comment - I'm sure Tim will get back to you today/tomorrow, it was a public holiday in the UK yesterday. (p.s. this is sure a lot more exhaustive tests than most other areas of Moodle)
          Hide
          Tim Hunt added a comment -

          Sorry I forgot to answer that question.

          1. The Move button should be clear. There is the extra text Move selected questions to page: [___]

          2. Reorder questions is presumably the mysterious one. It related to the numbered boxes that contain numbers like 10, 30, 50, .... The point is that you can type new numbers into these boxes, and then click the Reorder questions button, to sort all the questions into a completely new order with one action.

          Note that the page breaks implicitly have numbers that are not shown (in the example above the page breaks would be 20, 40, ...). So, you could change the numbers to 15, 2, 1 and click the button, and it would turn the old older q1, break, q2, break, q3, ... into q3, q2, break, q1, break, .... For experienced users, this is much quicker than clicking the up and down icons a lot.

          Show
          Tim Hunt added a comment - Sorry I forgot to answer that question. 1. The Move button should be clear. There is the extra text Move selected questions to page: [___] 2. Reorder questions is presumably the mysterious one. It related to the numbered boxes that contain numbers like 10, 30, 50, .... The point is that you can type new numbers into these boxes, and then click the Reorder questions button, to sort all the questions into a completely new order with one action. Note that the page breaks implicitly have numbers that are not shown (in the example above the page breaks would be 20, 40, ...). So, you could change the numbers to 15, 2, 1 and click the button, and it would turn the old older q1, break, q2, break, q3, ... into q3, q2, break, q1, break, .... For experienced users, this is much quicker than clicking the up and down icons a lot.
          Hide
          Mary Cooch added a comment -

          The new options for when time expires are now documented in 2.3 docs http://docs.moodle.org/23/en/Quiz_settings#Timing

          Show
          Mary Cooch added a comment - The new options for when time expires are now documented in 2.3 docs http://docs.moodle.org/23/en/Quiz_settings#Timing

            People

              Dates

              • Created:
                Updated:
                Resolved: