<%
Curq = Request.Form ("Curq")
ANSW = Request.Form ("ANSW")
Correct=request.form ("correct")
Wrong=request.form ("wrong")
' Poor man ' s IsNull Code goes here
If poormansisnull (CURQ) Then
CURQ = 1
correct = 0
Wrong = 0
End If
If poormansisnull (ANSW) Then
CURQ = Curq + 1
If Curq > (Your Maximum number of questions) Then
%>
<p>congratulations. You are have completed this test. You missed <%=wrong%>
Questions
But got <%=correct%> questions right. That's equivilent to a
<%= (correct/(MAX#OFQS)%>%.
Thank for doing the test.
<% End If%>
<% Set conntemp = Server.CreateObject ("Adodb.connection")
Set MyDSN = ' (your DSN info goes here)
Conntemp. Open MyDSN
Set MySQL = "SELECT * from QUESTIONS WHERE questionid=" & Curq
Set rstemp= conntemp. Execute (MySQL)
%>
<form method=post action= "myasp.asp" >
<input Type=hidden Name=curq value=<%=curq%>>
Your question is <%=rstemp ("question")%><br>
Answer:
<select name= "ANSW" >
<option value=1><%=rstemp ("Answera") </option>
<option value=2><%=rstemp ("Answerb") </option>
<option value=3><%=rstemp ("Answerc") </option>
<option value=4><%=rstemp ("Answerd") </option>
</select>
<input type=hidden value= "<%=correct%>" ><input type=hidden value= "<%=wrong%>" >
<input Type=reset value= "clear the Form" ><input type=submit value= "ok!" >
</form>
<% Else%>
<% Set conntemp = Server.CreateObject ("Adodb.connection")
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service