How I create multiple choice quiz with timer on Wix ?

Hi Abdul,

Creating a quiz system from scratch that includes score keeping, timer, option to save questions for later, is not a simple job and as far as i’m aware there is no tutorial for this specific mechanism.

You can start by exploring the example section

In addition, feel free to search the forum for some more inspiration and code examples from other users.

Generally, there are a lot of parameters that you need to take into account:

  • Is the quiz open for all or do you need to restrict it to 1 quiz per user? then you should think of a way to keep a user list along with this info.

  • what happens if the user closes the quiz before finishing? should he be allowed to continue later?

  • Do you plan on having only one quiz on your site? is it going to be modified later in the future?
    If the answer is yes, you should not hard code the questions, and instead invest more time in making the system future proof. this can be done by storing the questions in a collection and creating a system that could generate a quiz based on a collection data.

  • How secure should the site be? Is there a need to make it cheat-proof?
    Generally, frontend code is modifiable by site visitors and is considered as not secure.
    If you wish to prevent your users from cheating you should implement a combination of front and backend code. for example, keeping the quiz start time in a backend collection instead of a local variable.

Again, this is not a simple system, as there are many other implementation decisions that should be decided upon.

If you have any specific questions, feel free to ask them here.
Good luck!