A
A
Alexey selftrips.ru2021-09-29 01:34:55
AJAX
Alexey selftrips.ru, 2021-09-29 01:34:55

How to output an array (questions for a quiz) with a response expectation but a time limit?

The questions are in an array (for example 2x2=?, 2x3=?)
The next question is displayed, the user must enter the answer
, after which the next one is displayed.
If a question is not entered for a certain time, the next question appears.
If I understand correctly, you cannot set a time limit using prompt.
It must be done in conjunction with html ... but how?
Thanks

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
ikutin666, 2021-09-29
@ikutin666

you can try with setTimeout,

let timer=null;
if(timer)
{
clearTimeout(timer)
}
timer=setTimeout(()=>{
nextQuestion();
},1*60*1000) //минута

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question