Temporary survey: how to consider Internet breaks?

I am preparing a test or quiz in Django. The survey must be completed within a certain time frame. Say 30 minutes to 40 questions. I can always initiate the clock at the beginning of the test, and then calculate the time by the time the quiz ends. However, it is likely that problems such as a failure in the Internet connection or system malfunctions / power outages, etc., may occur during the attempt.

I need a strategy to find out when such an accident occurred and stop the clock, and then let the user pass the test again from where he left off and restart the clock.

What is the right strategy? Any help including sample code / examples / ideas is appreciated

+4
source share
4 answers

Your strategy should depend on the importance of the test and the ability to repeat the entire test.

  • Is a test / survey for fun or a test of competency / knowledge?
  • Do you deal with registered users?
  • Are tests randomly generated from a large survey of available questions?

These are the questions you need to answer first.

Remember, that:

  • an attacker MAY simulate a connection failure / power failure,
  • The only watch you can trust is the one on the server side,
  • everything on the browser side can be manipulated (think about using firebug / console js)

My approach:

  • Inform users that TIME is an important factor and connection problems may not be taken into account when assigning a class ...,
  • Submit only one question , wait for an answer, serve another,
  • The whole test time should be calculated as the SUM of each response time:
    • save each "send question" / "answer received" timestamps and calculate the response time from it,
    • time between questions will not be considered
    • you will have additional opportunities for which questions were more difficult / it took more time.
  • Add a heartbeat to your question page (for example, an ajax request every X seconds) when the heartbeat stops (depending on the parameters you have):
    • cancel the question and notify the user through a dialogue that he has connection problems and needs to update to get a new question, if you have a larger poll of questions to use,
    • pause time on the server side (and, for example, a foggy question page, so that the user can not answer until the connection is restored). IMO is only for games / fun quizzes / tests.
    • save information on the server side at each interruption, which will later facilitate a solution that allows you to repeat the entire test, for example. he was fine until the 20th question, and then on 3-4 easy questions in a row he fell ...
+2
source

The easiest way is to add a timestamp when the person starts the quiz, and then compare it with the sending. Of course, this does not take into account connection drops, crashes, etc., as you mentioned.

To address these issues, I would probably use something like node.js. Each client has a "registration" when connected to the quiz. Then, at regular intervals (every 1 s, 10 s, 1 m, etc.), the Client checks. If the client does not register at these intervals, you can assume that they have failed the connection. You can track when they reconnect and start the timer from where they left off.

This is my first thought on how to track connection drops and crashes. The same can be done with an external ajax call in the Django view.

+2
source

Either you make the clock on the client side, in which case they can always cheat in any way, or you do it on the server side, and then you do not take into account these interruptions.

To change the hype a bit and still allow for breaks, you can "save a life."

Here the client-side code tells the server that it is still there so often, say every 5 seconds. The server side notes when it stops receiving these messages, and pauses / stops the clock. However, he still has a start and end time, so you know how much time it really takes time on the wall, and also how much time has passed while the client was supposedly there.

With these two pieces of information, you could easily track weird behavior and blacklisted people. Blacklisted people may not know that they are blacklisted, but their quiz scores are not displayed to other users of your quiz.

+2
source

The problem with pausing the clock when disconnecting the connection with the user is that the user can simply disconnect his computer from the Internet each time he receives a new question, and then reconnect as soon as they work out an answer.

One thing you could do is give the user a certain amount of time for each question.

The clock starts when the user successfully transmits the question to his browser, and if the user sends the answer before the deadline, he is accepted, otherwise he is invalid.

This would mean that if the user lost the connection, it would only affect the question that they are currently using. But it also means that the user will not have flexibility in how much time they want to distribute for each issue, you decide for them.

I thought that you could do something like removing a question from the screen if the connection to the server was not already alive, but the user could always simply remove the screen from the question before disconnecting.

0
source

All Articles