Quizzer 1 1.0.01 Beta (for testing only)

Snitz™ Forums 2000
https://forum.snitz.com/forumTopic/Posts/63931?pagenum=1
05 November 2025, 01:44

Topic


cripto9t
Quizzer 1 1.0.01 Beta (for testing only)
04 February 2007, 15:27


Quizzer1 1.0.01 Beta for testing only.
Download - Right Click and Save
Tested on Snitz 3.4.6 with a mySql db.
Snitz users are needed to download and test my quiz mod for snitz. It's an add-on, meaning there are very few changes to the original forum code. It is also a very easy install, just a few new files to add to your forum folder and a database update to add the quiz tables.
I would like to get the existing features tested and working properly before I try to add anymore. I will try to update the zip once a week until a final release is reached.
Feedback, suggestions and constructive criticism are welcome.
I'll post Updates Here

Updates
  • 2/4/07 - 1.0.0 Beta (Initial Release)
  • 2/5/07 - 1.0.01 Beta (Update for my friends with access)
Notes
  • This version of the quiz Quizzer 1 does not and will not record members score. That will be for Quizzer 2.
  • There is no test forum

Quiz Description
  • Features
    • Admin on/off switch
    • Unlimited questions and choices with admin control
    • Multiple choice and true/false quiz options
    • Admins and/or Moderators write quizzes (admin control)
    • "Members only" or "all vistors" option with Admin control

    • Retake time limits with Admin control (uses cookies)

    • Random questions with Admin control

    • Option to show corrected answers after grading

    • Records number of entries, hi-score, average score and last date taken for each quiz

    • Active Quiz Page

    • Use forum code in questions and answers

    • "Save quiz as draft" option
    • Quiz Archive
    • A very primitive attempt at question templates


  • Wish List

    • Topic Quizzes
    • Member Input Questions

    • Essay Questions
    • Quiz Categories

    • Real Question Templates

    • Question Paging

    • Printer Friendly


<

 

Replies ...


runsh
04 February 2007, 16:26


Thanks for the mod. I installed the mod but have problem making quizes active. on admin I turned quizes on several time but it resets to off.
I use access db. I use 3.4.06 version. any idea why
<
cripto9t
04 February 2007, 16:53


Did you make the changes from the read-me in "config.asp"?<
runsh
04 February 2007, 17:37


yes I did. I'll try with fresh copy of snitz again.<
runsh
04 February 2007, 18:11


I installed a new copy of forum and added the mod. now it truns quiz on but when try to access active quizzes I get this error:
Microsoft JET Database Engine error '80040e14'

Join expression not supported.

/froumq/quiz_active.asp, line 72
<
cripto9t
04 February 2007, 18:16


Also I forgot to ask , did you install the table in admin options>mod setup? If you did look in admin options >forum variables and look for the quiz variables in the list. They start with "STRQUIZ" and make sure they are listed. If not try running the Database update again.
I might not be around for the rest of the night. The Super Bowl is about to start.
GO COLTS!!!!!!!!!!<
runsh
04 February 2007, 19:25


yes setup is fine, is listed in variable. I think there is a problem with generated tables in db, look at this image from generated db table!!

<
runsh
04 February 2007, 19:51


Microsoft JET Database Engine error '80040e14'

Join expression not supported.

/froumq/quiz.asp, line 81
<
runsh
05 February 2007, 00:49


is probably something related to access db . I google it and found similar problem but don't know how to fix it.

http://www.thescripts.com/forum/thread189027.html

http://www.experts-exchange.com/Databases/MS_Access/Q_21239773.html<
cripto9t
05 February 2007, 07:08


