I am trying to creaet a quizz with multiple choice questions. I am using EJS variables to display the Question,Correct Answer and Other 3 wrong options. It will diplay somewhat like this.
Question: How many centimeters in one meter?
- 100cm
- 50cm
- 20cm
- 10cm
and variables are something like this (I use a for loop to display all questions )
<%=Quizz[i].Question%>
<%=Quizz[i].Right_Answer%>
<%=Quizz[i].Wrong_Answer_1%>
<%=Quizz[i].Wrong_Answer_2%>
<%=Quizz[i].Wrong_Answer_3%>
So the problem i have is that i want to suffle and change the postion of the right answer for each question. so for one question it will be the first option and for another question right answer may be the 3rd option etc.Is there a way to achive this?