The First Thanksgiving
Thanksgiving Web Quest



<% 'Request all values ID=CInt(trim(request.QueryString("ID"))) Answer=CInt(trim(request.QueryString("Answer"))) userAnswer=CInt(trim(request.QueryString("userAnswer"))) Total = CInt(trim(request.QueryString("Total"))) Times = CInt(trim(request.QueryString("Times"))) 'Set all initial value if Answer <> userAnswer And Times < 1 then ID = ID -1 'Make sure questino didin't move forward if the answer is wrong 'Open a DB Connection set conn=Server.CreateObject("ADODB.Connection") conn.open "DSN=dotcom" SQL="SELECT * FROM tbThanksGivingGame where ID= " & ID & " order by ID" set rs=conn.execute(SQL) if times < 2 and ID >1 then ID = ID -1 ' display previous question answer lastSQL="SELECT strCorResponse,strIncorResponse1,strIncorResponse2 FROM tbThanksGivingGame where ID= " & ID set lastRs=conn.execute(lastSQL) 'Set the first Message If Answer = 0 and userAnswer= 0 then msg="Ready? Here is your first question:" 'Set correct answer message elseIf Answer = userAnswer then msg=lastRs("strCorResponse") Total=Total+1 Times = 0 'set incorrect message for first and second time elseIf Answer <> userAnswer then Times=Times+1 if Times=1 then msg="" & lastRs("strIncorResponse1") & "" elseif Times = 2 then msg="Sorry. Here's the answer. " &lastRs("strIncorResponse2") Times = 0 end if end if 'Display the question If not rs.EOF then response.write ("
") response.write ("
"&msg&"
") response.write ("
") response.write ("

QUESTION #"&rs("ID")&"

") response.write ("
") response.write ("

"&rs("strQuestion")&"

") response.write ("

"&trim(rs("strAnswer1"))&"
") response.write (""&trim(rs("strAnswer2"))&"
") response.write (""&trim(rs("strAnswer3"))&"

") response.write ("
SubmitVisit the Web site to find out
") response.write ("
") 'Display the last message withtout question else response.write ("
"&msg&"

") response.write ("Thanks for playing! You got "& Total &" out of 7 answers correct.

Play Again
") end if 'close all rs.close lastRs.close conn.close set lastRs=nothing set rs=nothing set conn=nothing %>
Photography by Russ Kendall