runsh, in "quiz_active.asp" replace this code
Code:
strSql = "SELECT QUIZ_ID, Q_AUTHOR, Q_TITLE, Q_DATE, Q_STATUS, Q_TYPE, Q_QUESTIONS, Q_ENTRIES, Q_HISCORE, Q_ACED, Q_AVERAGE, Q_LAST_QUIZ, Q_RETAKE, Q_ANON, Q_RANDOM, Q_RANDOM_QUESTIONS, M_NAME, Q_DESCRIPTION" & _
" FROM " & strTablePrefix & "QUIZ" & _
" LEFT JOIN " & strTablePrefix & "MEMBERS" & _
" ON Q_AUTHOR = MEMBER_ID" & _
" WHERE Q_STATUS = " & PageView
if PageView = 0 then strSql = strSql & " AND Q_AUTHOR = " & MemberID
strSql = strSql & " ORDER BY QUIZ_ID DESC;"
With this
Code:
strSql = "SELECT QUIZ_ID, Q_AUTHOR, Q_TITLE, Q_DATE, Q_STATUS, Q_TYPE, Q_QUESTIONS, Q_ENTRIES, Q_HISCORE, Q_ACED, Q_AVERAGE, Q_LAST_QUIZ, Q_RETAKE, Q_ANON, Q_RANDOM, Q_RANDOM_QUESTIONS, M_NAME, Q_DESCRIPTION" & _
" FROM " & strTablePrefix & "QUIZ, " & strMemberTablePrefix & "MEMBERS" & _
" WHERE Q_STATUS = " & PageView & " AND Q_AUTHOR = MEMBER_ID"
if PageView = 0 then strSql = strSql & " AND Q_AUTHOR = " & MemberID
strSql = strSql & " ORDER BY QUIZ_ID DESC;"
Let me know if it works. I want this to work all around.<
cripto9t
05 February 2007, 08:43


I have no way to test with access. Does anyone with access knowledge see why the first query above would get that error?
strTablePrefix should be strMemberTablePrefix - That might be the problem if the prefix was changed in config.asp.<
AnonJr
05 February 2007, 09:49


Don't know, but I'll give it a shot later today.<
runsh
05 February 2007, 10:48


Now it gives this error
Microsoft VBScript runtime error '800a005e'
Invalid use of Null: 'cSng'
/froumq/quiz_active.asp, line 339


and when I add quiz it gives this error

Microsoft JET Database Engine error '80004005'

The field 'FORUM_QUIZ.Q_RANDOM_QUESTIONS' cannot contain a
Null value because the Required property for this field is
set to True. Enter a value in this field.

/froumq/quiz_post.asp, line 255
<
runsh
05 February 2007, 11:00


I think this part in quiz.asp also should be change, gives error:

'## Quiz Page Sql
strSql = "SELECT QUIZ_ID, Q_AUTHOR, Q_TITLE, Q_DATE, Q_STATUS, Q_QUESTIONS, Q_CHOICES, Q_TEMPLATE, Q_ENTRIES, Q_RETAKE," & _
" Q_RANDOM_QUESTIONS, Q_RANDOM, Q_ANON, M_NAME, Q_DESCRIPTION" & _
" FROM " & strTablePrefix & "QUIZ Q" & _
" LEFT JOIN " & strTablePrefix & "MEMBERS" & _
" ON Q_AUTHOR = MEMBER_ID" & _
" WHERE QUIZ_ID = " & QuizID '& " AND Q_STATUS = 1"


this is the error
Microsoft JET Database Engine error '80040e14'

Join expression not supported.

/froumq/quiz.asp, line 81
<
cripto9t
05 February 2007, 12:04


runsh, in "quiz_active.asp" find this function at the bottom of the page
Code:
function getAverage(qa)
dim arrAvg, lAvg, uAvg

arrAvg = split((cSng(qa) * 100),".")
lAvg = arrAvg(0)
'uAvg = arrAvg(1)

'if cLng(left(uAvg,1)) > 5 then
' lAvg = cLng(lAvg) + 1
'end if

'lAvg = lAvg & "%"

getAverage = lBound(arrAvg)
end function
replace it with this
Code:
function getAverage(qa)
dim tmpStr

tmpStr = cInt(qa * 100)
tmpStr = tmpStr & "%"

getAverage = tmpStr
end function
I think that will take care of one error smile. I'll look at the null error now<
cripto9t
05 February 2007, 12:42


For the random question error, in quiz_post.asp find this code around line 130
Code:

                if strQuizRandom = "1" and intRandom > 0 then
