For an Online exam application using PHP,JS,MySql, I have an exam that has 3 Hours. All the questions are loaded in client side and after the time-out/submit only-we communicate with server for valuation of exam and results. When internet is gone for Some Hours/Time i cant calculate the exam results and i am losting my attended exam details for valuation.
Asked
Active
Viewed 150 times
1
-
Neither PHP nor Mysql can fix your internet connection... It's called an 'Online exam' for a reason - it may not be designed for (temporary) offline usage. – Kenney Sep 19 '15 at 15:55
-
Simple, use cookies. – KeepoN Sep 19 '15 at 15:57
-
i think session_set_cookie_params() will help, ... – Ramees mohammed Sep 19 '15 at 16:14
-
I used the coockies...but... after 2 HRs when submitting the exam automatically logout..i used setcookie("PHPSESSID", session_id(), time() + 3600 * 6); – Ramees mohammed Sep 21 '15 at 06:23
2 Answers
0
How I understand, your problem is PHPSESSION expiration (because PHP drop session after 30 minutes). So I recommend store your session data into database and make session cookie expiration time ~3 hours (exam time).
Also you can make PHP SESSION live time more long (How do I expire a PHP session after 30 minutes?). But i think more right way - store all data in database