<%@ LANGUAGE="VBSCRIPT" %> <% Response.Buffer = True strPageTitle = "Math Hunt Questions" strPageURL = "PlayGame.asp" call ReqestAllFields() If Not(IsNumeric(QuizID)) then Response.Redirect("index.asp") Else QuizID = Int(QuizID) End If 'response.write ("" &CurQuestion&"
") 'response.write ("" &tries&"
") 'response.write ("" &score&"
") 'response.write ("" &request.cookies("tookQuiz")&"
") 'response.write ("" &oldQID&"
") endMsg = "Sorry, you've already answered that question. This game is over!" tookMsg= "Sorry, you've already answered that question. Try your luck on this next challenge:" oldQID=GetQID(CurQuestion,AllQuestion) strSQL = "SELECT * FROM MH_Questions WHERE QuizID = " & QuizID &" AND QuestionID="& oldQID Set rsQuestion = Network.execute(strSQL) 'response.write strSQL 'response.end If rsQuestion.EOF then Response.Redirect("index.asp") Else Answer1 =rsQuestion("Answer1") Answer2 =rsQuestion("Answer2") Answer3 =rsQuestion("Answer3") Response1 =rsQuestion("Response1") Response2 =rsQuestion("Response2") Response3 =rsQuestion("Response3") AnswerText =rsQuestion("AnswerText") End If set rsQuestion=nothing tookQuiz=request.cookies("tookQuiz") overQuiz=request.cookies("overQuiz") if overQuiz ="over" then CurQuestion=6 if answer="" then if CurQuestion="1" then strMessage="Welcome to the Hunt. Here's your first question." facelogo="webgo.gif" end if else if instr(tookQuiz,oldQID) < 1 then if answer <> Answer1 then tries=tries + 1 facelogo="oopsweb.gif" if tries < 2 then if answer = Answer2 then strMessage=Response2 elseif answer = Answer3 then strMessage=Response3 end if elseif tries=2 then 'show next question with previous question's answer strMessage=AnswerText CurQuestion=CurQuestion+1 tries=0 response.cookies("tookQuiz")=tookQuiz+ oldQID + "|" end if elseif answer = Answer1 then facelogo="yayweb.gif" if tries=0 then Score=Score + 20 curScore=20 elseif tries=1 then Score=Score + 15 curScore=15 end if response.cookies("tookQuiz")=tookQuiz+ oldQID + "|" CurQuestion=CurQuestion+1 tries=0 strMessage=Response1 & "! That answer wins you "&curScore&" points!" end if else CurQuestion=CurQuestion+1 tries=0 strMessage=tookMsg facelogo="webgo.gif" end if end if %> <% if (URI="") then URI=Request.ServerVariables("SCRIPT_NAME") queryString = Request.ServerVariables("QUERY_STRING") if(trim(queryString)<>"") then URI = URI&"?"&queryString end if end if doMenu(URI) %>

Math Hunt
  <% = Title%>
  <% = Score%>
<% = Title%>
<% response.write (""&strMessage&"") response.write ("") if CurQuestion < 6 then NewQID=GetQID(CurQuestion,AllQuestion) strSQL = "SELECT * FROM MH_Questions WHERE QuizID = " & QuizID &" AND QuestionID="& NewQID Set rsQuestion = Network.execute(strSQL) 'response.write strSQL 'response.end If rsQuestion.EOF then Response.Redirect("index.asp") Else QuestionID =rsQuestion("QuestionID") Question =rsQuestion("Question") BodyText =rsQuestion("BodyText") Answer1 =rsQuestion("Answer1") Answer2 =rsQuestion("Answer2") Answer3 =rsQuestion("Answer3") AnswerText =rsQuestion("AnswerText") TargetURL =rsQuestion("TargetURL") End If set rsQuestion=nothing set Network=nothing response.write ("

"&BodyText&"

") %>
NAME="Score"> NAME="CurQuestion"> name="tries"> name="AllQuestion">

<% = Question %>


<%=Answer1%>
<%= Answer2%>
<%=Answer3%>
<%else response.cookies("overQuiz")="over" response.write "

" & EndMessage response.write "!

Your score:
" & Score & " points out of 100

" response.write "

Play More Hunts

" end if %>

This game includes links outside of Scholastic.com
Every Web site we link to was visited by our team at one point in time to make sure it's appropriate for children. But we do not monitor or control these sites and these sites can change. In addition, many of these sites may have links to other sites which we have not reviewed. Be sure to get permission from your parents or teacher before leaving this site, and remember to read the Privacy Policy and Terms of Use of any site you visit.

   
<% doFooter %>