if chkInput(Request.Form("Quiz_RandomQuestions")) = 1 then
getRandomQuestions = 1
intRandomQuestions = cLng(Request.Form("Quiz_RandomQuestions"))
end if
else
getRandomQuestions = 0
end if
replace it with this
Code:

                if chkInput(Request.Form("Quiz_RandomQuestions")) = 1 then
intRandomQuestions = cLng(Request.Form("Quiz_RandomQuestions"))
end if
And fin d this around line 220
Code:
                        '## Add quiz info to quiz table
strSql = "INSERT INTO " & strTablePrefix & "QUIZ" & _
" (Q_AUTHOR" & _
", Q_TITLE" & _
", Q_DESCRIPTION" & _
", Q_DATE" & _
", Q_STATUS" & _
", Q_TYPE" & _
", Q_QUESTIONS" & _
", Q_CHOICES" & _
", Q_TEMPLATE" & _
", Q_CORRECTIONS" & _
", Q_RETAKE" & _
", Q_ANON" & _
", Q_RANDOM"
if getRandomQuestions = 1 then strSql = strSql & ", Q_RANDOM_QUESTIONS"
strSql = strSql & ") VALUES (" & _
"" & MemberID & _
", '" & strTitle & "'" & _
", '" & strDescription & "'" & _
", '" & dateToStr(strForumTimeAdjust) & "'" & _
", " & intStatus & _
", " & intType & _
", " & Q_Cnt & _
", " & intChoices & _
", '" & strTemplate & "'" & _
", " & intCorrections & _
", " & intRetake & _
", " & intAnon & _
", " & intRandom
if getRandomQuestions = 1 then
if intRandomQuestions > Q_Cnt then
strSql = strSql & ", " & Q_Cnt
else
strSql = strSql & ", " & intRandomQuestions
end if
end if
strSql = strSql & ")"
Replace that with this
Code:
                        '## Add quiz info to quiz table
strSql = "INSERT INTO " & strTablePrefix & "QUIZ" & _
" (Q_AUTHOR" & _
", Q_TITLE" & _
", Q_DESCRIPTION" & _
", Q_DATE" & _
", Q_STATUS" & _
", Q_TYPE" & _
", Q_QUESTIONS" & _
", Q_CHOICES" & _
", Q_TEMPLATE" & _
", Q_CORRECTIONS" & _
", Q_RETAKE" & _
", Q_ANON" & _
", Q_RANDOM" & _
", Q_RANDOM_QUESTIONS" & _
") VALUES (" & _
"" & MemberID & _
", '" & strTitle & "'" & _
", '" & strDescription & "'" & _
", '" & dateToStr(strForumTimeAdjust) & "'" & _
", " & intStatus & _
", " & intType & _
", " & Q_Cnt & _
", " & intChoices & _
", '" & strTemplate & "'" & _
", " & intCorrections & _
", " & intRetake & _
", " & intAnon & _
", " & intRandom
if intRandomQuestions > Q_Cnt then
strSql = strSql & ", " & Q_Cnt
else
strSql = strSql & ", " & intRandomQuestions
end if
strSql = strSql & ")"
<
cripto9t
05 February 2007, 12:56


Originally posted by runsh
I think this part in quiz.asp also should be change, gives error:

'## Quiz Page Sql
strSql = "SELECT QUIZ_ID, Q_AUTHOR, Q_TITLE, Q_DATE, Q_STATUS, Q_QUESTIONS, Q_CHOICES, Q_TEMPLATE, Q_ENTRIES, Q_RETAKE," & _
" Q_RANDOM_QUESTIONS, Q_RANDOM, Q_ANON, M_NAME, Q_DESCRIPTION" & _
" FROM " & strTablePrefix & "QUIZ Q" & _
" LEFT JOIN " & strTablePrefix & "MEMBERS" & _
" ON Q_AUTHOR = MEMBER_ID" & _
" WHERE QUIZ_ID = " & QuizID '& " AND Q_STATUS = 1"


this is the error
Microsoft JET Database Engine error '80040e14'

Join expression not supported.

/froumq/quiz.asp, line 81

