PDA

View Full Version : vBQuiz 1.0


Pages : [1] 2 3 4 5

TWTCommish
06-10-2002, 10:00 PM
vBQuiz 1.0

NOTE: all functionality-impairing bugs have been fixed. The attached files should work well on just about any PHP installation.

What's it do?
It allows you to setup a quiz center on your boards quickly and easily. This quiz center is FULLY templated, integrated with vBulletin, and has an advanced Admin script for managing the quizzes, categories, and questions. Here's an example: Movie Forums - Quizzes (http://www.movieforums.net/quiz.php)

A few of its features... Tracks all results and displays high scores.
Upon completion, users are given a total quiz breakdown of the quiz, showing them how they fared on each question, and, on the ones they missed, showing them the correct answer.
Upon completion, users are shown a graphical bar representing their score, and a graphical bar representing the average score for the quiz. They are also emailed their information.
Main quiz page calculates and displays the easiest and most difficult quizzes automatically.
Quizzes can be split up into categories.
Quizzes can be approved or disapproved easily to add/remove them from public view/use.
Full integration with the Who's Online? page...IE: "Viewing Quizzes" or "Viewing So and So Quiz" and even "Taking So and So Quiz"Admin Abilities: Disallow multiple quiz takings.
Toggle to disinclude quiz results coming from the author of the quiz.
Change the display order of the answers to each question.
Add multiple questions and answers at once (no limit).Here are some screenshots: Main Quiz Page (http://www.movieforums.com/upload/vbquiz/quiz_main.jpg)
Quiz Display (http://www.movieforums.com/upload/vbquiz/quiz_display.jpg)
Quiz Category Display (http://www.movieforums.com/upload/vbquiz/quiz_category.jpg)
Quiz Question Display (http://www.movieforums.com/upload/vbquiz/quiz_question.jpg)
Quiz Results Page (http://www.movieforums.com/upload/vbquiz/quiz_results.jpg)
ADMIN: Quiz Options/Navigation (http://www.movieforums.com/upload/vbquiz/quiz_admin_nav.jpg)
ADMIN: Add Quiz (http://www.movieforums.com/upload/vbquiz/quiz_admin_addquiz.jpg)
ADMIN: Add Questions (http://www.movieforums.com/upload/vbquiz/quiz_admin_addquestions.jpg)
ADMIN: Delete Quiz (http://www.movieforums.com/upload/vbquiz/quiz_admin_deletequiz.jpg)
ADMIN: Modify Question (http://www.movieforums.com/upload/vbquiz/quiz_admin_modifyquestion.jpg)
ADMIN: Quiz Settings (http://www.movieforums.com/upload/vbquiz/quiz_admin_settings.jpg)That's it! Don't forget, however, to read ALL of the instructions.txt file in the enclosed vbquiz.zip file. It'll help guard against some common bugs.

Files Enclosed (in vbquiz.zip)
- instructions.txt (read it!)
- quiz.php (upload to main forum dir)
- admin_quiz.php (upload to admin dir)
- install_quiz.php (upload to admin dir and then run)

Enjoy!

Also: a HUGE, HUGE, HUGE thanks to GamerForums (https://vborg.vbsupport.ru/member.php?action=getinfo&userid=2931) for beta testing this hack for me. His help was completely invaluable and surely saved me a lot of work in the long run. Thanks! :)

firewars
06-11-2002, 01:36 PM
Very cool hack :D

TWTCommish
06-11-2002, 01:38 PM
Thanks. :) Took a LONG time to create. The quiz.php file is made up of almost 700 lines of code, the admin script is even longer, and the installation file was a pain, too. Whew!

Admin
06-11-2002, 01:39 PM
Nice and impressive, good job. :)
Yoda fought... :p

But... Your Score: 3 of 3 (99%)
;)

TWTCommish
06-11-2002, 01:41 PM
Yeah, I know, I noticed that this morning, but after a few weeks, over 40 templates, and 2,000+ lines of code (and TONS of debugging), I'm too tired to bother just now. LOL.

Floris
06-11-2002, 01:42 PM
Your Score: 3 of 3 (99%)

I think 100% is 100% is my world :)

VERY COOL HACK

Admin
06-11-2002, 01:47 PM
Just took a quick glance at the code, I think it's round() that's causing the problem (shouldn't use it; or at least use ceil()).

TWTCommish
06-11-2002, 01:48 PM
I'll use ceil() then...when using nothing I often found myself greeted by, well, very, very large decimal numbers. :D

Admin
06-11-2002, 02:04 PM
I can imagine.

dost
06-11-2002, 02:39 PM
can't you add a timer? like the user must answer the question in 30 seconds

TWTCommish
06-11-2002, 02:41 PM
Yeah, I can add a timer. But quite frankly this thing took so friggin' long to write that I just wanted it basically functional. I needed to get all the basics out of the way...easy administration and the like. Maybe in version 2.0.

Lesane
06-11-2002, 03:04 PM
Great hack 'TWTCommish', well done. I will install this one later. :up:

CloudSlash
06-11-2002, 03:22 PM
How can a user make a quiz?

zootsuit
06-11-2002, 03:30 PM
Just installed it and it looks awesome!

Thanks so much!!!

What a wonderful addition...this should definitely be included in vB3...no doubt!!!

:D

Boofo
06-11-2002, 03:55 PM
in my online.php, instead of this code:

global $thread, $post, $forum, $event, $gotforum, $hideprivateforums, $bbuserinfo, $timeformat, $enableemail, $enablepms, $bbtitle, $usergroupdef, $numberguests;


I have this code:

global $DB_site, $thread, $post, $forum, $event, $gotforum, $hideprivateforums, $bbuserinfo, $timeformat, $enableemail, $enablepms, $bbtitle, $usergroupdef, $numberguests, $onlineloc;


Since the only addition to that line that you said we should replace it with is the $DB_site, will what I have already work or will it intefere with it? Can $DB_site be used for more than one hack at a time? And will it work at the beginning of that line just fine with this hack :) I just want to be sure, is all. :)

TWTCommish
06-11-2002, 04:12 PM
Cloud: they can't actually add it. Only Admins can add quizzes. If a user writes a quiz for you, however, you can enter their userid to specify them as the author.

zoot: that's not too likely, but I'm very glad you like it. :) I sure had fun writing it.

Boofo: that should work just fine. :)

Boofo
06-11-2002, 04:14 PM
I just wanted to make sure nothing would interfere with anything else. I finally got things straightened out and I'd like to keep it that way. :) Thanks for the great hack and all of your hard work! :)

-=dm=-
06-11-2002, 04:16 PM
Wow Nice hack :)
does this work with 2.2.4?

thanx

Recluse
06-11-2002, 04:16 PM
im getting a blank page when going to the quiz.php

Boofo
06-11-2002, 04:18 PM
Is there any way to maybe be able to have questions with 4 possible answers instead of just yes or no? Like a multiple choice type thing? :)

TWTCommish
06-11-2002, 04:20 PM
dm: I've only tested it on 2.2.6 specifically, but I'll be shocked if it doesn't work well on earlier versions, seeing as how it's almost completely standalone.

Boofo: no, there's no support for multiple correct answers...again, maybe 2.0...it'd be tricky, but it's do-able. You can have more than two answers per question, though, of course. You can add as many as you want. Using it on my site, I have four answers for each question.

So, you can add as many possible answers as you like per question (you're not limited to true or false)...however, only one of them can be right.

Dark_Wizard
06-11-2002, 04:41 PM
Nice script...you are missing this variable though $mainquizlimit and I had to add it to the top ( $mainquizlimit="10"; ) of quiz.php to get it to work...I searched the new tables and don't see a setting for it and its not in the admin cp either...

TWTCommish
06-11-2002, 04:44 PM
It's near the bottom of the vBulletin Options page, just as the instructions.txt file details. :) You need to press the submit button once, I've found, to "confirm" that the data is there for it to work properly.

Dark_Wizard
06-11-2002, 04:57 PM
Thx...didn't see it....

Recluse
06-11-2002, 04:57 PM
i did that before :) still go the blank page

Smoothie
06-11-2002, 04:59 PM
will this work on older versions, 2.2.2?

Dark_Wizard
06-11-2002, 05:08 PM
Originally posted by Smoothie
will this work on older versions, 2.2.2?

It should..

-=dm=-
06-11-2002, 05:42 PM
ok just installed on 2.2.4 there wa no errors, it was very easy to install nice job :)

but now I only see blank page :( (I pressed the submit button )

TWTCommish
06-11-2002, 05:45 PM
I don't understand. Where do you see a blank page?

MrLister
06-11-2002, 05:59 PM
Very impressive. Great hack!!

-=dm=-
06-11-2002, 06:05 PM
Originally posted by TWTCommish
I don't understand. Where do you see a blank page?

www.mydomain.com/forums/quiz.php

hmm I dont know what Im doing wrong :(

TWTCommish
06-11-2002, 06:06 PM
It sounds to me like your templates were not created properly.

Xelation
06-11-2002, 06:13 PM
awsome hack, I will be installing this!

-=dm=-
06-11-2002, 06:15 PM
yeah TWTCommish u r right, I cant see any quiz template :(

what can I do now?(sit in the corner and cry) :(

TWTCommish
06-11-2002, 06:17 PM
Did you get any errors when you ran the install_quiz.php file? That's the file that inserts all the templates.

zachb
06-11-2002, 06:20 PM
Great hack TWT!! I love it. *Install*

-=dm=-
06-11-2002, 06:21 PM
No there was no errors, installed successfully.

TWTCommish
06-11-2002, 06:22 PM
Upload the file again and this time ONLY run the first step...that should create the templates. I guess it went funky on you for no apparent reason.

sphinx
06-11-2002, 06:26 PM
no errors installed very well done m8 very nice :up:

-=dm=-
06-11-2002, 06:28 PM
done!
thats strange, I dont see those templates anywhere.


"email_quizresults" template added sucessfully.
"email_quizresults_subject" template added sucessfully.
"error_quiz_alreadytaken" template added sucessfully.
"error_quiz_doubleanswer" template added sucessfully.
"error_quiz_doubleresult" template added sucessfully.
"error_quiz_invalid" template added sucessfully.
"quiz" template added sucessfully.
"quizbit" template added sucessfully.
"quiz_answerbit" template added sucessfully.
"quiz_author" template added sucessfully.
"quiz_category" template added sucessfully.
"quiz_categorybit" template added sucessfully.
"quiz_category_error" template added sucessfully.
"quiz_category_nav" template added sucessfully.
"quiz_category_nav_nextlink" template added sucessfully.
"quiz_category_nav_prevlink" template added sucessfully.
"quiz_display" template added sucessfully.
"quiz_display_allresultslink" template added sucessfully.
"quiz_display_bestresultbit" template added sucessfully.
"quiz_display_bestresults" template added sucessfully.
"quiz_display_bestresults_error" template added sucessfully.
"quiz_display_highscoreslink" template added sucessfully.
"quiz_display_latestresultbit" template added sucessfully.
"quiz_display_latestresults" template added sucessfully.
"quiz_display_latestresults_error" template added sucessfully.
"quiz_easiest_hardest" template added sucessfully.
"quiz_image" template added sucessfully.
"quiz_maincategorybit" template added sucessfully.
"quiz_menu" template added sucessfully.
"quiz_menubit" template added sucessfully.
"quiz_nav" template added sucessfully.
"quiz_nav_nextlink" template added sucessfully.
"quiz_nav_prevlink" template added sucessfully.
"quiz_none" template added sucessfully.
"quiz_others_error" template added sucessfully.
"quiz_others_resultbit" template added sucessfully.
"quiz_others_results" template added sucessfully.
"quiz_question" template added sucessfully.
"quiz_resultbit" template added sucessfully.
"quiz_results" template added sucessfully.
"quiz_scorebars" template added sucessfully.
"quiz_viewscorebit" template added sucessfully.
"quiz_viewscores" template added sucessfully.
"quiz_viewscores_error" template added sucessfully.
"quiz_viewscores_nav" template added sucessfully.
"quiz_viewscores_nextlink" template added sucessfully.
"quiz_viewscores_prevlink" template added sucessfully.


Im runing version 2.2.4

Dark_Wizard
06-11-2002, 06:28 PM
Hmmm...getting this error trying to take the quiz:

Fatal error: Unsupported operand types in /home/domain/public_html/gw/forums/quiz.php on line 350

Sigon
06-11-2002, 06:30 PM
I did the first step over again and nothing. This is reaaaaaly annoying me. :(

TalkHardRandy
06-11-2002, 06:31 PM
I'm getting the same error as Dark_Wizard - quizes are created, but when you click on the "Take This Quiz" button... boom!

Any ideas?

Sigon
06-11-2002, 06:32 PM
You can see my blank page here: http://forums.lotronline.com/quiz.php
The templates did not install correctly.

TWTCommish
06-11-2002, 06:33 PM
dm: can you attach your install_quiz.php file to a post here? Maybe it got messed up somehow...

Dark_Wizard: I think you're running a different version of PHP than I am. Use the attached quiz.php file in place of your current quiz.php file, and I think it should do the trick.

TWTCommish
06-11-2002, 06:35 PM
Can someone having problems with their templates please upload their install_quiz.php file? It should work...I've had several people try it out.

-=dm=-
06-11-2002, 06:35 PM
ok here ya go :)

removed

TalkHardRandy
06-11-2002, 06:36 PM
I uploaded that new quiz.php, same error...

Sigon
06-11-2002, 06:37 PM
Gone

bandersen
06-11-2002, 07:02 PM
This is cute... I will install soon!

Harryli
06-11-2002, 07:27 PM
I have setup a testquiz, but if I hit "Take this quiz" I get "Error: invalid quiz specified."... see at

http://www.schatzjagd.org/Forum/quiz.php?quizid=1&taking=1

TWTCommish
06-11-2002, 08:02 PM
I stand correged, Sigon: you should probably remove that post. It's making this page of the thread lag like CRAZY.

TalkHardRandy: same error on the same line? Either way can you post the line in question, as well as 3 lines before and after it? I want to make sure we're dealing with the same thing here.

Harryli: sounds like you didn't add any questions to your quiz. :)

NOTE: to those of you having trouble with the templates...I'm 99% sure that the script is working exactly as intended...however, it assumes that you don't have multiple style sets in place. If you do, well, let me know...so I can confirm that that is indeed the problem, and offer up a fix.

-=dm=-
06-11-2002, 08:08 PM
I have 2 styles on my vB.

Harryli
06-11-2002, 08:09 PM
Hm, just proved it and did:

choose "Add questions", Added a Questions (some letters) and "1" Answer, for Quiz "neu". Then I tried to modify this, choosing "Qui, Questions, modify, Quiz "neu", and ... no questions found... ???

TalkHardRandy
06-11-2002, 08:23 PM
Okay... error is:

Fatal error: Unsupported operand types in /usr/local/plesk/apache/vhosts/talkhardonline.com/httpdocs/quiz.php on line 350


Okay here are the lines with 350 in red:

while ($answer = $DB_site->fetch_array($answers)) {
$color = ($color_num++ % 2) ? '{secondaltcolor}' : '{firstaltcolor}';
$answer[answertext] = bbcodeparse($answer[answertext]);
eval("\$answerbits .= \"".gettemplate("quiz_answerbit")."\";");
}

$question_number = $HTTP_POST_VARS["question"];
$answer_count = $DB_site->num_rows($answers);
$num = $HTTP_POST_VARS["question"] + 1;

eval("dooutput(\"".gettemplate("quiz_question")."\");");
exit();

Any ideas?

Hard_one
06-11-2002, 08:45 PM
Database error in vBulletin 2.2.5:

Invalid SQL: SELECT quizid, quiztitle, description, timestamp, userid, catid, imagename
FROM quiz
WHERE approve = 1
ORDER BY timestamp DESC
LIMIT
mysql error: You have an error in your SQL syntax near '' at line 5

mysql error number: 1064

Date: Tuesday 11th of June 2002 11:23:15 PM
Script: http://xxxx.xxx/quiz.php
Referer:



can anyone help please ?

Sigon
06-11-2002, 08:47 PM
I have multiple styles. m8 we reeeeeealllly need this fixed.

-=dm=-
06-11-2002, 08:55 PM
ok I have just tried it on a new board everything working perfect :)
it was the multiple style which was causing the problem.

how can I fix this on my public board?

-=dm=-
06-11-2002, 08:58 PM
Hard_one I think u have to go to the
--> admin cp --> vBulletin Options-->Quiz Options-->at the bottom save changes.
I got this error and I did that :)

TWTCommish
06-11-2002, 09:00 PM
I'm afraid I don't understand what you're saying, Harryli.

Hard_one: I don't mean to sound rude, but if you'd read the instructions, you wouldn't have run into that problem. :) db is correct.

As for the templates: I'll get to work on that tonight. The solution should be rather simple.

-=dm=-
06-11-2002, 09:16 PM
TWTCommish
hmm...I dont see this window...
http://www.movieforums.com/upload/vbquiz/quiz_admin_addquestions.jpg

bandersen
06-11-2002, 09:22 PM
I have now installed - on 2.2.5 - and everything went OK. Very cute hack!

One thing tho.... I am looking for the window with the answers too :) I only get to type the question, add how many answers I want... thats it.

TWTCommish
06-11-2002, 09:22 PM
Under "Quiz Questions" click "Add" -- then pick your quiz from the dropdown menu and enter into the two boxes above how many questions you want to add, and how many answers each question should have. Hit submit and you'll get a page like that one.

-=dm=-
06-11-2002, 09:26 PM
ahhh yes :) thanx

so now Im going to copy aaaalllllllll the quiz templates one by one to my public board :(

TWTCommish
06-11-2002, 09:27 PM
Naw, don't do that. I'll have a mild modification for you tonight that'll save you the trouble.

zootsuit
06-11-2002, 09:30 PM
Any idea about TalkHardRandy's error?

<looking on hopefully>

TWTCommish
06-11-2002, 09:36 PM
Yeah, I'm pondering. I'll let ya'll know if I can figure out what's wrong.

bandersen
06-11-2002, 09:44 PM
Originally posted by TWTCommish
Under "Quiz Questions" click "Add" -- then pick your quiz from the dropdown menu and enter into the two boxes above how many questions you want to add, and how many answers each question should have. Hit submit and you'll get a page like that one.


Ohhh....yes, it's working now! I typed the question.... :cheeky:

I also got the same error as TalkhardRandy.

ceo_tfw
06-11-2002, 10:00 PM
I have installed the quiz and I had both errors, one was with database error


Invalid SQL: SELECT quizid, quiztitle, description, timestamp, userid, catid, imagename
FROM quiz
WHERE approve = 1
ORDER BY timestamp DESC
LIMIT
mysql error: You have an error in your SQL syntax near '' at line 5

mysql error number: 1064


and now I have a blank quiz.php

the templates did not install and I am on version 2.2.6 php
I have re-uploaded the install file and still no go, otherwize the admin functions are working great, just the templates :(

CloudSlash
06-11-2002, 10:03 PM
right now we have about 10 quizes at

www.fflounge.com/board/quiz.php

Dark_Wizard
06-11-2002, 10:08 PM
Originally posted by TWTCommish
dm: can you attach your install_quiz.php file to a post here? Maybe it got messed up somehow...

Dark_Wizard: I think you're running a different version of PHP than I am. Use the attached quiz.php file in place of your current quiz.php file, and I think it should do the trick.

Tried it and same thing....also I'm using PHP 4.1.2

ceo_tfw
06-11-2002, 10:29 PM
My version of php is v4.1.2

here is the install for mine

Dark_Wizard
06-11-2002, 10:43 PM
Originally posted by ceo_tfw
I have installed the quiz and I had both errors, one was with database error


Invalid SQL: SELECT quizid, quiztitle, description, timestamp, userid, catid, imagename
FROM quiz
WHERE approve = 1
ORDER BY timestamp DESC
LIMIT
mysql error: You have an error in your SQL syntax near '' at line 5

mysql error number: 1064


and now I have a blank quiz.php

the templates did not install and I am on version 2.2.6 php
I have re-uploaded the install file and still no go, otherwize the admin functions are working great, just the templates :(

Go to vbulletin options then to quiz and set your options then click submit...as for the templates I can copy mine and you can install from that...

TWTCommish
06-11-2002, 10:55 PM
ceo: I don't mean to be rude, but PLEASE read the instructions.txt file...it warned of that error potentially coming up, and tells you how to fix it.

I'm working on the template problem. It should only be happening to those of you not using the default template set. I'll have something shortly.

Sigon
06-11-2002, 10:57 PM
I am not using the Default. But it is the only selcetable one on my forums. Maybe you could also just give us a txt file with the templates?

TWTCommish
06-11-2002, 11:05 PM
Here's a new install_quiz.php file. Here's how it can help you (I hope :D): find out what the templatesetid is for your primary template set. Then, instead of going to this URL to insert the templates...

http://www.yoursite.com/forums/admin/install_quiz.php?step=1

...go to this one...

http://www.yoursite.com/forums/admin/install_quiz.php?step=1&setid=X

"X" of course should be replaced by the templatesetid number. Of course, you'll need the attached file in place of the old one, too. Let me know if it works. :)

Sigon
06-11-2002, 11:09 PM
w00t! it works! http://forums.lotronline.com/quiz.php
THanks man!

-=dm=-
06-11-2002, 11:12 PM
TWTCommish I copied one by one :D

everything working fine,No errors, I love this hack :)

Thanx alot for your time, now I?ll surf around and look for some quizzies I can add LOL

thaaaanx :)

TWTCommish
06-11-2002, 11:12 PM
Woohoo! Thank goodness. LOL.

Glad you dig it. Lemme know if you run into any other problems.

TWTCommish
06-11-2002, 11:13 PM
You did them by hand? I'm a little confused...didn't they have all those annoying slashes before the quotes and everything?

Sigon
06-11-2002, 11:19 PM
I have just one problem. http://forums.lotronline.com/quiz.php the table is huuuuuuge. Something up with the template?

TWTCommish
06-11-2002, 11:28 PM
The problem appears to be your header: you're missing a closing table row and table tag. I'm not sure which tags it is specifically, but it looks like your header template ends without a closing </tr> or </table> tag...which would be okay, except it doesn't end with an opening <td> tag, either.

Sigon
06-11-2002, 11:29 PM
Whaaaaaat?

bandersen
06-11-2002, 11:30 PM
I still get this error:

Fatal error: Unsupported operand types in ....../forums/upload/quiz.php on line 350

(By now I have only Default style installed)

Sigon
06-11-2002, 11:30 PM
I thinked I fixed the missing thing but still no go

TWTCommish
06-11-2002, 11:30 PM
Sigon: just what I said, dude. :) Look at the HTML of the main quiz page...I'm not sure how to fix it exactly, but I'm 99% sure the main quiz page HTML is kosher.

bandersen: I'm workin' on it. :) In the meantime, though, can you tell me what version of PHP you're running?

Sigon
06-11-2002, 11:32 PM
I gotcha mate. I am gonna install that template again and see what happens

Sigon
06-11-2002, 11:35 PM
TWT I re did all the templates and nada

bandersen
06-11-2002, 11:45 PM
PHP v 3 and something..... moving to 4.1.2 soon.

TWTCommish
06-12-2002, 12:13 AM
Sigon: I'm sorry man, I'm 99% sure that it's one of your templates that's causing the conflict. I've tested mine on fresh vB installations and on other's vBs and they work fine. I looked at your header HTML and there's definitely some missing or misplaced tags.

bandersen: I'm not sure if this is exactly compatible with a version of PHP that early or not. You might have to ditch all instances of the $HTTP_POST_VARS[] array.

Sigon
06-12-2002, 12:15 AM
Bah! Guess my users have to deal with it. Until I can look at it

Smoothie
06-12-2002, 12:35 AM
I've been following along and trying to figure out if this is ready to be installed. I'm running 2.2.2 and PHP 4.2.1, with 2 styles on my forums.

TWTCommish
06-12-2002, 12:37 AM
Smoothie: yes, it should work. If the templatesetid for your primary templateset is NOT 1, however, you'll need to let me know so you can run the installation script just a little differently.

Dark_Wizard
06-12-2002, 12:37 AM
Any fix for the error some of us are getting?

TWTCommish
06-12-2002, 12:39 AM
Which? :D The one on 350? Need more details, man, I'm juggling like four problems. Hehe.

Smoothie
06-12-2002, 12:47 AM
Originally posted by TWTCommish
Smoothie: yes, it should work. If the templatesetid for your primary templateset is NOT 1, however, you'll need to let me know so you can run the installation script just a little differently. Yes, my primary styleid is 1, so it should be ok?

TWTCommish
06-12-2002, 12:48 AM
Yep. I hope. LOL.

Lionel
06-12-2002, 12:57 AM
I just installed without any errors. Created and approved my first quiz; when I run quiz.php on 2.21 I get:

Database error in vBulletin 2.2.1:

Invalid SQL: SELECT quizid, quiztitle, description, timestamp, userid, catid, imagename
FROM quiz
WHERE approve = 1
ORDER BY timestamp DESC
LIMIT

TWTCommish
06-12-2002, 01:00 AM
BAH! Doesn't anyone read the blasted instructions file? :p It warns against that error and tells you what you should do before running the file to make sure it doesn't happen.

Lionel
06-12-2002, 01:06 AM
Originally posted by TWTCommish
BAH! Doesn't anyone read the blasted instructions file? :p It warns against that error and tells you what you should do before running the file to make sure it doesn't happen.

ok, ok, my mistake. Nicely done! :sleep:

Lionel
06-12-2002, 01:07 AM
TWT, can a moderator add a quiz?

rascal
06-12-2002, 01:13 AM
TWT, I signed up for your site but somehow when I tried to do a quiz, they informed me that Only registered members are allowed to take the quiz eventhough I had done so.

Do advise.

Great Hack!

This is quite a stupid question. how do you add a quiz?

TWTCommish
06-12-2002, 01:20 AM
Rascal: are you sure you're logged in? If so, try refreshing...it might be a cache problem.

Lionel: no, not with this setup, but I'm sure it could be modified to do so. Perhaps just by uploading the file to the /mod dir too and making the changes to that index.php file...but I'm not sure.

TWTCommish
06-12-2002, 01:30 AM
Rascal: in your Admin CP. Under the "Quizzes" heading after you've installed the hack, there should be an "Add" link. :D

rascal
06-12-2002, 01:43 AM
TWT, it's ok now.

As for my site, I'm having the same 350 error. How do you see the version of the PHP files you're running?

Images attachment not working too. :)

