Using ASP to Capture results from a Quiz
October 14, 2005 12:00 AM
Dear All,I've been working with the excellent documentation for capturing results from a quiz and outputting it via ASP to an Access database. It's been very successful , until I try to capture the Question, Answer and CorrectAnswer variables to my database . I can get an individual question and store it, but have problems when trying to capture ALL variables. I've copied my code below if anyone can give me any pointers as to where i'm going wrong.Cheers!<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%><%Option Explicit%><% Dim rsUser Dim strSql Dim i Dim varQuestion Dim varUsersAnswer Dim varCorrectAnswer Dim theQuestion Dim theUsersAnswer Dim theCorrectAnswer Dim testname Dim score Dim username Dim numQuestions Dim passingGrade Dim trueFalse Dim multipleChoice Dim Question(100) Dim Answer(100) Dim CorrectAnswer(100) username=Request.form("Name")undefined testname=Request.form("TestNam e") passingGrade=Request.form("Pas singGrade") numQuestions=Request.form("Num Questions") score=Request.form("Score") For i = 1 to cInt(numQuestions) Question(i) = Request.form("Question" undefined rsUser("username") = username rsUser("testname") = testname rsUser("passinggrade") = passinggrade rsUser("numquestions") = numquestions rsUser("score") = score For i = 1 to cInt(numQuestions) rsUser("Question" & i) = Question(i) rsUser("Answer" & i) = Answer(i) rsUser("CorrectAnswer" & i) = Answer(i) next rsUser.Update rsUser.Close Set rsUser = Nothing CloseConn()%>
Discussions have been disabled for this post