/    Sign up×
Community /Pin to ProfileBookmark

I am making a Javascript quiz game for a school project, and I’ve finished my coding, but I want to make a START Page that tells the instructions as well as a “START” Button to be linked to my program, how would I go about this?

to post a comment
JavaScript

6 Comments(s)

Copy linkTweet thisAlerts:
@sciguyryanOct 16.2004 — Can you be a bit more specific about what you want to do?


RyanJ
Copy linkTweet thisAlerts:
@br8kd0wn16authorOct 16.2004 — I Have a 10 question quiz game, and there is a 6 second timer for each mult choice question. I want to have a "Start page" when I load the game with Instructions about the quiz, letting the player know there is only 6 seconds allowed for each question, then the player can push start, and it will be linked to my program, you understand?? here is what I have so far as for my game:

<html>

<head>

<title>Quiz show: array of questions </title>

<script>

var player;

var quesnumber = -1;

var questions = [

["keanu.jpg",

"What Movie is this Keanu Reeves Snap From?",

"Bill and Ted",

"Sweet November",

"Devil's Advocate",

"The Matrix",

"d"

],["jenlove.jpg",

"What Movie is this Jennifer Love Hewitt Snap From?",

"The Tuxedo",

"I Know What You Did Last Summer",

"I Still Know What You Did Last Summer",

"Can't Hardley Wait",

"b"

],

["pitt.jpg",

"What Movie is this Brad Pitt Snap From?",

"Fight Club",

"The Mexican",

"The Devil's Own",

"Ocean's Eleven",

"a"

],["sandler.jpg",

"What Movie is this Adam Sandler Snap From?",

"Happy Gilmore",

"Billy Madison",

"Big Daddy",

"Waterboy",

"c"

],["alba.jpg",

"What Movie is this Jessica Alba Snap From?",

"Honey",

"Dark Angel",

"Idle Hands",

"Never Been Kissed",

"a"

],["robin.jpg",

"What Movie is this Robin Williams Snap From?",

"Insomnia",

"One Hour Photo",

"Death To Smoochy",

"Good Will Hunting",

"c"

]]

var amountofquestions=questions.length;

var questionsanswerred=0;

function checkanswer() {

questionsanswerred++

var i;

for (i=0;i<document.question.qp.length;i++) {

if (document.question.qp[i].checked) {

player = document.question.qp[i].value;

}

}

if (player==correct) {

document.question.score.value = 1+parseInt(document.question.score.value);}

if(amountofquestions==questionsanswerred){alert("U've finished!!!!! Ur grnd scor ist "+document.question.score.value+" out of "+amountofquestions)}else{loadnext()};



}

var timer;

function loadnext() {

quesnumber++;

if (quesnumber==questions.length) {quesnumber = 0;}

document.pic.src = questions[quesnumber][0];

document.question.qstart.value = questions[quesnumber][1];

document.question.ansa.value = questions[quesnumber][2];

document.question.ansb.value = questions[quesnumber][3];

document.question.ansc.value = questions[quesnumber][4];

document.question.ansd.value = questions[quesnumber][5];

correct= questions[quesnumber][6];

timer=setTimeout("checkanswer()",6000)

}

</script>

</head>

<body onload="loadnext();">

<img name="pic" src="three.jpg" height="300"/> <br/>

<form name="question" onsubmit="clearTimeout(timer); checkanswer(); return false">

<input type="text" name="qstart" size="40" style="border:none;"/>

<br/>

<input type="radio" name="qp" value="a"/>

<input type="text" name="ansa" style="border:none;"/>

<input type="radio" name="qp" value="b"/>

<input type="text" name="ansb" style="border:none;"/>

<input type="radio" name="qp" value="c"/>

<input type="text" name="ansc" style="border:none;"/>

<input type="radio" name="qp" value="d"/>

<input type="text" name="ansd" style="border:none;"/>

<br/>

<input type="submit" value="CHECK"/> <br/>

<input type="text" value="0" name="score">

</form>

</body>

</html>
Copy linkTweet thisAlerts:
@vwphillipsOct 17.2004 — <html>

<head>

<title>Quiz show: array of questions </title>

<script>

var player;

var quesnumber = -1;

