Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

rushh's avatar
Level 1

Online quiz application

I am working on online quiz application in laravel 5.5 , and my most important requirement is

  1. question display one by one
  2. when i refresh page during exam it's return back to current page
  3. each question predefined time limit.

i study all the reference but second and third requirement can not full fill. please give me suggestion.

thank you

0 likes
2 replies
RomainB's avatar
RomainB
Best Answer
Level 13
  1. Route like question/{question} should do the work. Question/1, question/2, question/3 etc...

  2. Simple way: in QuestionController@show method, pass a variable time to the view with a now() method, store it in your view with a hidden field - or directly in your view, use now() method to fill the hidden field's value -. And in your QuestionController@store (when reply is sent), verify the value of the field.

  3. Less simple way: the same with session, so the visitor can't modify the html.

CodeNathan's avatar
  • per questionnaire that's being taken, store in the database the last answered question in a database or session as @romainb has mentioned
  • you could store on the database when the question was answered as a DateTime field and then use javascript to do a countdown and then redirect or furthermore you can use something like pusher for broadcasting https://laravel.com/docs/5.8/broadcasting

Please or to participate in this conversation.