Timed quiz not closing in time

Timed quiz not closing in time

by Maheswaran S -
Number of replies: 9

Dear All,

Moodle version 3.4.1+


I created a timed quiz which is supposed to be closed in 10 Minutes and open attempts are to be submitted automatically.

Please refer quiz-1.jpg screenshot enclosed for my settings.


But in many cases, i could see that the quiz takes longer than the specified time of 10 minutes to close.

Please refer quiz-2.jpg screenshot enclosed for the quiz statistics page showing quiz close timings.


Is this a bug or am i doing something wrong ?

Please help.


Thanks and Regards


Attachment quiz-1.jpg
Attachment quiz-2.jpg
Average of ratings: -
In reply to Maheswaran S

Re: Timed quiz not closing in time

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

MDL-54907 should explain. (I thought this was in the Quiz FAQ, but I can't see it there.)

In reply to Tim Hunt

Re: Timed quiz not closing in time

by Maheswaran S -

Hello Tim Hunt,


Thanks for the reply.


I am slightly disheartened as i thought it would be a simple thing to achieve in moodle.

As soon as the quiz attempt is started, the timer kicks in. The timer runs in the back-end. No matter whether the student is logged-in or logged out, as soon as the timer stops, the quiz attempt should automatically get submitted. This is the expected behavior.

Please correct me if i am wrong.


We plan to conduct spell-bee type of quiz contests where time taken to complete the quiz (as monitored and reported in the moodle backend) is of paramount importance along with the quiz scores.


To quote you from 

https://moodle.org/mod/forum/discuss.php?d=334642

"mod_quiz has not been converted to use the new scheduled task system. It still users old-style Moodle cron"

Is this still the fact with moodle 3.4.1+ ?


If yes, does running moodle cron as below will ensure the quiz will be closed in not more than 1 minute from its expected close time ? (atleast)

/usr/bin/php  /path-to-moodle/admin/cli/cron.php


Is there any other better way to achieve/monitor quiz close time with higher accuracy.

(like adding this to the scheduled tasks and forcing it to run every 10 seconds...etc..)


Kindly help.


Thanks and Regards

In reply to Maheswaran S

Re: Timed quiz not closing in time

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

If the student is logged in and attempting the quiz, then it will be submitted at exactly the deadline. There is not way that the student can get extra time to work on the quiz.

It is just that, if they have logged out and gone away, the background house-keeping task that finds overdue quiz attempts and submits them may not run immediately, 

And there are other cases, like:

  1. Student starts quiz attempt
  2. Student logs out and goes away
  3. Time limit expires, but quiz housekeeping task has not run yet.
  4. Student logs in again and goes to the quiz.

Does this let let the students get extra time? No, because actually as soon as the student visits the quiz, we check for the overdue attempt, and the attempt is closed.

We have thought about all the possible combinations of actions, and I am sure there is no way students can get more time than they deserve.


The only problem is that, the Moodle code is too simple-minded about storing the time when the quiz attempt was submitted. It stores the time when whichever bit of code ran to submit the quiz attempt, which is not really very interesting. In the case when the quiz attempt is closed some time later by the house-keepking task, it should set the submit time to the last time at which the student could have done any more work on their attempt.

That would be a more accurate representation of what happened, and avoid the confusion that you have just gone through.

However, this is just about avoiding data that confuses people. There is no way that students can get more than the permitted time to attempt the quiz.

Average of ratings: Useful (1)
In reply to Tim Hunt

Re: Timed quiz not closing in time

by Maheswaran S -

Hello Tim Hunt,


Thanks for the reply.

I totally agree with you that students never get more time to answer the quiz than the allotted time.

But the generated reports on quiz completion time, when viewed by the Management (and by the students in their dashboard) becomes totally misleading...

There are reports which says the Quiz Completion time of many students are more than 20 hours (for a 10 minutes quiz) which is really annoying.


I run the given below cron every minute.

/usr/bin/php  /path-to-moodle/admin/cli/cron.php


But still why moodle's housekeeping job of closing the quiz does not happen or is being checked every minute ?


Is there any other better way to achieve/monitor quiz close time with higher accuracy.

(like adding this to the scheduled tasks and forcing it to run every 10 seconds...etc..)


Kindly help.

Thanks and Regards

In reply to Maheswaran S

Re: Timed quiz not closing in time

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

The Quiz cron should run much more frequently than that. I'm puzzled.

In reply to Tim Hunt

Re: Timed quiz not closing in time

by Maheswaran S -

Hello Tim Hunt,


May i know whether there has been any update on this issue please ?


What we expect to achieve is a simple logic as given below;


If student_manually_submitted_quiz

{

time_taken_to_complete_quiz = quiz_submitted_time - quiz_start_time;

}


Else

{

time_taken_to_complete_quiz = quiz_max_time;

}



or even a simpler approach would be like below


If time_taken_to_complete_quiz >= quiz_max_time

{

time_taken_to_complete_quiz = quiz_max_time;

}


Please let me know your thoughts on the above implementation.

Also, kindly let me know whether this issue is given focus on upcoming moodle version 3.5


Thanks and Regards,

S.Maheswaran


In reply to Maheswaran S

Re: Timed quiz not closing in time

by Maheswaran S -


If student_manually_submitted_quiz

above "IF" statement may be modified as below:

If quiz_started & student_manually_submitted_quiz


or even a simpler approach would be like below


If time_taken_to_complete_quiz > quiz_max_time

{

time_taken_to_complete_quiz = quiz_max_time;

}


In reply to Maheswaran S

Re: Timed quiz not closing in time

by Daniel Thies -
Picture of Core developers Picture of Plugin developers Picture of Testers

I would look at the scheduled tasks in site administration. Check the entry for the legacy cron jobs and look at the columns for last run, next run, and fail delay. This task runs the quiz cron as well as cron jobs of some other plugins. An error in another plugin could put them all on hold