PDA

View Full Version : How would I make a quz website like this?


icebreaker3d
06-20-2006, 08:37 PM
This is my first time posting here. I looked around at the other sub-forums and I believe this is the correct section to post this. I am not sure what scripting language to do this in. I want to make a quiz based website. People answer certain questions I give them on the site. When they are done they click submit and it tells them the % of a fan they are. It is a fan based website. I want each question to be worth a certain amount of points. Like one answer could give +1 point on the overall score. Then at the end the score is talllyed by adding the score together and dividing by 100.

pj_anf
06-21-2006, 12:38 PM
you could easily do this with javascript/vb-script which is where your currently posting. However javascript and vbscrit are visible to the user to they could see the answers if adept enough to look at the code behind the scenes. I would suggest maybe looking into a server side language or possibly even flash for developing a quiz system for something higher end.


As for a simple javascript example for you here is some pseudo-code to get you started:

<form>
<input type="text" value="" name="answer1">
<button type="submit" onpress="javascript:checkanswers();">
</form>


<script type="javscript">
var totalscore = 0;
checkanswers(){
if (answer1 == 'blue'){
totalscore++;
}

return totalscore;
}
</script>