I need to mix the answers to Quiz-Questions in random order.
I have Question objects like:
Question = {
question: 'what is the capital of Germany?',
answer1: 'Berlin',
answer2: 'London',
answer3: 'Paris',
answer4: 'Rome'
}
Every time I display the Question in the template I generate a random array e.g.
randomOrder = [3,2,0,1]
I want to use string interpolation in the template to show the question with random Order of the answers:
Question: {{Question.question}}<br>
Answer1: {{Question.answer'answerOrder[0]'}}<br>
Answer2: {{Question.answer'answerOrder[1]'}}<br>
Answer3: {{Question.answer'answerOrder[2]'}}<br>
Answer4: {{Question.answer'answerOrder[3]'}}<br>
Can someone help me with the correct syntax for angular?