i seen this one coming :)
replace it with this
Code:
'## Quiz Page Sql
strSql = "SELECT QUIZ_ID, Q_AUTHOR, Q_TITLE, Q_DATE, Q_STATUS, Q_QUESTIONS, Q_CHOICES, Q_TEMPLATE, Q_ENTRIES, Q_RETAKE," & _
" Q_RANDOM_QUESTIONS, Q_RANDOM, Q_ANON, M_NAME, Q_DESCRIPTION" & _
" FROM " & strTablePrefix & "QUIZ, " & strTablePrefix & "MEMBERS" & _
" WHERE QUIZ_ID = " & QuizID & " AND Q_AUTHOR = MEMBER_ID"
I'm going to keep looking for a reason the left join isn't working.<
MaD2ko0l
05 February 2007, 13:38


quiz edit

error when editing

Microsoft JET Database Engine error '80040e14'

Join expression not supported.

/snitzquizzer/quiz_edit.asp, line 148



fix, find lines 139 - 146, which is this:

Code:

'write sql 
strSql = "SELECT Q_TITLE, Q_TYPE, Q_QUESTIONS, Q_CHOICES"
if Action_Type = "QuizEdit" then strSql = strSql & ", Q_RETAKE, Q_ANON, Q_CORRECTIONS, Q_RANDOM, Q_RANDOM_QUESTIONS"
strSql = strSql & ", M_NAME, Q_DESCRIPTION" & _
" FROM " & strTablePrefix & "QUIZ" & _
" LEFT JOIN " & strMemberTablePrefix & "MEMBERS" & _
" ON Q_AUTHOR = MEMBER_ID" & _
" WHERE QUIZ_ID = " & QuizQuizID


replace with this

Code:

'write sql 
strSql = "SELECT Q_TITLE, Q_TYPE, Q_QUESTIONS, Q_CHOICES"
if Action_Type = "QuizEdit" then strSql = strSql & ", Q_RETAKE, Q_ANON, Q_CORRECTIONS, Q_RANDOM, Q_RANDOM_QUESTIONS"
strSql = strSql & ", M_NAME, Q_DESCRIPTION" & _
" FROM " & strTablePrefix & "QUIZ, " & strTablePrefix & "MEMBERS" & _
" WHERE QUIZ_ID = " & QuizID & " AND Q_AUTHOR = MEMBER_ID"
<
MaD2ko0l
05 February 2007, 13:39


also i did not have to change the getAverage function to make this work.<
MaD2ko0l
05 February 2007, 13:42


question...
why archive a quiz if you cannot see the questions/answer??? im sure u should be able to view the questions and correct answers if it has been archived<
cripto9t
05 February 2007, 14:09


Originally posted by MaD2ko0l
question...
why archive a quiz if you cannot see the questions/answer??? im sure u should be able to view the questions and correct answers if it has been archived
Ah but you can see it when you edit it.
Its just something I thought would come in handy for an old quiz that you might want to reactivate at a later date.
I need to fix the title link so that it points to archives.<
cripto9t
05 February 2007, 14:15


Originally posted by MaD2ko0l
also i did not have to change the getAverage function to make this work.
I think that has something to do with the server. I wasn't getting an error either with iis.
But you need to change that function because it doesnt work :). If youll notice it returns 0 every time.<
runsh
05 February 2007, 14:24


cripto9t quiz_active.asp gives same error. but now when making quiz and taking it, everything seems to be working fine except can't get to active quizzes page.

By the way is it possible to make an option for displaying one question at a time vs all question appearing in the same page.
also down the road maybe adding a timer for taking quiz would be nice. thanks<
cripto9t
05 February 2007, 14:27


I'm going to go through and change all the outer joins to inner joins. The reason I wanted the left join is in case a member has written a quiz
and the member is deleted in the future.
I know snitz doesnt delete the Member if they have posts it just updates them to n/a.
But if they don't have posts, they get deleted and that would put the quiz in limbo.<
runsh
05 February 2007, 14:27


Sorry I just notice the error is little different:

Microsoft VBScript runtime error '800a005e'
Invalid use of Null: 'cInt'

/froumq/quiz_active.asp, line 339
<
cripto9t
05 February 2007, 14:46


Originally posted by runsh
Sorry I just notice the error is little different:

