vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Inferno Quiz v2.1 (https://vborg.vbsupport.ru/showthread.php?t=80780)

amykhar 05-27-2005 10:52 PM

Here's a quick and dirty mod to PM the person of your choice when a quiz has been submitted and is ready for review.

In quiz.php
Find:
Code:

header("Location: quiz.php?sub=1");
Add Above (change the word userid in both places to the userid of the member you want notified.):
Code:

        $PM = "A quiz has been submitted for review.";

        // Send PM
        SendPM($PM,"Quiz Submitted for Review",userid,userid);


Neutral Singh 05-28-2005 04:41 AM

First of all i must say ...

ZT & Inferno Quiz ROCKS !!!!

Thank You !!!!

Quote:

An error has occured, the following message has been left below:

You may only view user stats if you have completed the quiz.
As an admin, when i click on view stats --> click on a membername option, i get this error, i think as an admin i should have the previliage to view the results without having to go to admincp everytime a members chooses to get quizzed. There should be no problem ethically as afterall i am the person who devised to quiz. :devious: Just a suggestion for future versions.


Quote:

Warning: in_array(): Wrong datatype for second argument in /includes/engine.quiz.php on line 540

Warning: in_array(): Wrong datatype for second argument in /includes/engine.quiz.php on line 540

Warning: in_array(): Wrong datatype for second argument in /includes/engine.quiz.php on line 540

Warning: in_array(): Wrong datatype for second argument in /includes/engine.quiz.php on line 540
I was moderating quiz results for one of the members when i encountered the above error. An snapshot is attached in this message.


And Lastly, a member should have the facility of taking the same quiz more than once. This is a must be there feature in my view.

Thanks and Best Regards

Zero Tolerance 05-28-2005 08:00 AM

It would appear that error is caused from the answer not being an array for some form of reason. You can change on line 540 of engine.quiz.php this:
PHP Code:

$Selected = (in_array($key,$Data) && trim($Data) != '')? " checked='checked'" ""

To:
PHP Code:

$Selected = (@in_array($key,$Data) && trim($Data) != '')? " checked='checked'" ""

It should solve the problem.

- Zero Tolerance

amykhar 05-29-2005 04:12 PM

Feature requests for the next version:
I love the quiz system, but I find two things tiresome.
1. When I create a quiz and start adding questions to the quiz, I don't like having to select the quiz from the dropdown each time I add a new question. Is it possible to store the name of the latest quiz that a question was added to, and remember that value in the dropdown for subsequent question additions? Then, if I need to change quizzes, I can but for those of us who generally add 10 or more questions at a time to the same quiz, we won't have to keep making that selection, which gets cumbersome once you have a significant number of quizzes.

2. If possible, allow us to set default permissions for taking quizzes and viewing the stats of quizzes. Then, we can use the default settings for most quizzes, but adjust for special quizzes that we want to restrict to certain user groups.

I'm willing to do the coding and send it to you if you are busy or need help. The only reason I make the suggestion here is that I am trying to keep my own private version from making two many forks from your standard.

Also Zero, give me a yell if you want my code to have quizzes show who wrote them, allow quiz authors to take their own quiz multiple times without showing their score, and to show a "Quiz already Taken" message for people who have taken a given quiz instead of the Take Quiz link.

Amy

banshee 05-29-2005 06:07 PM

I installed this hack and love it, however I use the quiz for contests for prizes. So it is hard to see what peoples scores are so i modified the quiz.php so it sorts the usernames and shows the %. Making it easy to see who the top Members are.

I hope this isn't against the rules if it is just delete the post

Modify the SQL statment to order the results by score so the highest scores are listed at the top.

Code:

// Get All The Results
                $Get_Results = $DB->query("
                select u.username,
                r.r_userid,r.r_score
                from ".TABLE_PREFIX."quiz_results r
                left join ".TABLE_PREFIX."user u on(u.userid=r.r_userid)
                where r.r_forquiz = '{$Quiz['qid']}' ORDER BY r.r_score DESC
                ");

Change the Result display so it formats and shows the % correct.

Code:

$Results[] = "<tr><td><a href='quiz.php?$session[sessionurl]do=UserStat&userid={$Result['r_userid']}&id={$Quiz['qid']}'>{$Result['username']}
</a></td> <td>{$Result['r_score']}%</td></tr>";

Hopefully everyone finds this useful like I do.

Neutral Singh 05-30-2005 04:39 AM

Quote:

Originally Posted by Zero Tolerance
It would appear that error is caused from the answer not being an array for some form of reason. You can change on line 540 of engine.quiz.php this:
PHP Code:

$Selected = (in_array($key,$Data) && trim($Data) != '')? " checked='checked'" ""

To:
PHP Code:

$Selected = (@in_array($key,$Data) && trim($Data) != '')? " checked='checked'" ""

It should solve the problem.

- Zero Tolerance

Yes Sir !! It did the trick !! The error seems to be gone... Thanks :)

Neutral Singh 05-30-2005 04:40 AM

And yeah i forgot to thank you for Quiz Packs... Thanks !!!!

amykhar 05-30-2005 04:38 PM

For those of you who downloaded my dead or alive quiz, you need to remove the Eddie Albert question or change the answer. He died this weekend.

Amy

axi 05-30-2005 04:40 PM

r.i.p.

updated :)

