View Full Version : Whats the code to make a quiz?


ceri1000
11-03-2005, 03:51 PM
Help...
ive got some kind of code, but its all confusing because the enter button wont work and i dont know what im suppose to change, can ne1 help?

iTom
11-03-2005, 03:55 PM
well, we need to see your code and your site which is having the problem b4 we can help you.

ceri1000
11-04-2005, 03:48 PM
thats the code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">



<HTML>



<HEAD>

<TITLE>Which Sanrio Character are you?</TITLE>

</HEAD>



<BODY BACKGROUND="#000000" BGCOLOR="#000000" TEXT="#ffffff" LINK="#8080ff" VLINK="#800080" ALINK="#75A5F3">

<style>

body { font-family : verdana; font-size : 11px; font-weight : normal; font-style : normal; text-decoration : none; }

BODY { scrollbar-base-color: #0076C1; scrollbar-track-color: #0076C1; }

input {font-family:verdana; font-size:9pt; color:black; background:transparant;

border-color:#000000; border-style: none;}

textarea{font-family:verdana; font-size:9pt; color:black;

background:white; border-color:#000000; border-style: solid; scrollbar-face-color: #FFFFFF; scrollbar-shadow-color: #FFFFFF; scrollbar-highlight-color: #FFFFFF; scrollbar-3dlight-color: #FFFFFF; scrollbar-darkshadow-color: #FFFFFF; scrollbar-track-color: #FFFFFF; scrollbar-arrow-color: #337273;}

A: {text-decoration : none;}

A:link {text-decoration : none;}

A:active {text-decoration : none;}

A:visited {text-decoration : none;}

A:hover {color:#5EC7F2; text-decoration:none;}

.white {color:#000000;

font-family: arial;

font-size:12px;

text-align:justify;

letter-spacing:1px;

}

.black {color:#ffffff;

font-family: arial;

font-size:12px;

text-align:justify;

letter-spacing:1px;

}

</style>








<SCRIPT LANGUAGE="JavaScript">

<!--

function process()

{

var goth = 0;

var hippy = 0;

var pikey = 0;

var trendy = 0;

var f = document.f;

var i = 0;








for (i = 0; i < f.one.length; i++) if (f.one[i].checked) value = f.one[i].value;

if (value == "1") {goth++; }

if (value == "2") { hippy++; }

if (value == "3") { pikey++; }

if (value == "4") { trendy++; }

if (value == "5") { grunger++; }

if (value == "6") { neutral++; }



for (i = 0; i < f.two.length; i++) if (f.two[i].checked) value = f.two[i].value;

if (value == "1") {pikey++; }

if (value == "2") { goth++; }

if (value == "3") { grunger++; }

if (value == "4") { trendy++; }

if (value == "5") { hippy++; }



for (i = 0; i < f.three.length; i++) if (f.three[i].checked) value = f.three[i].value;

if (value == "1") {hippy++; }

if (value == "2") { grunger++; goth++;}

if (value == "3") { pikey++; trendy++; }

if (value == "4") { neutral++; }

if (value == "5") { grunger++; }

if (value == "6") { trendy++; }


















var out = "goth";

i = goth;

if (hippy> i) { out = "hippy"; i = hippy; }

if (pikey> i) { out = "pikey"; i = pikey; }

if (trendy> i) { out = "trendy"; i = trendy; }

if (grunger> i) { out = "grunger"; i = grunger; }

if (neutral> i) { out = "neutral"; i = neutral; }

location.href = out + "http://www.freewebs.com/flutter_2/t1.html";

}

function err(msg, url, line)

{

location.href = "http://www.freewebs.com/flutter_2/t1.htm";

}

//window.onerror = err;

// -->

</SCRIPT>

</head>
















<body link="#6600FF" vlink="#6600FF" bgcolor="white">

<center><table width="400" cellspacing="0" cellpadding="0" border="0">

<tr><td align="top" valign="top">

<form name="f">

<center>Which Sanrio Character Are You?

<p>

</FONT></center>

<font color="#ffffff">

<small><br>




<br>

<b>On a normal day, you'd be wearing...</b><br><br>

<input type="radio" name="one" value="1">Black, black, black. Did I mention black?<br>

<input type="radio" name="one" value="2">Long flowy skirts/flares, flowery shirts etc.<br>

<input type="radio" name="one" value="3">Anything thats pink or white!<br>

<input type="radio" name="one" value="4">Whatever's in fashion<br>

<input type="radio" name="one" value="5">Baggy Jeans with or without chain, hoodie<br>

<input type="radio" name="one" value="6">Anything I'm comfortable in.<br>



<br><br>



<br>

<b>Your Favourite colour is:</b><br><br>

<input type="radio" name="two" value="1">Black<br>

<input type="radio" name="two" value="2">All the colours in a rainbow!<br>

<input type="radio" name="two" value="3">Pink<br>

<input type="radio" name="two" value="4">Purple<br>

<input type="radio" name="two" value="5">Blue<br>



<br><br>



<center><input type="button" value="What's your inner baa?" onclick="process();" style="font-size:8pt; color:white; background-color:gray; border:1px solid #ffffff; border-style: solid; border-top-color: #ffffff; border-left-color: #ffffff; border-bottom-color: #000000; border-right-color: #000000;"><br><font size="1">

<p>

Please make sure you've answered all the questions!

<br>Code adapted from <a href="http://www.lacota.net/alanna/quiztutorial.html">alanna's quiz tutorial</a>

<br></font></center>

</body>

</html>

kittycat
11-04-2005, 09:05 PM
This line

location.href = out + "http://www.freewebs.com/flutter_2/t1.html";

The part between the quotes should just be .html or whatever the file extension of the results pages is