Microsoft VBScript runtime error '800a005e'
Invalid use of Null: 'cInt'

/froumq/quiz_active.asp, line 339

I was just getting ready to ask that ;) I'll give it another look.<
cripto9t
05 February 2007, 15:01


runsh find this around line 234
Code:
QuizPercent = getAverage(QuizAverage)
replace it with this
Code:

                if isNull(QuizAverage) or trim(QuizAverage) = "" then
QuizPercent = ""
else
QuizPercent = getAverage(QuizAverage)
end if
I hope that works<
runsh
05 February 2007, 15:26


now is getting this error:
<
runsh
05 February 2007, 15:42


sorry after posting above I put a fresh database and installed mod again, now seems to be working fine. I haven't noticed any error yet. I'll keep testing it.
Thanks for the mod is very nice. hope you can imporve it and add more feature.<
cripto9t
05 February 2007, 16:09


Thanks for the help runsh. The question paging is on my todo list. time limits would be great. I looked at a few quizzes with time limits, but they weren't implemented very well and I can't think of a good way to do it other than maybe javascript.<
AnonJr
05 February 2007, 16:11


I didn't really get a chance to check it out today, but my goal for this week is to see if I can use the record keeping code I'm using in my current online testing code for this since this has some of the features I was looking to add. smile
Here's hoping they leave me alone long enough to try....<
runsh
05 February 2007, 16:20


cripto9t check your email.<
cripto9t
05 February 2007, 17:29


runsh reply sent

Anon and anyone else interested in this, I updated the zip.
Thanks to runsh and M2k it should cut down on the access error messages smile. Just replace all the files with the new ones, except for the ones in the includes folder I don't think I touched them. <
MaD2ko0l
05 February 2007, 18:19


i will have a look at it a bit later and see if i can find anymore errors...apart from the few problems already spotted the quizzer seems to work great, probly when you have implamented the user tracking to see peoples scores, this could be used with the points mod. just an idea :-)<
runsh
06 February 2007, 00:20


minor point
line between first and second question is missing. <
AnonJr
06 February 2007, 16:40


Got some odd problems, but with so much other custom code it could just be me...
However, I noticed that when you reference the MEMBERS table you are using strTablePrefix, when it should be strMemberTablePrefix - "out of the box" they are the same, and rarely does anyone ever change them... but some people do and it could cause problems.
Unfortunately, one of my co-workers is out sick so instead of programming I'm teaching classes.... hopefully I'll get to work on it some more later this week. =/<
runsh
06 February 2007, 16:46


is there a way to add categories to quizzer? all related quizzes in one CAT. i.e sports, etc..
<
AnonJr
06 February 2007, 16:54


One other small suggestion - provide a little more feedback when something errors out other than sending the user to default.asp ... I'm pulling up my new theme song - Metallica's The Frayed Ends of Sanity tongue<
cripto9t
06 February 2007, 18:15


Anon I noticed the table prefix thing yesterday and thought I had changed it in the update. It will be in the next update. As for the error messages, I had errors marked before I released it. I'll go through and put in the marks again for testing. You gotta admit the redirect thing is a pretty good deterrent smile. I tried to give admins and mods an error message instead, but I don't know if I covered all the bases.

runsh, Categories are on the todo list. Right know I'm working on question templates, and I think I've finally got something to build on.<
AnonJr
07 February 2007, 09:07


Cool. Hopefully I'll get to play with it some more this afternoon - I'm stuck in meetings all morning, starting in an hour. dead<
AnonJr
07 February 2007, 14:38


Found another interesting error... The reason it wasn't working yesterday is because I had Quiz Corrections turned off, but the WriteQuiz() is checking for the Quiz Corrections value even though that part of the form wasn't written out - since it was turned off.
I'm working on a fix...<
AnonJr
15 February 2007, 10:01


Hey Cripto9t, have you had much of a chance to work on this lately? I've been playing with the code some more and I like what you are doing. I'm trying to get your testing engine to interface with all the record keeping and reporting I built into my testing engine since I need those features along with what you've built into the testing bit. I'll let you know if I manage to get it working.
As to the other issue, I kinda cheated and did this:

