kate22
12-10-2013, 08:09 AM
Hello, I have problem to show one question at a time, could someone help me please? Now I can see all questions. I know that this is possible by putting each question in div, I just dont know how to do it. Probably little piece of javascript or jquery will help as well. Any help is appreciated. Thanks alot.
<html>
<head>
<title>JavaScriptKit.com Multiple Choice Quiz Script</title>
<link rel="stylesheet" href="../css/my.css" type="text/css">
<script src="../js/quizconfig.js">
</script>
<script>
var actualchoices = [];
document.cookie="ready=yes"
</script>
</head>
<body>
<p align="center">
<form method="POST" name="myquiz">
<div class="gheader">
1)Variables declared outside a function, become </div>
<div class="gselections">
<label><input type="radio" value="a" name="question1">a) International variables</label><br>
<label><input type="radio" value="b" name="question1"> b) Universal variables </label><br>
<label><input type="radio" value="c" name="question1"> c) Global variables </label><br>
<label> <input type="radio" value="d" name="question1"> d) Local variables </label><br>
</div>
<br>
<div class="gheader">
2)If you add a number and a string, the result will be? </div>
<div class="gselections">
<label><input type="radio" value="a" name="question2"> a) Number</label><br>
<label> <input type="radio" value="b" name="question2"> b) Error</label><br>
<label><input type="radio" value="c" name="question2"> c) String + number </label><br>
<label> <input type="radio" value="d" name="question2"> d) String</label><br>
</div>
<br>
<div class="gheader">
3) In JavaScript, different kinds of Loop are</div>
<div class="gselections">
<label> <input type="radio" value="a" name="question3">a) for</label><br>
<label> <input type="radio" value="b" name="question3"> b) for/in </label><br>
<label> <input type="radio" value="c" name="question3"> c) while</label><br>
<label> <input type="radio" value="d" name="question3"> d) for/out </label><br>
</div>
<div class="gheader">
4) JavaScript is</div>
<div class="gselections">
<label> <input type="radio" value="a" name="question4">a) Prototype based language </label><br>
<label> <input type="radio" value="b" name="question4"></label>b) Class based language<br>
<label> <input type="radio" value="c" name="question4"> c) ID based language
</label><br>
<label><input type="radio" value="d" name="question4">d) all of above</label><br>
</div>
<div class="gheader">
5) The Array object is used to store:</div>
<div class="gselections">
<label><input type="radio" value="a" name="question5">a) Single value </label><br>
<label> <input type="radio" value="b" name="question5"> b) candies </label><br>
<label> <input type="radio" value="c" name="question5"> c) Multiple values </label><br>
<label> <input type="radio" value="d" name="question5"> d) bananas</label><br>
</div>
<div class="gheader">
6) What is the DOM?</div>
<div class="gselections">
<label> <input type="radio" value="a" name="question6"> a) Difficult Object Model </label><br>
<label> <input type="radio" value="b" name="question6"> </label>b) Document Object Model<br>
<label><input type="radio" value="c" name="question6">c) Document Open Mouse </label><br>
<label> <input type="radio" value="d" name="question6"> </label>d) Document Open Model<br>
</div>
<div class="gheader">
7) Where is the correct place to insert a JavaScript</div>
<div class="gselections">
<label>
<input type="radio" value="a" name="question7">a) The < head > section </label><br>
<label> <input type="radio" value="b" name="question7"> b) The < body > section </label><br>
<label><input type="radio" value="c" name="question7">c) both, a and b are correct </label><br>
<label><input type="radio" value="d" name="question7">d) none of above</label><br>
</div>
<br>
<div class="gheader">
8) How do you create a variable "x" that is equal to the integer 4?</div>
<div class="gselections">
<div class="gselections">
<label><input type="radio" value="a" name="question8">a) int x = 4;</label><br>
<label><input type="radio" value="b" name="question8">b) var x = 4;</label><br>
<label><input type="radio" value="c" name="question8">c) num x = 4;</label><br>
<label><input type="radio" value="d" name="question8">d) number x = 4;</label><br>
</div>
<br>
<div class="gheader">
9) The window object represents:</div>
<div class="gselections">
<label><input type="radio" value="a" name="question9">a)an open window in a browser</label><br>
<label><input type="radio" value="b" name="question9">b)closed window in a browser</label><br>
<label><input type="radio" value="c" name="question9">c) an open window in a room</label><br>
<label><input type="radio" value="d" name="question9"> d) closed window in a browser</label><br>
</div>
<br>
<div class="gheader">
10) Which continent is host to the most countries in the world?</div>
<div class="gselections">
<label><input type="radio" value="a" name="question10"> a) Asia</label><br>
<label><input type="radio" value="b" name="question10">b) Africa</label><br>
<label><input type="radio" value="c" name="question10">c) Europe</label><br>
</div>
<div align="center">
<input type="button" value="Grade Me!" name="B1" onClick="gradeit()"> <input type="button" value="Reset" name="B2" onClick="document.myquiz.reset()"></div>
</div>
</form>
</body>
</html>
<html>
<head>
<title>JavaScriptKit.com Multiple Choice Quiz Script</title>
<link rel="stylesheet" href="../css/my.css" type="text/css">
<script src="../js/quizconfig.js">
</script>
<script>
var actualchoices = [];
document.cookie="ready=yes"
</script>
</head>
<body>
<p align="center">
<form method="POST" name="myquiz">
<div class="gheader">
1)Variables declared outside a function, become </div>
<div class="gselections">
<label><input type="radio" value="a" name="question1">a) International variables</label><br>
<label><input type="radio" value="b" name="question1"> b) Universal variables </label><br>
<label><input type="radio" value="c" name="question1"> c) Global variables </label><br>
<label> <input type="radio" value="d" name="question1"> d) Local variables </label><br>
</div>
<br>
<div class="gheader">
2)If you add a number and a string, the result will be? </div>
<div class="gselections">
<label><input type="radio" value="a" name="question2"> a) Number</label><br>
<label> <input type="radio" value="b" name="question2"> b) Error</label><br>
<label><input type="radio" value="c" name="question2"> c) String + number </label><br>
<label> <input type="radio" value="d" name="question2"> d) String</label><br>
</div>
<br>
<div class="gheader">
3) In JavaScript, different kinds of Loop are</div>
<div class="gselections">
<label> <input type="radio" value="a" name="question3">a) for</label><br>
<label> <input type="radio" value="b" name="question3"> b) for/in </label><br>
<label> <input type="radio" value="c" name="question3"> c) while</label><br>
<label> <input type="radio" value="d" name="question3"> d) for/out </label><br>
</div>
<div class="gheader">
4) JavaScript is</div>
<div class="gselections">
<label> <input type="radio" value="a" name="question4">a) Prototype based language </label><br>
<label> <input type="radio" value="b" name="question4"></label>b) Class based language<br>
<label> <input type="radio" value="c" name="question4"> c) ID based language
</label><br>
<label><input type="radio" value="d" name="question4">d) all of above</label><br>
</div>
<div class="gheader">
5) The Array object is used to store:</div>
<div class="gselections">
<label><input type="radio" value="a" name="question5">a) Single value </label><br>
<label> <input type="radio" value="b" name="question5"> b) candies </label><br>
<label> <input type="radio" value="c" name="question5"> c) Multiple values </label><br>
<label> <input type="radio" value="d" name="question5"> d) bananas</label><br>
</div>
<div class="gheader">
6) What is the DOM?</div>
<div class="gselections">
<label> <input type="radio" value="a" name="question6"> a) Difficult Object Model </label><br>
<label> <input type="radio" value="b" name="question6"> </label>b) Document Object Model<br>
<label><input type="radio" value="c" name="question6">c) Document Open Mouse </label><br>
<label> <input type="radio" value="d" name="question6"> </label>d) Document Open Model<br>
</div>
<div class="gheader">
7) Where is the correct place to insert a JavaScript</div>
<div class="gselections">
<label>
<input type="radio" value="a" name="question7">a) The < head > section </label><br>
<label> <input type="radio" value="b" name="question7"> b) The < body > section </label><br>
<label><input type="radio" value="c" name="question7">c) both, a and b are correct </label><br>
<label><input type="radio" value="d" name="question7">d) none of above</label><br>
</div>
<br>
<div class="gheader">
8) How do you create a variable "x" that is equal to the integer 4?</div>
<div class="gselections">
<div class="gselections">
<label><input type="radio" value="a" name="question8">a) int x = 4;</label><br>
<label><input type="radio" value="b" name="question8">b) var x = 4;</label><br>
<label><input type="radio" value="c" name="question8">c) num x = 4;</label><br>
<label><input type="radio" value="d" name="question8">d) number x = 4;</label><br>
</div>
<br>
<div class="gheader">
9) The window object represents:</div>
<div class="gselections">
<label><input type="radio" value="a" name="question9">a)an open window in a browser</label><br>
<label><input type="radio" value="b" name="question9">b)closed window in a browser</label><br>
<label><input type="radio" value="c" name="question9">c) an open window in a room</label><br>
<label><input type="radio" value="d" name="question9"> d) closed window in a browser</label><br>
</div>
<br>
<div class="gheader">
10) Which continent is host to the most countries in the world?</div>
<div class="gselections">
<label><input type="radio" value="a" name="question10"> a) Asia</label><br>
<label><input type="radio" value="b" name="question10">b) Africa</label><br>
<label><input type="radio" value="c" name="question10">c) Europe</label><br>
</div>
<div align="center">
<input type="button" value="Grade Me!" name="B1" onClick="gradeit()"> <input type="button" value="Reset" name="B2" onClick="document.myquiz.reset()"></div>
</div>
</form>
</body>
</html>