Features & Development

New Assignment type: Use timer on questions

New Assignment type: Use timer on questions

by Edwin Flórez -
Number of replies: 3
Hello,

I am guiding someone in a mathematics education research, she likes WeBWorK and want use it. The topic is about number sense and we need prepare a the test against the clock. For that we need in someway has a fixed time for each question (say 30 sec), if the time is over it should go to next question taking any entered answer without the possibility to got back later.

Do you think I can get this feature relatively easy and where should I start?

Thanks
In reply to Edwin Flórez

Re: New Assignment type: Use timer on questions

by Danny Glin -
This would not be simple to implement with the current structure of WeBWorK. The gateway quiz mode does have a timer, but it does not automatically submit answers when time expires, and the timer is for the entire quiz and not individual questions.

The automatic submission of answers when time expires has been discussed for many years, but hasn't been implemented for a couple of reasons:
  1. The student's answers are not stored on the server until they are submitted, so there is no way for the server to reliably check answers that have not been submitted.
  2. The timer is client-side (i.e. within the browser), so it is possible that the timer may be out of sync with the server, and thus submitting when the timer hits zero may actually be too early or too late.
If you want to look at adding this functionality, you should start by looking at the code for Gateway Quizzes to see how easy it would be to modify. Gateway Quizzes already offer the option to not give students access to completed quizzes, but this is controlled at the quiz level and not the question level.
In reply to Danny Glin

Re: New Assignment type: Use timer on questions

by Edwin Flórez -
Umm, interesting and nice info to start.

Definitively, I will use the Gateway Assignment type because it will give me the option to show problem by problem and use the timer option. Now, if I set "Test Time Limit" to (m + n*t/60) min for a test of n problems, each problem should be answer it in m/n min and use a t sec for transition between questions.

That's perfect for what we want. Now, knowing that the timer is client-side, do you think is possible to:

* modify the timer to run it by intervals of (m/n + t/60) min and
* use JavaScript to automatically move to next question when the corresponding interval of time finished

I hope you understand my idea and can direct me to the right files on system.

Thanks
In reply to Edwin Flórez

Re: New Assignment type: Use timer on questions

by Danny Glin -
This all sounds possible. Unfortunately I don't have any experience with the javascript aspects of the WeBWorK code.

When the page loads WeBWorK starts the javascript timer and passes it the amount of time, so it shouldn't be hard to modify that value according to your desires.

The timer already triggers popup windows to tell students that they are almost out of time, so it should be possible to create a similar trigger to automatically click the "Next Page" button when time expires.

A couple of things to consider if you are trying this:
  • You will need to give clear instructions to participants that they must choose an answer before time expires, since otherwise it will save a blank answer.
  • The transition time from page to page may vary, so you will need to incorporate some margin of error in your value t.