TKDPrincess
11-14-2005, 05:29 PM
Hey all!
I am trying to create a quiz that grades itself. So far, I can't get the grading part to work. The code is:
==================
<HTML>
<HEAD>
<SCRIPT language="javascript" type="text/javascript">
var platform = "document.edu.platform.value"
</SCRIPT>
<SCRIPT language="javascript" type="text/javascript">
function checkEdu()
{
if (platform == "")
{
alert("Don't you think students should use some form of computer?")
}
else if (platform.indexOf("Win") == 0)
{
alert("Do you really want your students using that unfriendly a machine?")
}
else if (platform == "Ap")
{
alert("That's a little old, isn't it?")
}
else if (platform == "Unix")
{
alert("Aren't students overpowered by Unix?")
}
else if (platform == "Mac")
{
alert("We agree on that")
}
else
{
alert("Has anyone ever heard of " + platform + "?")
}
}
</SCRIPT>
<TITLE> Quiz </TITLE>
</HEAD>
<BODY bgcolor="CC99FF" text="black">
<H1 align="CENTER"> Quiz </H1>
<HR align="CENTER" width="60%">
<FORM name="edu">
<CENTER>
The best computer platform for education is? <BR>
<INPUT type="RADIO" name="platform" value="Ap">Apple II <BR>
<INPUT type="RADIO" name="platform" value="Mac">Macintosh <BR>
<INPUT type="RADIO" name="platform" value="Unix">Unix with X-Windows<BR>
<INPUT type="RADIO" name="platform" value="Win 95">Windows'95<BR>
<INPUT type="RADIO" name="platform" value="Win 3.1">Windows 3.1<BR>
<INPUT type="RADIO" name="platform" value="Win NT">Windows NT<BR>
<INPUT type="BUTTON" name="check" value="Check" onClick="return checkEdu(platform)">
</CENTER>
</FORM>
</BODY>
</HTML>
==================
Any suggestions to make the alert box come up with the response?
Thanks!
I am trying to create a quiz that grades itself. So far, I can't get the grading part to work. The code is:
==================
<HTML>
<HEAD>
<SCRIPT language="javascript" type="text/javascript">
var platform = "document.edu.platform.value"
</SCRIPT>
<SCRIPT language="javascript" type="text/javascript">
function checkEdu()
{
if (platform == "")
{
alert("Don't you think students should use some form of computer?")
}
else if (platform.indexOf("Win") == 0)
{
alert("Do you really want your students using that unfriendly a machine?")
}
else if (platform == "Ap")
{
alert("That's a little old, isn't it?")
}
else if (platform == "Unix")
{
alert("Aren't students overpowered by Unix?")
}
else if (platform == "Mac")
{
alert("We agree on that")
}
else
{
alert("Has anyone ever heard of " + platform + "?")
}
}
</SCRIPT>
<TITLE> Quiz </TITLE>
</HEAD>
<BODY bgcolor="CC99FF" text="black">
<H1 align="CENTER"> Quiz </H1>
<HR align="CENTER" width="60%">
<FORM name="edu">
<CENTER>
The best computer platform for education is? <BR>
<INPUT type="RADIO" name="platform" value="Ap">Apple II <BR>
<INPUT type="RADIO" name="platform" value="Mac">Macintosh <BR>
<INPUT type="RADIO" name="platform" value="Unix">Unix with X-Windows<BR>
<INPUT type="RADIO" name="platform" value="Win 95">Windows'95<BR>
<INPUT type="RADIO" name="platform" value="Win 3.1">Windows 3.1<BR>
<INPUT type="RADIO" name="platform" value="Win NT">Windows NT<BR>
<INPUT type="BUTTON" name="check" value="Check" onClick="return checkEdu(platform)">
</CENTER>
</FORM>
</BODY>
</HTML>
==================
Any suggestions to make the alert box come up with the response?
Thanks!