I'm Trying To Make A Quiz App Using Firebase As My Backend And Modular JavaScript As Client Side Script And I Came Across A Problem Recently.
So I Wanted To Make A Timer which shows the user how much time is left before the test ends and gets auto-submitted. But how do I implement it in such a way that the end user doesn't use the Debugger or Other Tools to manipulate this timer.
Also In Firebase Rules i have ensured Write Access is disabled after the "time slot" for attempting is over.
For Example: Lets Say Test 1 is Active from 1:00pm - 12:00pm(Timeslot) and you can attempt it for 60mins for any time in this time slot. How Can I Make Sure That The Client Attempts Test For Only 60 mins and not like if he starts from 1:00 and he manipulates the time to write till 12:00pm.
How Can I Implement This? Do I Need Server Side Support Like Cloud Functions? I Didn't Want To Use Them Till Now As Sending A Request Every 1 second or 5 seconds Uses Up A Lot Of The Data Resources When This App Scales to More People. (Also That I'm Building It On Spark Plan)
You need to check this server side. You can't efficiently prevent someone to perform client-side editing.
startTime.endTime.endTime - startTime <= 60 mins