The file attached shows the alignment is not correct too. :)

*Tried to submit a few times in Admin CP but to no avail*

TWTCommish
06-12-2002, 01:54 AM
I don't understand that last part...the 350 error is seperate. The Admin CP submission doesn't fix that.

To see what version of PHP you're running, create a file with this inside, and run it:

<?php
phpinfo();
?>
As for the images: you probably forget to create the dir and chmod it properly. Again, it's in the instructions.txt file. If you've chmoded it 777 and it STILL doesn't work, then it's likely a server issue.

TWTCommish
06-12-2002, 01:56 AM
The alignment is probably a clash with one of your templates. I installed that template on a fresh vB installation and there no alignment issue.

Erwin
06-12-2002, 02:12 AM
This looks great. I will install it this weekend and let you know how it goes. Thanks.

rascal
06-12-2002, 02:15 AM
I have added the folder quizzes and chmodded it. But to no avail. I have no problem is I added smilies in Smilies folder though.

As for the version. Still no idea how to do it. Glad if you can guide me cos I'm not pretty sure about them.
For the alignment, could you tell me where should I specify specifically for the template only or if it's not possible. Am I able to take out that bar?

As for the last part, I am having the 350 issue.

TWTCommish
06-12-2002, 02:20 AM
The 350 issue is a PHP version problem...at least, I'm nearly positive it is. As for the version: I explained it as best I could in the last post...I spelled it all out, I think. I'm not sure how much more specific I can get.

The chmoding must be off somehow: are you sure it's 777? Is the "quizzes" folder INSIDE the "images" folder?

rascal
06-12-2002, 02:24 AM
Here's what I did.

1. Make a new text file with <?php
phpinfo();
?> inside.
2. Name it text.php and place them on my server and execute it. But nothing happens.

I have read and write for the folder. (/images/quizzes)

Sorry for taking too much of your time.

TWTCommish
06-12-2002, 02:27 AM
I don't think read and write is enough. Try full permissions.

As for the file: that should work. You should get a big display page full of information...if you don't...well, I dunno, you might have a VERY old version of PHP or something of the sort...in which case I don't know if there's anything that can be done.

rascal
06-12-2002, 02:31 AM
LOL....silly me. I execute it in my WS_FTP. Ok my version is 4.1.2

Tried full permission for all folders under /images. Same issue. But the funny thing is uploading smilies is ok.

Take a look here at the attachment.
There is no broken image there too. (Cos I'm sure if there is a column for the image, at least the view would have some sort of a broken image)

Lionel
06-12-2002, 02:33 AM
TWT, your hack is spectacular. Is there a way to use a different header?

TWTCommish
06-12-2002, 02:38 AM
rascal: I'm confused. You mean there's no error when you try to upload the image? The quiz is added?

Lionel: I'm not sure what you mean. The templates are all built to use your header template contents automatically.

rascal
06-12-2002, 02:41 AM
There is no error whatsoever. The quiz is added. When I checked the folder, there are no images.

I only got the 350 error when I try to take the quiz.

Do take a look at the attachment at post#114.

TWTCommish
06-12-2002, 02:42 AM
I'm still working on the 350 error...

Hmm, that image thing is weird. What's the image's name? That might have something to do with it...

rascal
06-12-2002, 02:44 AM
The image name is lotr_the_fellowship_of_the_ring.jpg

Sorry I took your image just for testing purposes only.

TWTCommish
06-12-2002, 02:45 AM
That's okay. :) Hmmm, I'll try to figure that out. I'd recommend giving another image a try to see what happens. I've gotta go to sleep for now, though. :D I'll try this tomorrow.

rascal
06-12-2002, 02:47 AM
Sure and make sure you take a good rest. See ya soon.

Velocd
06-12-2002, 02:54 AM
Very very impressive, this is such a cool hack. I think we know who wins this months "hack of the month." Now I wont have to post polls for quizzes anymore ^_^

Great job!

Here are some pic's for those who are too lazy to register:

Velocd
06-12-2002, 02:54 AM
And another of the taking-quiz interface:

Lionel
06-12-2002, 02:55 AM
Originally posted by TWTCommish

Lionel: I'm not sure what you mean. The templates are all built to use your header template contents automatically.

in some templates I replaced $header with a different $header, or I simply paste the full html code instead of $header. Like that I am able to make use of different banners in different sections.

Recluse
06-12-2002, 05:56 AM
ok i used the first install script, default templates, no other styles, the quiz templates are there, Linux / PHP v4.1.2, MySQL v3.23.45, 2.2.6 vb and the quiz.php is a blank page :(

BigJohnson
06-12-2002, 07:57 AM
I am also getting the

Fatal error: Unsupported operand types in /usr/local/psa/home/vhosts/new-dimensionz.com/httpdocs/messageboard/quiz.php on line 350

error when i click the take this quiz button as well. I read through this thread and saw that the issue is trying to be fixed. These are my server settings

Server Type
Linux / PHP v4.1.0

MySQL
v3.23.46

bandersen
06-12-2002, 08:06 AM
bandersen: I'm not sure if this is exactly compatible with a version of PHP that early or not. You might have to ditch all instances of the $HTTP_POST_VARS[] array. [/B]

Hi - I was using PHP 4.0!
I also had the image error - but included the code below in the quiz description and the image showed.

<img border="0" valign="center" src="images/quizzes/linktous.jpg">

SteelFrog
06-12-2002, 09:16 AM
Great hack!!! After 5 minutes it was up and running! Thanks!

Dark_Wizard
06-12-2002, 10:43 AM
Originally posted by Lionel
TWT, can a moderator add a quiz?

Yes he can if you copy the admin_quiz file into the mod directory and make changes to the index.php also in that directory...I have it working that way. Now if we can only solve the operand error. Maybe FireFly has some ideas?

Boofo
06-12-2002, 12:17 PM
Sorry to say, sir, I just got through adding a quiz and all works great until I try to take it..and guess what. :)

Fatal error: Unsupported operand types in /home/virtual/site3/fst/var/www/html/forum/quiz.php on line 350


I'm using Linux / PHP v4.0.6 Safe Mode and MySQL v3.23.36
if that helps at all. :)

Originally posted by TWTCommish
I don't understand that last part...the 350 error is seperate. The Admin CP submission doesn't fix that.

To see what version of PHP you're running, create a file with this inside, and run it:

<?php
phpinfo();
?>
As for the images: you probably forget to create the dir and chmod it properly. Again, it's in the instructions.txt file. If you've chmoded it 777 and it STILL doesn't work, then it's likely a server issue.

TWTCommish
06-12-2002, 12:22 PM
Alright, I'll see if I can fix this line 350 stuff.

Lionel: I don't understand what you're asking. The quiz templates, by default, use your header template. I'm not sure what else you're asking for.

Boofo
06-12-2002, 12:28 PM
I have no doubt in my mind that you'll find a fix for it. :) I saw those errors reported before I even installed it and installed it anyway knowing you would find a fix if I needed it. :)

(That's enough sucking up now, back to work!) :)

Originally posted by TWTCommish
Alright, I'll see if I can fix this line 350 stuff.

Lionel: I don't understand what you're asking. The quiz templates, by default, use your header template. I'm not sure what else you're asking for.

TWTCommish
06-12-2002, 02:02 PM
Okay. This should help those of you with the line 350 error. Upload the attached quiz.php file over your current quiz.php file, and change your quiz_question template so that it contains the same text as the attached file in the next post.

I have NOT tested this (I can't duplicate the problem)...but it's worth a try.

TWTCommish
06-12-2002, 02:04 PM
Here ya' go...

Boofo
06-12-2002, 02:18 PM
That worked, partially. Do we need to re-eneter the quiz and questions? If not, then the first question in my quiz was actually the second question and there was no second question showinh up, just the answers. :)

But it DID make the nasty error go away! :)

TWTCommish
06-12-2002, 02:18 PM
Ok, I was partially expecting that. Hang on, I'll re-post a fixed quiz.php file...my bad. :)

TalkHardRandy
06-12-2002, 02:21 PM
So far so good... I'm taking a quiz right now to see if it goes through all the way.

You rock TWT!!!!

Boofo
06-12-2002, 02:23 PM
TalkHardRandy,

Where did you get that avatar? I'm looking for a one with Jay in it like that. :)

Originally posted by TalkHardRandy
So far so good... I'm taking a quiz right now to see if it goes through all the way.

You rock TWT!!!!

TalkHardRandy
06-12-2002, 02:28 PM
Originally posted by Boofo
Where did you get that avatar? I'm looking for a one with Jay in it like that. :)

http://www.viewaskew.com and my copy of Paint Shop.

If you poke around the site, there is a lot of animated pics of Jay, SB, and some of the other View Askew people.

Boofo
06-12-2002, 02:36 PM
Great site! But that leaves me out. I'm no good with the graphics programs. :)

Originally posted by TalkHardRandy


http://www.viewaskew.com and my copy of Paint Shop.

If you poke around the site, there is a lot of animated pics of Jay, SB, and some of the other View Askew people.

bandersen
06-12-2002, 03:21 PM
hey -it's working here too!!! ...except the quiz question only shows as the number, and the bar does not show anything.
I am so glad the PHP version turned out OK :) Puh...

TalkHardRandy
06-12-2002, 03:30 PM
Quiz is working, sorta...

I have three quizes created thus far, and it's putting the answers from the first quiz on all the quizes... unless all the Monty Python characters were actually American astronauts...

Lionel
06-12-2002, 03:32 PM
Lionel: no, not with this setup, but I'm sure it could be modified to do so. Perhaps just by uploading the file to the /mod dir too and making the changes to that index.php file...but I'm not sure. [/B]

That worked! That hack is a major addition to vbulletin. Great work.

Boofo
06-12-2002, 03:37 PM
They weren't? I failed the quiz before I even took it, how bad is that? :)

Originally posted by TalkHardRandy
Quiz is working, sorta...

I have three quizes created thus far, and it's putting the answers from the first quiz on all the quizes... unless all the Monty Python characters were actually American astronauts...

dawl
06-12-2002, 04:26 PM
Installed this and all works just peachy ...UNTIL LOL

you go to take the quiz, I suppose if you're shooting for blind guesses it's ok, but the users would really like to see the questions LOL

all I get is the question # - no question I've attached a Screen shot - any ideas ??

Dark_Wizard
06-12-2002, 04:46 PM
Originally posted by dawl
Installed this and all works just peachy ...UNTIL LOL

you go to take the quiz, I suppose if you're shooting for blind guesses it's ok, but the users would really like to see the questions LOL


all I get is the question # - no question I've attached a Screen shot - any ideas ??
Getting same thing...also when you go back into the category of the quiz you just took it says "Taken: Never" even though I took the quiz. When you click on the link the popup says "No matching results found" under the username...

dawl
06-12-2002, 04:50 PM
Now my answer radio buttons aren't showing up either

dawl
06-12-2002, 04:55 PM
ROFL Ok, got the above problems fixed, now what do I do about this one ---> Your Score: 3 of 3 (99%)

TWTCommish
06-12-2002, 05:00 PM
Hang on guys, I can only fix 2,543 bugs at once. :D The fix posted above for the 350 error is NOT perfect...I'm still working on it...I had to post it to see if I was making progress, though. And you answers SHOULD be there no matter what, unless you went in and messed with something, or added a question without answers.

dawl
06-12-2002, 05:09 PM
LOL I got it, i'm happy now :-) the 99% i can live with, I'm sure it was my mistake that caused the other problems !

Thanks for an EXCELLENT hack ! My members are going to LOVE this one !

Dean C
06-12-2002, 06:12 PM
i have found a bug (i think)

when you go to edit a quiz category when you get to the screen where u change the category name and description the boxes where the current data should be in are blank....

TWTCommish
06-12-2002, 06:18 PM
I don't understand how...that doesn't happen to me. Is anyone else having trouble editing their categories?

Dean C
06-12-2002, 06:56 PM
well it isn't a problem as i wouldn't often need to edit a category...

also i have found a problem with the actualy quiz.php when it is run in your forums... but this is a template problem...

the recently added quizzes is on the left and the quiz categories and the rest is on the right... however the quiz categories and the easiest quiz etc etc, scrolls a long way to the right meaning you have a horizontal scrollbar....
ideally i would like the quiz categories above the recently added quizzes bit... i tried editing the "quiz" template and it i have a loose tag somewhere now... so if you could do this new template edit i would be most grateful

Thanks in Advance

TWTCommish
06-12-2002, 06:58 PM
I honestly don't understand what it is you're asking. There is no horizontal scrollbar if you use the defaults...I tried it myself. If you're getting a horizontal scrollbar, either you've changed the templates in some way, or your header is causing a conflict...which wouldn't surprise me, because they often do.

Dean C
06-12-2002, 07:00 PM
well i have edited my quiz template because of the quiz categories and easiest quiz scrolling to the right...

Ill attach a screenshot in my next post:

Dean C
06-12-2002, 07:05 PM
Screenshot:

ceo_tfw
06-12-2002, 07:13 PM
on my last post TWTCommish, I was meant to say that I did do the vbulletin options and the sql error went, and now the blank screen due to no templates and now uploaded the two new files quiz.php and install_quiz.php. I executed the install with my template set at 2 and templates did install with no problems. The only problem now is that the questions and tick boxes do not show,

Hard_one
06-12-2002, 07:26 PM
can anyone post the quiz_question template please ?

ceo_tfw
06-12-2002, 07:30 PM
here it the quiz_question template



<html>
<head>
<title>$bbtitle - Quizzes - $quiz[quiztitle] - $quiz_header</title>
$headinclude

<script language="JavaScript">
function checkanswer(answerform) {
var temp;

for (var i = 0; i < $answer_count; i++) {
temp = answerform.user_answer[i];
if (temp.checked == true) {
return true;
}
}

alert("You must select an answer.");
return false;
}
</script>
</head>

<body>
$header

<!-- breadcrumb -->
<table cellpadding="2" cellspacing="0" border="0" width="95%" align="center">
<tr>
<td width="100%"><normalfont color="white"><b><a href="index.php?s=$session[sessionhash]">$bbtitle</a> &nbsp;$joiner&nbsp; <a href="quiz.php?s=$session[sessionhash]">Quizzes</a> $joiner <a href="quiz.php?s=$session[sessionhash]&quizid=$quiz[quizid]">$quiz[quiztitle]</a> $joiner Question $question_number</b></normalfont></td>
</tr>
</table>
<!-- /breadcrumb -->

<form action="$bburl/quiz.php?quizid=$quiz[quizid]&taking=1" method="post" onsubmit="return checkanswer(this);">
<input type="hidden" name="question" value="$num">
<input type="hidden" name="timecheck" value="$timecheck">

<table cellpadding="4" cellspacing="0" border="0" width="95%" align="center">
<tr>
<td width="100%" bgcolor="#1D6AA0" valign="middle" colspan="4"><normalfont color="#EEEEFF"><b>Quizzes - $quiz[quiztitle] - Question $question_number</b></normalfont></td>
</tr>
</table>


<table cellpadding="8" cellspacing="2" border="0" width="95%" align="center">
<tr>
<td width="100%" bgcolor="#1C5780" valign="top"><normalfont>$question[questiontext]</normalfont><hr/>

<table cellpadding="0 cellspacing="0" border="0" width="95%" align="center" bgcolor="#13486D"><tr><td width="100%">
<table cellpadding="2" cellspacing="1 border="0" width="100%" align="center">
$answerbits
</table>
</td></tr></table>
</td></tr></table>

<br/>

<table cellpadding="2" cellspacing="0" border="0" width="95%" align="center">
<tr>
<td width="100%" valign="middle" align="center"><input type="submit" name="questionsubmit" value="$button_text" class="black"></td>
</tr>
</table>
</form>

$footer
</body>
</html>

Hard_one
06-12-2002, 07:33 PM
thx dude :)

bandersen
06-12-2002, 08:32 PM
Can someone tell me where I modify the email that is sent out - the "from" and "subject" part? The rest I see.

-=dm=-
06-12-2002, 08:54 PM
Originally posted by Mist
well i have edited my quiz template because of the quiz categories and easiest quiz scrolling to the right...

Ill attach a screenshot in my next post:

Hello Mr.Mist

How do I change the size of the right collums/tabels like in u r screenshot?

thanx :)

BigJohnson
06-12-2002, 08:54 PM
it is now perfectly working for me . There is nothing wrong. Amazing hack. Thanks so much. One requests though. Is there any way to have 4 multiple choice questions instead of just 2. That would be a reall help also. Thanks so much.

BigJohnson
06-12-2002, 09:00 PM
O ya also there is some requests I have but i dont no if any one has enought ime for it now hehe. I was wondering if the templates could have my border color to it instead of having no border color. I dont no hown to get that done in the templates. Also when you are taking a quiz it tells you Question 4 if you are on question 4. Could it says like questions 4 out of 10 or something to tell the person how long this test is going to take?

NTLDR
06-12-2002, 10:04 PM
Congrats on another great hack TWT, this will be a great addition to my board, thanks for sharing it with us.

One thing I did find was that if you have "Add template name in comments" set to yes then you get text like this in your email:

<!-- BEGIN TEMPLATE: email_quizresults -->

bandersen
06-12-2002, 10:12 PM
NTLDR, where did you find that "Add template name in comments"..... I wish to change that email too.... :)

TWTCommish
06-12-2002, 10:47 PM
banderson and BigJohnson: it's the email_quizresults template.

BigJohnson: you can have as many answers per question as you want. I'm not sure what gave you the impression you can only have two. :)

Boofo
06-12-2002, 10:50 PM
How are you doing on the new quiz.php? Any luck yet? :)

Originally posted by TWTCommish
banderson and BigJohnson: it's the email_quizresults template.

BigJohnson: you can have as many answers per question as you want. I'm not sure what gave you the impression you can only have two. :)

pgowder
06-13-2002, 01:45 AM
This is a great addition to vB. I'll be installing it soon!

One suggestion, I took several of your quizes, and I'd like to now be able to see the questions and my answers again.

TWTCommish
06-13-2002, 01:54 AM
I'm thinking, for version 2.0, that all quiz results, question-by-question, should be saved. It'd take up a lot of space for any significantly sized board, but it's do-able for the next version.

zootsuit
06-13-2002, 02:30 AM
Damn...almost works!

We still get no questions and misplaced answers on some tests and misplaces questions (from other quizzes) on others...

I just played along and chose even tho the first question didn't have a question and it supplied answers from a different test, it seems to be running smoothly...it even supplied the question after I chose (the wrong one of course - but it's a start!) - no errors anymore! :)

I'm sure we're all waiting with bated breath...

:D

Smoothie
06-13-2002, 11:09 AM
Ok, uploaded all the files, ran the install_quiz.php and no templates were installed. Did what you said in post #77 for both setid's and templates installed correctly. I am happy to report the hack works just great. But, I too have the alignment problem mentioned in post #106 with both styles I use.

TWTCommish
06-13-2002, 11:51 AM
Okay, this'll fix the alignment problem, I think. Find the following in your quiz_category_nav template:

<table width="{contenttablewidth}" cellspacing="3" cellpadding="3" bgcolor="{categorybackcolor}">
Replace it with this:

<table width="{contenttablewidth}" cellspacing="3" cellpadding="3" bgcolor="{categorybackcolor}" align="center">

Boofo
06-13-2002, 11:53 AM
Do we all need to do this then? :)

Originally posted by TWTCommish
Okay, this'll fix the alignment problem, I think. Find the following in your quiz_category_nav template:

<table width="95%" cellspacing="3" cellpadding="3" bgcolor="#336D95" background="https://vborg.vbsupport.ru/images/catagory_backing.gif">
Replace it with this:

<table width="95%" cellspacing="3" cellpadding="3" bgcolor="#336D95" background="https://vborg.vbsupport.ru/images/catagory_backing.gif" align="center">

TWTCommish
06-13-2002, 11:54 AM
Only if you're having an alignment problem on the quiz category page.

Boofo
06-13-2002, 12:10 PM
Ok. Mine looks fine, I guess. Anything on the new quiz.php yet? :):):)

Originally posted by TWTCommish
Only if you're having an alignment problem on the quiz category page.

-=dm=-
06-13-2002, 12:11 PM
is it possible to change the size of "Quiz Categories"etc.?
also I need a nice border around quiz tables, so its totally integrated with my vB index home :D

TWTCommish
06-13-2002, 12:25 PM
I'm not sure what yo umean by their "size" dm. As for the border: bleh. I hate those borders! :D I'll take a look...it's easy, but I'm swamped with these other bug reports right now.

-=dm=-
06-13-2002, 01:00 PM
sorry my bad english :D

I mean so it look like that screen shot Mist posted post157 (https://vborg.vbsupport.ru/showthread.php?postid=260805#post260805)
fx:
"Recently Added Quizzes" (Table size75%) and "Quiz Categories" (Table size25%)

Thanx :)

TWTCommish
06-13-2002, 01:06 PM
It should be pretty easy...open up the quiz template and find the two cells. There's three in the row...the one in the center is a spacer column.

-=dm=-
06-13-2002, 01:34 PM
done :)
But I coulnt find the "Top Scores" "Latest Scores" template.

Thanx

TWTCommish
06-13-2002, 01:40 PM
You mean the ones on the quiz display page, or on the popup?

TWTCommish
06-13-2002, 02:18 PM
I'm workin' on it, X-Fan. :) I should be uploading a new quiz.php file soon, once I've figured this mess out.

TWTCommish
06-13-2002, 02:26 PM
Ok, here's a small update: those of you having the 350 error problem, download and then upload the ORIGINAL quiz.php file -- the one from the archive in the very first post in this thread. Then change this...

$question_number = $HTTP_POST_VARS[question];
$answer_count = $DB_site->num_rows($answers);
$num = $HTTP_POST_VARS[question] + 1;...to this...$question_number = $_POST["question"];
$answer_count = $DB_site->num_rows($answers);
$num = $_POST["question"] + 1;
I think that the problem is with NEWER versions of PHP, rather than OLDER ones. I believe it has something to do with the register_globals setting, but I'm not sure. Anyhoo, give the above code change a try and let me know if it helps...

X-Fan
06-13-2002, 02:41 PM
How bandwidth-intensive is this, TWT?

TWTCommish
06-13-2002, 02:44 PM
Not much, I don't think. If we're talkin' queries, then it's not intensive at all...very few queries involved I believe.

X-Fan
06-13-2002, 02:48 PM
Hmmm, okay, using the modified quiz.php file that you uploaded around the middle of this thread, I got a quiz to work, but some of the questions were missing from the question pages.

Using the above modification to the original quiz.php file, now it asks the first question - but the question text doesn't appear. On selecting an answer, it loads the same question again, and on selecting an answer it generates the "Sorry, you may not re-submit an answer." error.

Check it out here:

http://x-mencomics.com/xfan/forums/quiz.php?quizid=3&taking=1

:(

TWTCommish
06-13-2002, 02:50 PM
You have to use the original quiz_question template as well to try this fix. And ditch the modified quiz.php file in the middle of the thread...it's no good now.

X-Fan
06-13-2002, 02:56 PM
Okay, changed the quiz_question template back to the original, and now the question text is showing up, but it's still asking the same question twice then generating the no resubmit error. :(

TWTCommish
06-13-2002, 02:57 PM
Are you sure there were no errors submitting questions? And you're using the ORIGINAL quiz.php file? And no errors are showing up?

X-Fan
06-13-2002, 03:03 PM
No probs submitting questions, using the original quiz.php file, and no errors showing up except for the "Sorry, you may not re-submit an answer." one after it asks the same question twice.

TWTCommish
06-13-2002, 03:04 PM
Okay, I think I know what might be wrong. I'll get back to you again in a little bit.

Boofo
06-13-2002, 03:05 PM
The new changes to the old quiz.php didn't work. I get to take the quiz (that part is fixed) but all it shows me is the answers to the first question without the question and when I hit next question, it shows me the answers to the first question again without the question. And then no matter what I hit for an answer, I get the can't re-submit eror. (Did you understand all of that?) If you did, please explain it to me. :)

Originally posted by TWTCommish
You have to use the original quiz_question template as well to try this fix. And ditch the modified quiz.php file in the middle of the thread...it's no good now.

TWTCommish
06-13-2002, 03:06 PM
That's exactly what X-Fan just said, Boofo. :D

Boofo
06-13-2002, 03:09 PM
We must have been typing our messages at the same time because his wasn't there before I started my message. :)

Originally posted by TWTCommish
That's exactly what X-Fan just said, Boofo. :D

ceo_tfw
06-13-2002, 05:27 PM
works now with the update thanks

shows questions and answers

and no errors

Smoothie
06-13-2002, 05:39 PM
Hey TWTCommish,

Thanks for solving the problem with the alignment. It's all great now. Mucho appreciated...

bandersen
06-13-2002, 05:52 PM
I updated... get the same error as X-Fan.

Dean C
06-13-2002, 06:05 PM
im still having that alignment problem... plz help :D

TWTCommish
06-13-2002, 06:06 PM
Did you make the change? Can you give me the link to your category page so I can see the HTML for myself? I need details. :D Just telling me that something is wrong doesn't really give me anything to work with.

-=dm=-
06-13-2002, 07:15 PM
Originally posted by TWTCommish
You mean the ones on the quiz display page, or on the popup?

No its not the popup, but on the quiz display page.
--------------------------------------
Top Scores
Username - Score - Completed
--------------------------------------
Latest Scores
Username - Score - Completed
--------------------------------------

thanx :)

TWTCommish
06-13-2002, 07:35 PM
Well, since it's on the quiz_display template, you'll find it in one of the "sub" templates...IE: ones that begin with quiz_display. The two in question are, I believe:

quiz_display_bestresults
quiz_display_latestresults

-=dm=-
06-13-2002, 08:07 PM
thanx now Im very close to get it as I want it :D
now I have only a litle problem its the tablehead "Latest Scores" I cant find the template for it, I have also searched for the word "Latest Scores" in templates still no luck :(

here is the screenshot:

TWTCommish
06-13-2002, 08:10 PM
That part is near the bottom of the quiz_display template.

ZiRu$
06-13-2002, 09:08 PM
i think users should be able to make them......Like NEW POLL, NEW QUIZ

TWTCommish
06-13-2002, 09:18 PM
Very likely for 2.0. :)

X-Fan
06-14-2002, 03:11 AM
TWT, any idea on the problem I'm having with it asking the same question twice then giving the no resubmit error?

rascal
06-14-2002, 05:48 PM
The error is gone. However there are still no image attached. I'm installing it on a fresh install 2.2.6

MrBojangle1
06-14-2002, 05:55 PM
very nice hack nicly done and lots of work put into it thanks mate

MrBojangle1
06-14-2002, 07:16 PM
one question how to mods and members make quizes??? If they cant can you please make an addon that will let them but we have to approve

Velocd
06-14-2002, 09:05 PM
That would be a great addition to this hack ;)
Although it should be seperated into two groups:

Official Quizzes(for the quizzes the admin makes) and then, Member Quizzes(for everybody else).

TWTCommish
06-14-2002, 09:10 PM
This has been discussed already. :) Mods and Members can NOT create quizzes on their own...they need to send you the data. However, this is planned for 2.0, most likely.

AndyTSJ
06-14-2002, 09:47 PM
How about a timer so that users don't have time to look up answers to questions ?

TWTCommish
06-14-2002, 09:49 PM
That's been discussed, too. Again...2.0. :D

AndyTSJ
06-14-2002, 09:51 PM
Any chance we'll see 2.0 soon ?

TWTCommish
06-14-2002, 09:52 PM
Not until all these infernal bugs are cleared out. :)

AndyTSJ
06-14-2002, 09:54 PM
Well this is one cool script, you got me hanging on the release of 2.0 big time :D

X-Fan
06-15-2002, 12:39 AM
TWT, any progress with that repeat question problem, mate? I really want to get this quiz up and running at my site, as it's something I've been working towards for a while and this will save me tons of time!

rascal
06-15-2002, 04:48 AM
Any remedy for the image problem guys? Thanks :)

josh929
06-15-2002, 09:47 AM
Originally posted by xiphoid
Your Score: 3 of 3 (99%)

I think 100% is 100% is my world :)

VERY COOL HACK
so has this been fixed?

josh929
06-15-2002, 10:03 AM
when trying to run install_quiz.php i get:

Fatal error: Call to undefined function: cpheader() in /home/somegood/public_html/forums/install_quiz.php on line 4

alain4ever
06-15-2002, 11:19 AM
hi,

thank you for that hack.....

it works 100%

http://www.alain4ever.com/vb/quiz.php ;)

BigJohnson
06-15-2002, 03:12 PM
Originally posted by alain4ever
hi,

thank you for that hack.....

it works 100%

http://www.alain4ever.com/vb/quiz.php ;)

You mean it works 99% LOL. just kidding. Well about the templates. What can I add to make it have a table border color of the table border color that i have put in my Admin area for the actuall table border color because to me the templates look a little funny with no table border colors. Please help me out and tell me what to do in order to get a table border color.

MrBojangle1
06-15-2002, 05:08 PM
well I got it all workin www.gotdbz.com/vb/quiz.php I think it looks nice on my forum ^_^

Lionel
06-15-2002, 05:16 PM
Is there a way to have a short description for recently added quiz on quiz first page and the full description for quiz information?
I'd like to use it as a course and after reading 2 or 3 pages of information, take the quiz. Unfortunately those 2 or 3 pages also reflect on first page.

TWTCommish
06-15-2002, 06:05 PM
I'm afraid that there's no quick way of having two seperate descriptions...I've got my hands full with the other stuff right now.

Lionel
06-15-2002, 06:10 PM
description character limit for quiz display easiest/hardest, can it be also set for quiz description on quiz display main page?

Lionel
06-15-2002, 06:29 PM
that the original image for quiz cannot be edited. I have to delete entire quiz and do it again. Also, when you put one image in quiz, the one without images carry the last image too.

TWTCommish
06-15-2002, 06:34 PM
Thanks, I'll fix that bug.

Boofo
06-15-2002, 06:36 PM
Anything on the new quiz.php yet? I'm dead in the water until it is fixed. :)

Originally posted by TWTCommish
Thanks, I'll fix that bug.

alain4ever
06-15-2002, 07:46 PM
Originally posted by BigJohnson


You mean it works 99% LOL. just kidding. Well about the templates. What can I add to make it have a table border color of the table border color that i have put in my Admin area for the actuall table border color because to me the templates look a little funny with no table border colors. Please help me out and tell me what to do in order to get a table border color.

:pirate: my quiz is 0% now.... LOL

i dont know what happen.... just it work for one time then it show the question with out the answers....

i hope that i can help you.... but let me finished from that bugs then i will help you...

see Ya

Shokkka
06-15-2002, 08:38 PM
Ok, i just read through ALL of this and got the install_quiz.php fix, im setting up and its going fine step one no errors, step 2 no error and then I get to step three and BANG i get this


Database error in vBulletin Control Panel 2.2.6:

Invalid SQL: CREATE TABLE quiz (
quizid int(11) NOT NULL auto_increment,
quiztitle text NOT NULL,
description text NOT NULL,
imagename text NOT NULL,
approve smallint(6) default NULL,
timestamp int(11) NOT NULL default '0',
userid int(11) NOT NULL default '0',
catid int(11) NOT NULL default '0',
PRIMARY KEY (quizid)) TYPE=MyISAM;
mysql error: Table 'quiz' already exists

mysql error number: 1050

Date: Saturday 15th of June 2002 04:29:24 PM
Script: http://www.mydomain.com/vbb/vbb/admin/install_quiz.php?step=3
Referer: http://wwww.mydomain.com/vbb/admin/install_quiz.php?step=2


what am I doing wrong here? lol i know your swamped but i seem to be the only one wiff this problem :/ thanx :)

L8r
~Shokka (PLEASE HELP ME!!!!!!! ;))

TWTCommish
06-15-2002, 09:04 PM
That means you already have a table called "quiz" in your database. :)

Shokkka
06-15-2002, 09:13 PM
ok then WTF do i do lol... i get a blank page when I go to mydomain/forums/quiz.php its totally blank

if I alreeady have the table sits the old one that doidnt work. im trying to get the fix working :/

TWTCommish
06-15-2002, 09:21 PM
It sounds like there was a problem with the template installation?

Shokkka
06-15-2002, 09:54 PM
ok I installed the first version and then the quiz page showed nothing.

So I read through this thread and found out other people were having the same problem

You created a new install_quiz.php file

I downloaded and attempted to use.

I got to step 3 and got that error

now do I gotta delete the table? and start again? or what?

TWTCommish
06-15-2002, 09:55 PM
No, you should be able to see it now. If your problem was with templates, and you ran the first step of the new one, that should've been all. Did you remember to include the templatesetid number in the query string?

Shokkka
06-15-2002, 10:05 PM
ummm.... WHAT???!??!? i dont get it lol how do i know that number?

Lionel
06-15-2002, 11:28 PM
Originally posted by TWTCommish
This has been discussed already. :) Mods and Members can NOT create quizzes on their own...they need to send you the data. However, this is planned for 2.0, most likely.

you are wrong. I followed your instructions and placed the admin_quiz.php in the mod folder and edited index.php accordingly. My mods are able to create quizzes.

Lionel
06-16-2002, 02:41 AM
I am using 2 styles, representing 2 languages: English and French. The auto install placed all the templates as default style, therefore when a user is using the french style they get a blank page. I usually reproduce all the templates in the second style. Is there a way I could have a zip file of the templates that you used?

never mind, I figured it out.

In which template you have the imagefolder so I could change it for number 2 so it matches the default folder?

X-Fan
06-16-2002, 05:53 AM
Quick question - I've now got the quiz settings listed twice in vBulletin Options. How do I remove one instance of the settings from that?

alensaan
06-16-2002, 06:11 AM
I dont know how to ran the install_quiz.php file?

alensaan
06-16-2002, 06:54 AM
X-Fan

can u help

cdcopyworld
06-16-2002, 08:36 AM
My quiz question are not saving:( i keep getting "Error: invalid quiz specified." when i go to take a quiz.

anyone know whats wrong?

thanks

Dean C
06-16-2002, 08:55 AM
im still having problems with my templates :(...

TWTcommish - can you attach a file with all the templates as .txt files so i can add them again plz ...

thanks in advance

josh929
06-16-2002, 09:07 AM
when trying to run install_quiz.php i get:

Fatal error: Call to undefined function: cpheader() in /home/somegood/public_html/forums/install_quiz.php on line 4

any ideas about what's wrong?

alensaan
06-16-2002, 10:48 AM
please,
whats the procedure of runing the install_quiz.php file?

or

where i can find the information about that?

bandersen
06-16-2002, 10:59 AM
You upload the install_quiz.php file according to instructions (/root/admin)... and then type in that path in your browser....

Robert Basil
06-16-2002, 09:06 PM
Originally posted by Mist
im still having problems with my templates :(...

TWTcommish - can you attach a file with all the templates as .txt files so i can add them again plz ...

thanks in advance

I agree, I am having the exact same problem.

Can someone give us a text file with the templates so we can add them by hand?

bandersen
06-16-2002, 09:23 PM
Perhaps it's possible to open the intall_quiz.php in an editor and cut/paste the template from there......

Originally posted by Sportbikeworld


I agree, I am having the exact same problem.

Can someone give us a text file with the templates so we can add them by hand?

Boofo
06-16-2002, 09:27 PM
I went ahead and un-installed this hack until someone can find a fix for it. :)