Time delay between attempts

Time delay between attempts

by Sam Wynens -
Number of replies: 6

Is there any way to reset this count?

I would like the students to be able to take the test, if they fail, they must wait 30 mins before attempting again. If they fail again, they have to wait 24 hours.

After the 24 hour wait, it's making them wait another 24 hours until they may take it again. Is there anyway to allow them to take the test 2 times per day with that wait period?

Sam

Average of ratings: -
In reply to Sam Wynens

Re: Time delay between attempts

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 only way to do something this sepcific is to edit the code. It's probably not that difficult. Just look in mod/quiz/view.php.
In reply to Tim Hunt

Re: Time delay between attempts

by Sam Wynens -

FOUND A SOLUTION!!!

Just thought someone out there may want to incorporate this into their own quizzes.

What I have done is allowed the students to take the quiz twice in a 24 hour period.

  • 1st attempt = failed
  • wait 30 mins
  • 2nd attempt = failed
  • wait 24 hours
  • 3 attempt = failed
  • wait 30 mins
  • 4 attempt = failed
  • wait 24 hours
  • and so on and so forth.

 

This is a really simple modification to make. You have to edit 2 files (attempt.php and view.php) under the mod/quiz folder.

In attempt.php, around line 177 find this line:

  • if ($numattempts == 1 && $quiz->delay1) {

and change it to:

  • if ($numattempts % 2 == 1 && $quiz->delay1) {

around line 181 find this line:

  • } else if($numattempts > 1 && $quiz->delay2) {

and change it to:

  • } else if($numattempts % 2 == 0 && $quiz->delay2) {

 

In file view.php, around line 321 find this line:

  • if($numattempts == 1 && $quiz->delay1) {

and change it to:

  • if($numattempts % 2 == 1 && $quiz->delay1) {

around line 328 find this line:

  • } else if($numattempts > 1 && $quiz->delay2) {

and change it to:

  • } else if($numattempts % 2 == 0 && $quiz->delay2) {

 

I hope that someone finds this useful.

 

Sam

In reply to Sam Wynens

Re: Time delay between attempts

by Philip Norton -
The only problem with this is that if a student makes 1 attempt on a day instead of the recommended 2. On the following attempt they will have to wait a further 24 hours before they can take the test again. If this attempt is on the following day, your method will not allow them to take the test twice on that day.
In reply to Philip Norton

Re: Time delay between attempts

by Sam Wynens -

Hmmm, I see the delema.

Time for some more thinking...

Sam

In reply to Sam Wynens

Re: Time delay between attempts

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Sam > if they fail, they must wait 30 mins before attempting again. If they fail again, they have to wait 24 hours.

I'm puzzled at the rationale behind these 2 delay periods. I expect it is some attempt at forcing the students to "revise" their "lesson" before taking a new attempt at the quiz, but will it be effective?

Joseph
In reply to Joseph Rézeau

Re: Time delay between attempts

by Sam Wynens -

The teachers I'm creating this for want the students to be able to attempt the quizzes twice per day.

Why? I don't know... It's what they want...

Sam