var questions = [

["keanu.jpg",

"What Movie is this Keanu Reeves Snap From?",

"Bill and Ted",

"Sweet November",

"Devil's Advocate",

"The Matrix",

"d"

],["jenlove.jpg",

"What Movie is this Jennifer Love Hewitt Snap From?",

"The Tuxedo",

"I Know What You Did Last Summer",

"I Still Know What You Did Last Summer",

"Can't Hardley Wait",

"b"

],

["pitt.jpg",

"What Movie is this Brad Pitt Snap From?",

"Fight Club",

"The Mexican",

"The Devil's Own",

"Ocean's Eleven",

"a"

],["sandler.jpg",

"What Movie is this Adam Sandler Snap From?",

"Happy Gilmore",

"Billy Madison",

"Big Daddy",

"Waterboy",

"c"

],["alba.jpg",

"What Movie is this Jessica Alba Snap From?",

"Honey",

"Dark Angel",

"Idle Hands",

"Never Been Kissed",

"a"

],["robin.jpg",

"What Movie is this Robin Williams Snap From?",

"Insomnia",

"One Hour Photo",

"Death To Smoochy",

"Good Will Hunting",

"c"

]]

var amountofquestions=questions.length;

var questionsanswerred=0;

function checkanswer() {

questionsanswerred++

var i;

for (i=0;i<document.question.qp.length;i++) {

if (document.question.qp[i].checked) {

player = document.question.qp[i].value;

}

}

if (player==correct) {

document.question.score.value = 1+parseInt(document.question.score.value);}

if(amountofquestions==questionsanswerred){alert("U've finished!!!!! Ur grnd scor ist "+document.question.score.value+" out of "+amountofquestions)}else{loadnext()};



}

var timer;

function loadnext() {

document.getElementById('TheQuiz').style.display='none';

quesnumber++;

if (quesnumber==questions.length) {quesnumber = 0;}

document.pic.src = questions[quesnumber][0];

document.question.qstart.value = questions[quesnumber][1];

document.question.ansa.value = questions[quesnumber][2];

document.question.ansb.value = questions[quesnumber][3];

document.question.ansc.value = questions[quesnumber][4];

document.question.ansd.value = questions[quesnumber][5];

correct= questions[quesnumber][6];

timer=setTimeout("checkanswer()",6000)

}



function Start(){

document.getElementById('TheQuiz').style.display='';

document.getElementById('TheInstructions').style.display='none';

}



</script>

</head>

<body onload="loadnext();">

<div id="TheInstructions" >

One way of many ways to start the Quiz<br>

No need to load another doc with this one

<br>

<input type="button" name="" value="Start Quiz" onclick="javascript:Start();">



</div>

<div id="TheQuiz" >

<img name="pic" src="three.jpg" height="300"/> <br/>

<form name="question" onsubmit="clearTimeout(timer); checkanswer(); return false">

<input type="text" name="qstart" size="40" style="border:none;"/>

<br/>

<input type="radio" name="qp" value="a"/>

<input type="text" name="ansa" style="border:none;"/>

<input type="radio" name="qp" value="b"/>

<input type="text" name="ansb" style="border:none;"/>

<input type="radio" name="qp" value="c"/>

<input type="text" name="ansc" style="border:none;"/>

<input type="radio" name="qp" value="d"/>

<input type="text" name="ansd" style="border:none;"/>

<br/>

<input type="submit" value="CHECK"/> <br/>

<input type="text" value="0" name="score">

</form>

</div>

</body>

</html>
Copy linkTweet thisAlerts:
@br8kd0wn16authorOct 18.2004 — when I open the code now in explorer, i can't get passed the start button, it won't move on to the next bit of code
Copy linkTweet thisAlerts:
@br8kd0wn16authorOct 18.2004 — I also tried opening it on my mac and it totally got screwed, the start button came up WITH the quiz, and neither worked, i don;t really know where it went wrong, I've been coming the code and i can't figure it out.
Copy linkTweet thisAlerts:
@vwphillipsOct 18.2004 — the code line

<input type="button" name="" value="Start Quiz" onclick="javascript:Start();">

has been corrupted witha space between java & script, common on this site
×

Success!

Help @br8kd0wn16 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...