home *** CD-ROM | disk | FTP | other *** search
/ sau9.org / sau9.org.zip / sau9.org / mathapp / dec_check.asp < prev    next >
Text File  |  2002-12-05  |  7KB  |  242 lines

  1. <HTML>
  2. <head>
  3. <title> Decimal Addition and Subtraction Check
  4. </title>
  5. </HEAD>
  6. <body>
  7.  
  8. <table width="90%" border="0">
  9.   <tr>
  10.     <td><font face="Arial"> <font size="6">Results of Addition and Subtraction of Decimals <br> Knowledge Check <br>
  11.        </font></font></td>
  12.     <td>
  13.       <div align="center"><img src="math.gif" width="177" height="141"></div>
  14.     </td>
  15.     
  16.   </tr>
  17. </table>
  18. <%
  19. Dim csdQues, intQues, intResp
  20. idStudent=request ("idStudent")
  21. intQues=request("intQues")
  22. intStart=request ("intStart")
  23. level=request("level")
  24. difficulty=request("difficulty")
  25.  
  26. filePath = Server.MapPath("math_proj.mdb")
  27. set csdCheck=server.createobject("adodb.connection")
  28. csdCheck.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & filePath
  29. sql_error="Select idStudent, cntPlaceAttempt, cntOPerBAttempt, cntOperIAttempt, cntOperAAttempt from tblPerformance where idStudent="
  30. sql_error=sql_error & idStudent
  31. set csdErrCheck=csdCheck.execute (sql_error)
  32.  
  33. if csdErrCheck("cntPlaceAttempt")>=3 then
  34.     Response.write "Please contact your teacher, you have tried this module three times!"
  35.  
  36.     else
  37. set csdConn=server.createObject("ADODB.connection")
  38. csdConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & filePath
  39.  
  40.  
  41. intThisBank= intQues - intstart +1
  42. intCorrect=0
  43. for intResp = intStart to intQues
  44. sql_query="SELECT IdQNum, txtlevel, numSet, txtQuestion, valAnswer FROM tblOperationQues WHERE IDQNum="
  45. sql_query=sql_query & intResp 
  46. set csdQues=csdConn.execute (sql_query)
  47. resp="StuAns" & intResp
  48.  
  49. stuAns = request (resp)
  50.  
  51.     if stuAns=csdQues("valAnswer") then
  52. intCorrect=intCorrect+1
  53. intNumQuestions=intNumQuestions +1
  54.     end if
  55. next
  56.     csdConn.close
  57. set csdConn=nothing
  58.     end if
  59.  
  60.     if csdErrCheck("cntOperBAttempt")>=3 then
  61. Response.write "Please contact your teacher, you have tried this module three times!"
  62. else
  63. set csdConn=server.createObject("ADODB.connection")
  64. csdConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & filePath
  65.  
  66.  
  67. intThisBank= intQues - intstart +1
  68. intCorrect=0
  69. for intResp = intStart to intQues
  70. sql_query="SELECT IdQNum, txtlevel, numSet, txtQuestion, valAnswer FROM tblOperationQues WHERE IDQNum="
  71. sql_query=sql_query & intResp 
  72. set csdQues=csdConn.execute (sql_query)
  73. resp="StuAns" & intResp
  74.  
  75. stuAns = request (resp)
  76.  
  77.     if stuAns=csdQues("valAnswer") then
  78. intCorrect=intCorrect+1
  79. intNumQuestions=intNumQuestions +1
  80.     end if
  81.     next
  82. csdConn.close
  83. set csdConn=nothing
  84. end if
  85.  
  86. if csdErrCheck("cntOperIAttempt") >=3 then
  87. Response.write "<font face=tahoma>Please contact your teacher, you have tried this module three times!"
  88. else
  89. set csdConn=server.createObject("ADODB.connection")
  90. csdConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & filePath
  91.  
  92.  
  93. intThisBank= intQues - intstart +1
  94. intCorrect=0
  95. for intResp = intStart to intQues
  96. sql_query="SELECT IdQNum, txtlevel, numSet, txtQuestion, valAnswer FROM tblOperationQues WHERE IDQNum="
  97. sql_query=sql_query & intResp 
  98. set csdQues=csdConn.execute (sql_query)
  99. resp="StuAns" & intResp
  100.  
  101. stuAns = request (resp)
  102.  
  103. if stuAns=csdQues("valAnswer") then
  104. intCorrect=intCorrect+1
  105. intNumQuestions=intNumQuestions +1
  106. end if
  107. next
  108. csdConn.close
  109. set csdConn=nothing
  110. end if
  111.  
  112. if csdErrCheck("cntOperAAttempt") >=3 then
  113. Response.write "Please contact your teacher, you have tried this module three times!"
  114. else
  115. set csdConn=server.createObject("ADODB.connection")
  116. csdConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & filePath
  117.  
  118.  
  119. intThisBank= intQues - intstart +1
  120. intCorrect=0
  121. for intResp = intStart to intQues
  122. sql_query="SELECT IdQNum, txtlevel, numSet, txtQuestion, valAnswer FROM tblOperationQues WHERE IDQNum="
  123. sql_query=sql_query & intResp 
  124. set csdQues=csdConn.execute (sql_query)
  125. resp="StuAns" & intResp
  126.  
  127. stuAns = request (resp)
  128.  
  129. if stuAns=csdQues("valAnswer") then
  130. intCorrect=intCorrect+1
  131. intNumQuestions=intNumQuestions +1
  132. end if
  133. next
  134. csdConn.close
  135. set csdConn=nothing
  136. end if
  137.  
  138.  
  139. set csdConn1=server.createObject("ADODB.connection")
  140. csdConn1.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & filePath
  141. sql_attempt= "Select intStatus, cntOperBAttempt, cntoperIattempt, cntoperAAttempt from tblPerformance where idStudent="
  142. sql_attempt=sql_attempt & idStudent
  143.  
  144. 'response.write sql_attempt & "<br>"
  145.  
  146. set csdAttempt=csdConn1.execute (sql_attempt)
  147.  
  148. intStatus=csdAttempt("intStatus")
  149. strdifficulty="cntOper" & difficulty & "Attempt"
  150. cntlevelAttempt=csdAttempt(strdifficulty) +1
  151.  
  152. response.write "<font face=tahoma><br> Your score was <b>"
  153. response.write intCorrect
  154. response.write " </b>out of <b>"
  155.  
  156. response.write intthisbank
  157. response.write "</b>."
  158.  
  159. If cntlevelAttempt <4 then
  160.  
  161. if intCorrect >= 4 then
  162.     intStatus=intStatus + 1
  163.     
  164. select case difficulty
  165.     case "B"
  166.      difficulty="I"
  167. strpage="dec_level"& difficulty &".asp"
  168.     response.write "<p><form action="
  169.     response.write strPage & " method=post><font face=tahoma>You have mastered this section please"
  170.     response.write " <input type=hidden name=idStudent value="
  171.     response.write  idStudent & ">"
  172.     response.write "<input type=hidden name=level value='1'>" 
  173.     response.write "<input type=hidden name=difficulty value='"
  174.     response.write difficulty & "'><input type=submit value='Continue!'>"
  175.     response.write "</form>"
  176.  
  177.     case "I"
  178.      difficulty="A"
  179.  
  180. strpage="dec_level"& difficulty &".asp"
  181.     response.write "<p><form action="
  182.     response.write strPage & " method=post><font face=tahoma>You have mastered this section please"
  183.     response.write " <input type=hidden name=idStudent value="
  184.     response.write  idStudent & ">"
  185.     response.write "<input type=hidden name=level value='1'>" 
  186.     response.write "<input type=hidden name=difficulty value='"
  187.     response.write difficulty & "'><input type=submit value='Continue!'>"
  188.     response.write "</form>"
  189.  
  190.     case "A"
  191.     response.write "<br>Congratulations you have completed all the decimal addition modules!"
  192.     response.write "</html> "
  193.  
  194.      
  195. end select    
  196. set csdConn=server.createObject("ADODB.connection")
  197. csdConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & filePath
  198.  
  199. sql= "UPDATE tblperformance SET intStatus="
  200. sql=sql & intStatus & "," & strdifficulty &"="
  201. sql=sql & cntlevelAttempt
  202. sql=sql & " WHERE idStudent="
  203. sql=sql & idStudent
  204.  
  205. csdConn.execute (sql)
  206.  
  207.  
  208. else
  209. filePath = Server.MapPath("math_proj.mdb")
  210. set csdConn=server.createObject("ADODB.connection")
  211. csdConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & filePath
  212.  
  213. sql= "UPDATE tblperformance SET "
  214. sql=sql & strdifficulty & "="
  215. sql=sql & cntlevelAttempt
  216. sql=sql & " WHERE idStudent="
  217. sql=sql & idStudent
  218.  
  219. csdConn.execute (sql)
  220.  
  221. level=level + 1
  222.  
  223.  
  224.  
  225.  
  226.     response.write "<form action="
  227.     response.write "dec_level" & difficulty & ".asp method=post><input type=hidden name=level value="
  228.     response.write level
  229.     response.write "><input type=hidden name=idStudent value="
  230.     response.write idStudent
  231.     response.write "> <input type=hidden name=difficulty value="
  232.     response.write difficulty & "> <p>Sorry, you have not yet mastered the concepts of place value. <p>Choose <a href=dec_add.asp> review</a> to review the concepts of place value or <input type=submit value='try again'> for another set of questions."
  233.  
  234. 'end if
  235. end if
  236. else
  237. Response.write "<font face=tahoma><br>Please contact your teacher, you have tried this module three times!"
  238. end if
  239. %>
  240.  
  241.  
  242.