import { Quiz } from '@crease/react';
import type { MixedContent, NonEmptyArray } from '@crease/react';
const content: NonEmptyArray<MixedContent> = [
{
format: "single-answer",
question: "Is 1+1=2?",
options: [
"True",
"False"
],
correctAnswers: 0 // Index of the correct answer within the options array.
},
{
format: "single-answer",
question: "Are there more atoms in the universe than pigeons?",
options: [
"True",
"False"
],
correctAnswers: 0
},
{
format: "multiple-answers",
question: "Which of these are prime numbers?",
options: ["-2", "7", "3", "1"],
correctAnswers: [1, 2] // has to be an array of indexes for "multiple-answers" format
}
]
function App() {
return (
<Quiz
theme='dark'
shuffle={true} // Order of questions displayed will be random
content={content}
/>
)
}