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

Discussion in 'ASP General' started by bj, Apr 16, 2004.

  1. bj

    bj Guest

    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
     
    bj, Apr 16, 2004
    #1
    1. Advertising

  2. bj

    Scott McNair Guest

    (bj) wrote in
    news::

    > 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>
     
    Scott McNair, Apr 16, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?RE9LT01AY29tbXVuaXR5Lm5vc3BhbQ==?=

    ASP.NET 2.0 Website tries to connect old SQL Connection

    =?Utf-8?B?RE9LT01AY29tbXVuaXR5Lm5vc3BhbQ==?=, Aug 25, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    527
    =?Utf-8?B?RE9LT01AY29tbXVuaXR5Lm5vc3BhbQ==?=
    Aug 26, 2005
  2. Jp Calderone
    Replies:
    0
    Views:
    963
    Jp Calderone
    Jun 28, 2005
  3. Hung
    Replies:
    3
    Views:
    305
    Gordon Beaton
    Feb 27, 2007
  4. Limiting number of control instances?

    , Apr 21, 2005, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    120
    Zarko Gajic
    Apr 26, 2005
  5. Darren
    Replies:
    0
    Views:
    94
    Darren
    Jul 13, 2003
Loading...

Share This Page