We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2aee811 commit 2c5af03Copy full SHA for 2c5af03
src/App.js
@@ -24,7 +24,15 @@ function App() {
24
}
25
26
const { correct_answer, incorrect_answers, question } = questions[index];
27
- const answers = [...incorrect_answers, correct_answer];
+ // const answers = [...incorrect_answers, correct_answer];
28
+ let answers = [...incorrect_answers];
29
+ const tempIndex = Math.floor(Math.random() * 4);
30
+ if (tempIndex === 3) {
31
+ answers.push(correct_answer);
32
+ } else {
33
+ answers.push(answers[tempIndex]);
34
+ answers[tempIndex] = correct_answer;
35
+ }
36
37
return (
38
<main>
0 commit comments