import React, { useEffect, useState } from 'react'; import { Progress } from 'antd'; function letterCount() { const element = document.getElementById('queryMessage') as HTMLInputElement | null; if (element) { const valueLength = element.value.length; const lengthElement = document.getElementById('letterLength'); if (lengthElement) { lengthElement.innerHTML = valueLength.toString(); } console.log(valueLength); } else { console.error("Element with id 'queryMessage' not found."); } } function toggleSection() { let loadingSection = document.getElementById('loadingSection'); let generateQuiz = document.getElementById('generateQuiz'); if (loadingSection && generateQuiz) { // Check the current state and toggle if (getComputedStyle(loadingSection).display === 'none') { // Show loadingSection and hide generateQuiz loadingSection.style.display = 'block'; generateQuiz.style.display = 'none'; } else { // Hide loadingSection and show generateQuiz loadingSection.style.display = 'none'; generateQuiz.style.display = 'block'; } } else { console.error('One or both of the elements are missing.'); } } export default function Index() { const [percent, setPercent] = useState(0); const [secondsLeft, setSecondsLeft] = useState(5); useEffect(() => { const interval = setInterval(() => { setPercent((prevPercent) => { if (prevPercent >= 100) { clearInterval(interval); return 100; } return Math.round(prevPercent + (100 / 5)); // Round percentage }); setSecondsLeft((prevSeconds) => { if (prevSeconds <= 1) { clearInterval(interval); return 0; } return prevSeconds - 1; }); }, 1000); return () => clearInterval(interval); }, []); return ( <>

Take an AI Generative Quiz

Convert any text into an interactive quiz session

/2000

Trending

Dr. Marie Montessori Life Journey

12 classmates have taken this quiz.

Montessori Methods

10 classmates have taken this quiz.

Practical Methods

12 classmates have taken this quiz.

Or try these

Difficulty

Generating Quiz

This usually takes {secondsLeft} seconds

); }