473,394 Members | 2,020 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Javascript multiple quiz with a timer

kirara
19
Hi,

I am new to javascript and I want to construct a quiz with five questions, and for each question there is a 3 choises, the user can only choose one answer (radio buttons) and for question there is only a 20 second to answer it before moving to the next question.

my question is, how can I add a timer for each question and move to the next question when the time is 0,

please I'll appreciate any help here :)
Apr 21 '07 #1
1 1664
kirara
19
here my thoughts:

//array of questions
q = new Array()

//array of answers
a = new Array()
//submitedAnswers
aS = new Array()

//timelimit of each question
timeL = 20;

//score
score =0;
// function to calculate the time
function time(){
}

//function to check the submited answers against the a array

function chechA(){
count =0;
for(count=0, count<q.length,count++){
if(a[count]==aS[count]){
score++
}else{
score --
}

//to go to the next window
function goNext(){
if(timeL==0)
window.history.forward();
}

}

those are my thoughts although I know they miss a lot of things...so any help
Apr 21 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: C. David Rossen | last post by:
Hello: I found a script for a simple multiple choice quiz that I would like to tailor to a quiz that I want to post on a website. The quiz I want to use can be found at : ...
17
by: rgoya | last post by:
Peace be with you! About a year ago, I created a JavaScript which turns any web site into an online anti-war protest: http://www.geocities.com/rgoya/javascript/PROTEST.HTM I have recently...
6
by: Vandana Rola | last post by:
Hello Everyone, I posted this question earlier under creating Multiple choice quiz. Is it possible to ignore something using javascript. What I am trying to do is creating a multiple answer...
3
by: nawhaley | last post by:
Ok I'm working on a timer that will work over multiple pages. Basically what this means is I need the timer to start on page one and give the user x amount of time to complete a quiz that spans...
11
by: admin | last post by:
Hi all, First time poster here... I'm a webmaster and I'd like to add a simple script to my website which will allow users to fill in a brief multiple choice questionaire, and then provide a...
2
by: kenny | last post by:
I'm making a quiz to be posted on the internet. but I'm facing difficulties in finding a simple timer for the quiz (unlimited timing) which will keep on running regardless to the change of the page...
3
by: anagram | last post by:
hi , i am working on an online quiz.i have prepard the database access and everything in php.i want to know how to implement a timer in javascript such that once the time is up for answering...
2
by: Surya Vellanki | last post by:
Hi all, I have been struggling with this problem from a few days. I hope I will get some help here. I am developing an online quiz portal with ASP.NET 2.0 and I am using Atlas framework for...
13
by: patelxxx | last post by:
I'm setting up a quiz where users have 120 secs to finish a quiz, what timer function do I use and how? After 120 secs I want to display a message, "Sorry timed out". Thank you patelxxx
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.