Code:
                if strQuizCorrections = "1" then
Response.Write "<tr valign=""top"">" & vbNewLine & _
"<td class=""r""><b>Show Corrected Answers</b><br /><span class=""ffs"">Display this quiz with the corrections to members/visitors after quiz is graded. </span></td>" & vbNewLine & _
"<td>" & vbNewLine & _
" <input type=""radio"" name=""Quiz_Corrections"" value=""1"" checked /> Yes<br />" & vbNewLine & _
" <input type=""radio"" name=""Quiz_Corrections"" value=""0"" /> No" & vbNewLine & _
"</td>" & vbNewLine & _
"</tr>" & vbNewLine
Else
Response.Write "<tr valign=""top"">" & vbNewLine & _
"<td class=""r""><b>Show Corrected Answers</b><br /><span class=""ffs"">Display this quiz with the corrections to members/visitors after quiz is graded. </span></td>" & vbNewLine & _
"<td>" & vbNewLine & _
" <input type=""radio"" name=""Quiz_Corrections"" value=""1"" disabled /> Yes<br />" & vbNewLine & _
" <input type=""radio"" name=""Quiz_Corrections"" value=""0"" checked disabled /> No" & vbNewLine & _
"<input type=""hidden"" name=""Quiz_Corrections"" value=""0"" /></td>" & vbNewLine & _
"</tr>" & vbNewLine
end if

Please note, I've converted everything to work with the SB2 CSS that I've been using ever since I discovered that little gem.
Because I'm on a relatively short timetable (i.e. now or sooner) I'm tempted to just take what you've done, get done what I need to get done, and then giving you back what I've put together. But, I also don't want to fork the MOD or get things too far out of sync... you could do something absolutely brilliant and I want to make sure I don't go so far astray that I can't incorporate it. wink </rambling><
AnonJr
15 February 2007, 12:00


Found another bug - after deleting a question from an existing quiz, the number of questions isn't updated and creates a "Subscript out of range" error when trying to take the test.
I'll dig into the whys and whatfors and try to post a bug-fix.<
cripto9t
18 February 2007, 11:01


Anon, I havent been able to work on the quiz. Windows is freezing up on my testing machine. I did fix the corrections bug before I got the blue screen blues. I assign it a value after submission if none is found. replace this
Code:
                if chkInput(Request.Form("Quiz_Corrections")) = 1 then
intCorrections = cLng(Request.Form("Quiz_Corrections"))
else
call redirect()
end if
with this
Code:
                if strQuizCorrections = "1" then
if chkInput(Request.Form("Quiz_Corrections")) = 1 then
intCorrections = cLng(Request.Form("Quiz_Corrections"))
else
screwed_up "Form problem.","Quiz Corrections" 'call redirect()
end if
else
intCorrections = 0
end if

I'll give the last error a look and see if I can spot something.<
AnonJr
19 February 2007, 09:59


Cool. Let me know when you're back up and running. I'll keep hacking away at it. I'm hoping to be able to tie it into the record keeping code I wrote for our current testing engine.... I'll let you know how that goes.<
Etymon
08 July 2007, 21:40


I installed this MOD the other day and found it enjoyable to use.
I hope that there is continued development on it!
Very nice work! Great idea! Thank you for the code! Awesome potential!
Sincerely,

Etymon<
Netz
11 July 2007, 19:17


Year... Sounds cool... Waiting here for V2<
AnonJr
15 January 2008, 15:11


Hey cripto9t, since we both seem to have a resurgence of spare time, think this little wonder could get a little attention? wink

I haven't had much time to really dig in between when I last posted and now. Mostly I'd been looking at attaching it to my current record keeping structure. I've since decided to abandon the way I've been keeping records, and I've been looking at a new format. I'll let you know if I come up with anything remotely brilliant. tongue<
cripto9t
15 January 2008, 18:03


What are you, a mind reader question I just setup a new test forum to work on this smile. I did quite a bit of work on it last summer, but I got burnt out and quit. Now I feel like tackling it again. As always any and all ideas are welcome smile.<
© 2000-2021 Snitz™ Communications