amykhar 05-30-2005 05:23 PM

Here's a little mod that some of you may find useful.

Right now, whenever you add a quiz question, the dropdown box comes up to the first Quiz in the list. This little mod makes the dropdown remember the last quiz that you added a question to. The next time you add a question, the dropdown list of Quizzes will be set to that last quiz.

amykhar 05-30-2005 06:35 PM

I hacked up a quick CMPS module for y'all. The screenshot I've provided does NOT look like the code I've given you. My quiz code stores the quiz's author's name and userid. The default Inferno Quiz does not. So, the version I have uploaded shows only the title of and link to the latest quiz.

amykhar 05-30-2005 07:22 PM

And, one more quiz for y'all. This one is on the U.S. Memorial Day holiday.

Hoang Tu Ao Den 05-30-2005 08:31 PM

Thanks for this hack. Installed !
I have one small question, the last step on your instructions said:
CHMOD the following files/folders to '0777':
includes/
images/

Is is neccesary ?
Thanks

Paul M 05-30-2005 10:48 PM

Quote:

Originally Posted by Hoang Tu Ao Den
Thanks for this hack. Installed !
I have one small question, the last step on your instructions said:
CHMOD the following files/folders to '0777':
includes/
images/

Is is neccesary ?
Thanks

No, neither is necessary - but the others mentioned are (the quiz folder, and the settings file).

amykhar 05-31-2005 12:03 AM

Another Mod. This one improves the Who's Online Page to show which quiz the viewer is taking or which stats the user is viewing. This borrows heavily from the ibproarcade hack.

Amy

jaks 05-31-2005 03:12 AM

Great hack,

I saw this question on page 16 but didn't see any response. Is there an option for retaking a quiz? It would be nice for some sort of time option aswell. ( Time between taking a quiz a second time).

Jaks

Neutral Singh 05-31-2005 08:19 AM

Thanks amykhar for these useful hacks... :)

brianstevz 05-31-2005 08:20 AM

I modified this to work with vBa. Borrowed heavily from tcs random arcade hack.

https://vborg.vbsupport.ru/showthrea...184#post660184

Snake 05-31-2005 10:32 AM

Nice addons Amy. :)

amykhar 05-31-2005 12:57 PM

Quote:

Originally Posted by jaks
Great hack,

I saw this question on page 16 but didn't see any response. Is there an option for retaking a quiz? It would be nice for some sort of time option aswell. ( Time between taking a quiz a second time).

Jaks

No. There's not. Right now, once you take a quiz you can't take it again.

-=Sniper=- 05-31-2005 01:59 PM

any chance so guests can view only?

amykhar 05-31-2005 02:21 PM

Yes. In the Quiz Template, remove the if clause that prohibits Guests from viewing. Then, set each quiz so that Guests may not take the quiz.

amykhar 05-31-2005 07:24 PM

Quote:

Originally Posted by banshee
$Results[] = "<tr><td><a href='quiz.php?$session[sessionurl]do=UserStat&userid={$Result['r_userid']}&id={$Quiz['qid']}'>{$Result['username']} </a></td> <td>{$Result['r_score']}%</td></tr>";


I had a slight problem with this mod in that it put a bunch of commas above the result table. To solve that, I changed:
Code:

$Submissions = implode(",",$Results);
to
Code:

$Submissions = implode(" ",$Results);

dsboyce8624 05-31-2005 07:30 PM

When I click submit at the end of a quiz I always get the "You have already taken this quiz" error.

It also takes about 5 minutes to come back with results.

I just installed it and I know I haven't taken them yet, any ideas?

amykhar 05-31-2005 07:31 PM

Quote:

Originally Posted by dsboyce8624
When I click submit at the end of a quiz I always get the "You have already taken this quiz" error.

It also takes about 5 minutes to come back with results.

I just installed it and I know I haven't taken them yet, any ideas?

Have you installed any of the mods in this thread or are you using the base code?

dsboyce8624 05-31-2005 07:34 PM

Just what I downloaded from the first post.

Hoang Tu Ao Den 06-01-2005 06:38 AM

Great Hack.
I have one suggestion,
There's a big way to cheat this Quiz system, user can Take The Quiz. And when it show up, they can remember / copy/ print all the questions out and close the browser. At that time, they have all the questions, and the system won't show that they took the quiz.

I used this hack for award prize, so ... it's a big problem for me... if it is so easy to cheat like this.

Anyway to make it, if they see it, then they can't take it again ?

Or, make it where the user close the browser then it will pop up an error like : You haven't finish the quiz, are you sure you want to quit ? ... or we will only grade what you have done
so far if you close the browser ......... ?

