Sobes.tech
Junior — Senior

Creating an interactive testing application

livecode

Task condition

Develop a small quiz application that:

  • Shows the question and allows the user to select one of the provided answer options.
  • After selection and clicking the "Next" button, displays the next question.
  • After all questions are answered, displays a message like "You answered correctly on N out of N questions" and shows a "Restart" button, allowing to retake the test.
function App() {
  const questionsData = [
    {
      question: "How many people are on Earth?",
      answer: 3,
      variants: [
        { name: "6 billion", value: 1 },
        { name: "7 billion", value: 2 },
        { name: "8 billion", value: 3 },
      ],
    },
    {
      question: "How many continents are there?",
      answer: 2,
      variants: [
        { name: "5", value: 1 },
        { name: "6", value: 2 },
        { name: "7", value: 3 },
      ],
    },
    {
      question: "How many oceans are there on Earth?",
      answer: 1,
      variants: [
        { name: "5", value: 1 },
        { name: "6", value: 2 },
        { name: "7", value: 3 },
      ],
    },
  ];
}