Answer the question
In order to leave comments, you need to log in
How to track if the user aborted the test?
For session storage I use Spring Session and Redis. That is, the session is not stored in memory, but in the database.
There is a user. The user can start taking the test. That is, a question comes from the server, the user gives an answer, and so on until the questions run out. When they run out, you need to write the test result to the database.
The problem is this. I'm going to store the user's responses (for a test that hasn't finished yet) in a session, and the session is stored in Redis. And the user can leave the page, close the tab, etc., and then come back and, if his session is still open, he will pass the test from the middle.
And I want him to pass the test from the very beginning in such cases! How could I reset the test? Pinging comes to mind. I will constantly ping, every 5 seconds I will set the last ping time in the session, and when the user requests a new question, it will check - when was the last ping? If for a long time, then reset the test. But this solution seems to be a crutch.
Does anyone have options?
Answer the question
In order to leave comments, you need to log in
maybe the problem is
check without a slash or better yet write the full (absolute) path
You can try sending with the get method:
<script>
$.get(
"/check.php",
{
object: "-120822984"
},
alert( "Прибыли данные: " + data );
);
</script>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question