amykhar 06-01-2005 10:06 AM

Quote:

Originally Posted by dsboyce8624
Just what I downloaded from the first post.

Queck your quiz_results database table and see what's in there.

banshee 06-01-2005 11:10 AM

Well I use it for contests to but I make it so they can not see the answers to the quiz when completed. I don't want them giving all the answers away to other members.

amykhar 06-01-2005 05:25 PM

This is what I consider a bug-fix. Y'all may consider it a mod. Either way, it changes how quizzes are scored.

Right now, if you take a quiz that has questions with multiple correct answers, it is possible for you to score higher than 100% on the entire quiz. This change fixes that.

(This is because the old version checked all the actual right answers, but didn't keep a count of the possible number of right answers)

deb0 06-01-2005 06:22 PM

Ok, this looks awesome! I am gonna try it out tonight. A Ucash addon would be even 'mobetter'

Turbosport 06-01-2005 07:49 PM

Quote:

Originally Posted by dsboyce8624
When I click submit at the end of a quiz I always get the "You have already taken this quiz" error.

It also takes about 5 minutes to come back with results.

I just installed it and I know I haven't taken them yet, any ideas?


I get this exact same problem any ideas people.

amykhar 06-01-2005 11:41 PM

Quote:

Originally Posted by Turbosport
I get this exact same problem any ideas people.

As I asked the other guy, please look at the quiz_results table and see if there are any results in there under your userid. Can anybody else on your forum take quizzes? If so, what makes you different from them? To help you fix a bug that most of us don't see, we need more info.

amykhar 06-02-2005 10:38 AM

Another mod for lazy admins like me. I love the ability to set usergroup permissions on a per-quiz basis. I HATE having to put them in using the javascript interface every time I add a quiz. Most times, I want the same usergroups to be able to use most quizzes.

So, I hacked this up to save me time. It's not pretty like Scot's javascript, but it gets the job done AND it maintains the ability for me to edit a quiz and change the permissions for a specific quiz.

Change the default usergroups to suit your needs. Obviously, mine won't work for you.

Amy

dsboyce8624 06-02-2005 03:19 PM

Quote:

Originally Posted by amykhar
As I asked the other guy, please look at the quiz_results table and see if there are any results in there under your userid. Can anybody else on your forum take quizzes? If so, what makes you different from them? To help you fix a bug that most of us don't see, we need more info.

I only see resluts for the ones I have actually taken. And I now understand that it's doing the same thing for all users, not just me. The person who said it worked fine was a bonehead.

Sorry for the delay.

amykhar 06-02-2005 05:16 PM

Quote:

Originally Posted by dsboyce8624
I only see resluts for the ones I have actually taken. And I now understand that it's doing the same thing for all users, not just me. The person who said it worked fine was a bonehead.

Sorry for the delay.

I am having absolutely no problem taking quizzes on your site using firefox. And, as it seems that you can take some quizzes (I see your scores), your first bug report isn't quite accurate. This doesn't always happen to you. Which specific quiz is giving you grief?

By the way, you didn't change the Eddie Albert question. He died last month :D

dsboyce8624 06-02-2005 06:14 PM

Quote:

Originally Posted by amykhar
I am having absolutely no problem taking quizzes on your site using firefox. And, as it seems that you can take some quizzes (I see your scores), your first bug report isn't quite accurate. This doesn't always happen to you. Which specific quiz is giving you grief?

By the way, you didn't change the Eddie Albert question. He died last month :D

They all post my results, but when I click submit, it takes about 5 minutes, then says "you already too it" then if I go to look at the results they are there.

Must be an IE thing, I had a problem with IE and vBChat as well. After a bout a month it was figured out. I don't know how this could relate though.

Maybe have to look at what function happens when you click the submit button.

I'm going to try one of yours with IE and see what happens. I know yours is way modded, but just to check.

Thanks for looking, it figures it's an IE thing.

PS - I know he died, but I've been lazy.

Dennis

EDIT: Okay, it works fine on yours. Which means I screwed something up. Damnit!!!

dsboyce8624 06-02-2005 06:22 PM

Okay, I took one of mine. After about 4 miutes of waiting I just hit stop and went to view the scores. The score I submitted was there, but the page had never come back.

Any ideas on what could cause this?

amykhar 06-02-2005 06:30 PM

Try optimizing your database. Also, try pinging your server from your isp and see if you are lagging somehow. It sounds like it's timing out on you for some reason, and it shouldn't. It's a really simple function that does the submit. How does it behave on your site with firefox? I'm pretty much stumped because I don't see the problem happening.

Amy

rinkrat 06-03-2005 03:40 AM

Here's a King of the Hill quiz. How about sharing some of yours if you have an original one?


All times are GMT. The time now is 03:55 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01592 seconds
  • Memory Usage 1,850KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_code_printable
  • (4)bbcode_php_printable
  • (13)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete