I am looking to create an online exam consisting of 5 pages, each with a countdown timer set at 120 seconds and 4 questions on each page. Once the timer runs out, users will be automatically redirected to the next page, or they can manually click the "next" button before that.
Utilizing Laravel 5.4 and VueJs, I have implemented an Ajax request for every question answered by the user. However, my main goal is to prevent users from navigating back to previous pages or viewing other pages until the designated time limit has elapsed. Is this even feasible?
My plan is to develop this application using Vuejs
and vue-router
, although I am unsure about how to integrate this functionality using vue-router
. Despite conducting research, I haven't found much information regarding this particular issue!
Alternatively, should I consider abandoning vue-router
and just implement a simple router of my own, like:
$("#page1").show();
$("#page2").hide();
$("#page3").hide();
.
.
// after 120 secs
$("#page1").hide();
$("#page2").show();
$("#page3").hide();
.
.
// Nevertheless, I believe this approach may not provide adequate security!
Any insights or suggestions would be highly valued. Thank you in advance.
UPDATE:
This exam allows users to view a list of randomly chosen English words
sourced from the words
table exclusively! Users then proceed to click on any word whose meaning they know, triggering an ajax request for each selection to save the word's ID in the results
table. Additionally, there exists a fake_words
table wherein 50 random words are selected alongside genuine ones. If a user clicks on fake words more than 3 times, the test will result in failure. The final outcome will reveal the user's vocabulary proficiency level.
UPDATE 2: Although I attempted to implement this functionality using vue-router
, I realized that all questions are randomly fetched from the database in one query, sent (via ajax) to the browser before the exam commences. This begs the question - should I segregate them into separate arrays and allocate each array to a distinct page? Do I have no choice but to do so? Can't I simply use a single v-for
loop for all questions? Suppose I opt to modify the number of questions; would this necessitate manual code updates and creating new vue-router
pages or removing existing ones?