Limiting number of tries in a quiz (ASP not ASP.net)

B

bj

I want to limit the number of tries an individual has at a question in
an online asp quiz to two. I cannot write to the user's hard drive.
I understand that this is possible to do using session cookies (not
that desireable since the powers that be get very nervous with even
the mention of a cookie), session variables or by using the url and
the get/post method of a form. Can someone tell me either (1) how to
do it or, (2) wher to look to see how.

Thanks
bj
 
S

Scott McNair

(e-mail address removed) (bj) wrote in
I want to limit the number of tries an individual has at a question in
an online asp quiz to two. I cannot write to the user's hard drive.
I understand that this is possible to do using session cookies (not
that desireable since the powers that be get very nervous with even
the mention of a cookie), session variables or by using the url and
the get/post method of a form. Can someone tell me either (1) how to
do it or, (2) wher to look to see how.

<%
If Request.Form("Attempt")="" Then Attempt = 0 Else Attempt = CInt
(Request.Form("Attempt"))
Answer = Request.Form("Answer")
If Answer = "23" Then Response.Write "Correct!" : Response.End
Attempt = Attempt + 1
If Attempt > 2 Then Response.Write "Sorry! You missed two times." :
Response.End
If Attempt <> 1 Then Response.Write "Sorry, that's the wrong answer.
Try again:<br><br>"
%>
<form method=post action="<%=Request.ServerVariables("SCRIPT_NAME")%>">
<input type=hidden name=Attempt value="<%=Attempt%>">
I'm thinking of a number:
<select name=Answer>
<option value="5">5</option>
<option value="23">23</option>
<option value="55">55</option>
<option value="235">235</option>
</select>
<input type=submit>
</form>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top