Quiz timer changes with user local clock BUG

Quiz timer changes with user local clock BUG

av Vahid Aghamohamadi -
Antall svar: 8

Hi,

Ive set the quiz time to 30 minutes, but when the student changes his computer clock the countdown counter will change too ?!. How to avoid this and timer reads the counter from server not local computer of students?

I am using 3.5 version

Gjennomsnittlig vurdering: -
Som svar til Vahid Aghamohamadi

Re: Quiz timer changes with user local clock BUG

av Tim Hunt -
Bilde av Core developers Bilde av Documentation writers Bilde av Particularly helpful Moodlers Bilde av Peer reviewers Bilde av Plugin developers

If a student is sitting in an exam, 30 minutes form the end, and they change the time on their watch, do they get more time? No.

Same in Moodle quiz. The time limit is enforced on the server.

Of course, the time left displayed in the student's browser depends on the time on that computer (after the quiz page has first loaded), but that just means that if they student changes the time on their computer, they will be confused about how much time is left. They won't actually get more time.

Gjennomsnittlig vurdering:Useful (1)
Som svar til Tim Hunt

Re: Quiz timer changes with user local clock BUG

av Vahid Aghamohamadi -
Thank u for ur quick reply,but I have checked it after changing his watch(computer clock) even without refreshing the page the timer will increase as the users clock change. Ive set the time limit in quiz activity configuration to 20 minutes and the automatically delivery the quiz activity after the time limit .

Have you ever tried it yourself?!

Even in the attempts report will show the quiz duration to higher than my limitation(20 minutes).
This is a javascript countdown timer u know better than me javascript gets its value from users browser not servers information. and it seems this is  quiet a big bug.

Som svar til Vahid Aghamohamadi

Re: Quiz timer changes with user local clock BUG

av Vahid Aghamohamadi -

In mod/quiz/module.js  the new date().getTime() is incorrect can u introduce me how to change it to get its time from server not users local clock ?!

        var secondsleft = Math.floor((M.mod_quiz.timer.endtime - new Date().getTime())/1000);

Som svar til Vahid Aghamohamadi

Re: Quiz timer changes with user local clock BUG

av Marcus Green -
Bilde av Core developers Bilde av Particularly helpful Moodlers Bilde av Plugin developers Bilde av Testers

"Have you ever tried it yourself?!"

Looking at the history of that file it looks like Tim has done most of the updates for the last 8 years, so I suspect he has tried it.

https://github.com/moodle/moodle/commits/master?before=a713ed3ba684e3e24b3b0eb3280f79792929ad79+35&path%5B%5D=mod&path%5B%5D=quiz&path%5B%5D=module.js

Som svar til Marcus Green

Re: Quiz timer changes with user local clock BUG

av Vahid Aghamohamadi -
Sometimes it happens Marcus.I laughed at my boss when he reported this bug  (users watch) . When he argued with me i tried it myself and discovered that he was true...  

  If somebody could introduced me to solve the problem ...

Som svar til Vahid Aghamohamadi

Re: Quiz timer changes with user local clock BUG

av Tim Hunt -
Bilde av Core developers Bilde av Documentation writers Bilde av Particularly helpful Moodlers Bilde av Peer reviewers Bilde av Plugin developers

I have explained this in more detail in the past, and I thought that had been captured in the Quiz FAQ, but it does not seem to be there now.

I am sure that

  1. The way I described it is how it is supposed to work - the time-limit is enforced server-side whatever is time-left is shown in the web browser.
  2. I am also sure that this used to work that way in the past, when I last tested this carefully, but that was some years ago when the timing code was last significantly changed.
  3. However, it is possible that a bug has been introduced somewhere, and if so, that would be serious.
  4. Note, however, that there is some slack added to the time-limit check to handle the possibility that the server is under heavy load at the moment the quiz ends. See the help for the "Last submission grace period" admin setting, which I have copied below. 
  5. There is also the issue described here MDL-54907 about the time that is recorded when Moodle automatically submits the attempt after the time-limit has passed.
  6. Note also some other related tracker issues that are not particularly related to the issue described here (MDL-27570MDL-57548MDL-49916MDL-60553). I mention this because we (the Open University) were thinking of doing some work to improve the timer. I must get around to finishing writing up my plans for that and posting them here for comment. Some of those plans would effectively fix the problem reported here, if it exists, but that would more be a side-effect. Our main focus is thinking about usability.

Here is the "Last submission grace period" description: There is a potential problem right at the end of the quiz. On the one hand, we want to let students continue working right up until the last second - with the help of the timer that automatically submits the quiz when time runs out. On the other hand, the server may then be overloaded, and take some time to get to process the responses. Therefore, we will accept responses for up to this long after time expires, so they are not penalised for the server being slow. However, the student could cheat and get this many seconds to answer the quiz. You have to make a trade-off based on how much you trust the performance of your server during quizzes.

Re point 3, if you can reproduce a student getting significant extra time to do a quiz. (E.g. a quiz with time-limit set to 3 minutes, and the student manages to submit having had the quiz open in their browser for 5 minutes (not the quiz being submitted by cron, and verifying that Last submission grace period is set to the default value of 60 seconds). Please post exact steps-to-reproduce in a new tracker issue, and tag that as a security issue. Please don't post detailed steps to reproduce in a public forum. Thanks.

Gjennomsnittlig vurdering:Useful (1)
Som svar til Tim Hunt

Re: Quiz timer changes with user local clock BUG

av Shamsuddeen Adamu -

This is true the time changes as you change the Clock time , but once the initial time is due it automatically submit. The Interesting part of his questions if the computer while taking the quiz develop a problem, by changing another computer to the student, the timer keep on counting (i.e. 5 minute left from computer one, 1 minute remaining switching to computer 2)..... How can we stop this problem?


Som svar til Tim Hunt

Re: Quiz timer changes with user local clock BUG

av Marcus Green -
Bilde av Core developers Bilde av Particularly helpful Moodlers Bilde av Plugin developers Bilde av Testers
When I taught web technologies I found that some students could never understand the difference between client side and server side.