if isempty(Session("StudentID")) then
  Response.Redirect "../index.asp"
end if
if isempty(Request.Form("QuizID")) then
  Response.Redirect "../index.asp"
end if

set conn = server.createobject ("adodb.connection")
conn.open "ASPBook", "sa", "twojehaso"
set RSQuiz = conn.execute ("SELECT CourseID, QuizName,
CorrectToPass " _
  & "From OCQuizzes where QuizID = " & Request.Form("QuizID"))
NumberCorrect = 0
for each Question in Request.Form
  if Question <> "TestIt" then
    set RSQuestion = conn.Execute("select QuizAnswer from " _
      & "OCQuizQuestions where QuizQuestionID = " _
      & Question)
    if Request.Form(Question) = RSQuestion("QuizAnswer") then
      NumberCorrect=NumberCorrect + 1
    end if
  end if
next