View Full Version : Test Your Members' Knowledge Before Allowing Them to Post in Certain Forums
amykhar
07-31-2005, 10:00 PM
This mod is an addon to the Inferno Quiz System (https://vborg.vbsupport.ru/showthread.php?t=83130&highlight=Inferno+Quiz) You must have that mod installed and working to use this.
What it does: It requires users to achieve a minimum score on a specified quiz to post in a forum.
Example: You have a PHP discusssion forum for advanced coders. You don't want novices bothering your members with trivial questions. So, you require anybody who wishes to post in that forum to achieve a minimum score of 70% on an advance PHP quiz that you created using Inferno Quiz.
How to install it: Import the Product. Done. No template edits, nothing else to do.
How to use it: In your admincp forum manager, edit the forum(s) you wish this to use this mod for. Enter a Quiz ID and the minimum acceptable score. Save the forum. You're done.
You can easily require users to pass different quizzes to be able to post in different forums. If a user has not taken the quiz, he is directed to do so. If he has failed the quiz, he sees an error message.
I don't expect many of you will use this. I'm not even using it. But, the idea hit me and it was fun to throw together.
Amy
amykhar
08-01-2005, 07:58 PM
p.s. If you want your users to have to pass the quiz before they can even read in your forum, copy the plugin code from newthread_start and create new plugins using forumdisplay_start and showthread_start as the hooks with the same source code.
I haven't tested that, but it should work.
Neutral Singh
08-02-2005, 01:17 AM
gr8 concept!! May come real handy in really big forums. You are on a roll Amy.
I installed it but if I click on edit forum there is nothing where I can enter a Quiz ID or anything?
Azhrialilu
08-03-2005, 11:57 AM
I love this idea and can definitely put it to use :D Nice one, Amy!
amykhar
08-03-2005, 12:23 PM
I installed it but if I click on edit forum there is nothing where I can enter a Quiz ID or anything?
Kru, let me double check that all of the plugins are in the product.
BluPhoenix
08-04-2005, 04:38 AM
Oh cool, I can use this for my Adult Section and try and recreate that old "Lesuire Suit Larry" feel to getting access *g*
Brinnie
08-04-2005, 05:22 AM
I don't expect many of you will use this. I'm not even using it. But, the idea hit me and it was fun to throw together.
Was thinking the same... But it sounds so cool, I'm considering a way I can work it in. :p
Azhrialilu
08-04-2005, 08:01 AM
Just to show an example of where it works... on a metaphysical/paranormal site I run, we have areas for more advanced things. Using as an example, the craft of the witch, for beginners we have an area where they can read up and ask questions on absolutely everything you need to get started, but we also have an area for those people who have been part of the Craft for many years. Now it's very hard sometimes to know how much someone really knows, so this is where Amy's idea comes in extremely useful to me! We can now add a "quiz" that people have to pass - holding the limited knowledge needed tob e able to access the forum.
Kru, let me double check that all of the plugins are in the product.
Ok, thank you. I really like the idea of this hack and it can be useful for my forum www.mirzone.net . :)
Tell me if you have any idea why it doesn't work for me, please.
amykhar
08-04-2005, 02:09 PM
Kru, Try it now. I accidentally added one of the plugins to a different product with a smiliar name. Download the new xml file and install the product. It should work now :)
Sorry about that one.
Amy
Azhrialilu
08-04-2005, 06:47 PM
I've just downloaded it and installed it, and getting the same problem... no option in edit forum :)
amykhar
08-04-2005, 07:18 PM
The problem seemed to be in the import of the product file. It did not work right. I redid the product on RC2 and have uploaded it here for you. I successfully uninstalled my product and installed this one; so cross your fingers.
Amy
Azhrialilu
08-04-2005, 07:30 PM
I tried it on RC1 without success, got an error message flash up.. unfortunately too quickly to read LOL... am going to upgrade to RC2 in the morning, so will retry then :D
Edited to say:-
Ignore me... I'm getting tired... just did it again and works perfectly!!!! :D
Azhrialilu
08-04-2005, 07:34 PM
grrr lol back again... when I try to save a forum without any quiz ID, I now get an error:-
MySQL Error : Unknown column 'quizid' in 'field list'
Error Number : 1054
amykhar
08-04-2005, 07:36 PM
Drats. Back in a bit.
amykhar
08-04-2005, 07:42 PM
ok. Try now. If it makes you all feel any better, I just accidentally wiped out 3 days of work because a product had a similar name.
Azhrialilu
08-04-2005, 07:44 PM
ok. Try now. If it makes you all feel any better, I just accidentally wiped out 3 days of work because a product had a similar name.
:eek: not at all!!!! In fact, now I just feel guilty :(
Edited to say:-
WOOHOO!!! you are so awesome! :D worked wonderfully.
Perfect works, now. Thank you very much. :)
garrynewman
08-04-2005, 10:05 PM
I get missing phrases...
'quiz_not_taken'
Were we meant to add these ourselves?
I get missing phrases...
'quiz_not_taken'
Were we meant to add these ourselves?#
Yes, after choosed a Quiz for a forum and wanted to test it I got the same error: Could not find phrase 'quiz_not_taken'. :(
turkforum
08-25-2005, 07:25 AM
how can we generate a quiz?
amykhar
08-25-2005, 12:46 PM
That's a question for you to ask in the Inferno Quiz support thread. It's out of scope for support for this mod, sorry.
ph03nIX
10-27-2005, 12:00 PM
#
Yes, after choosed a Quiz for a forum and wanted to test it I got the same error: Could not find phrase 'quiz_not_taken'. :(
I am getting this as well.
When I try to post in the forum I have a quiz for I get "Could not find phrase 'quiz_not_taken'." And then when I fail a quiz then tried to post I get "Could not find phrase 'quiz_failed'."
Does anybody have the solution for this? :ermm:
Thanks.
Parture
10-28-2005, 06:58 PM
quiz_not_taken needs to be filled in with a phrase, so go to phrase manager and create a phrase, and that solves the problem.
ph03nIX
10-29-2005, 03:43 AM
quiz_not_taken needs to be filled in with a phrase, so go to phrase manager and create a phrase, and that solves the problem.
Hi,
I went to the phrase manger, add phrase and put ?quiz_not_taken? as the varname and adding a little text to the text box. Saved, then went to the forum and it still said the phrase cannot be found. Am I adding the phrase wrong or something? :o
mavherzog
12-05-2005, 02:35 PM
quiz_not_taken needs to be filled in with a phrase, so go to phrase manager and create a phrase, and that solves the problem.
Specifically, I tried this with the 'quiz_failed' phrase and vB still reported that it could not be found.
Lance Carbuncle
02-09-2006, 10:08 PM
Would it be difficult to make the test work as a usergroup promotion? Anyone want to do this for money?
Thanks, Lance
Frank Butcher
02-18-2006, 08:25 PM
Will this work in 3.5.3 ? if not any plans to make it for 3.5 ?
amykhar
02-18-2006, 10:15 PM
As far as I know it still works. Try it and see.
Krahl
03-15-2006, 11:20 AM
Would it be difficult to make the test work as a usergroup promotion? Anyone want to do this for money?
Thanks, Lance
Wondering if this question could still be answered? I would be very interested (have a great use for this!) if we could promote into usergroups based on pass/fail.
Thanks for your time.
amykhar
03-15-2006, 11:26 AM
Sure, you could do it. But, I will not be doing it as I lack the time and do not need it for myself.
ERuiz
03-17-2006, 09:08 PM
Great hack! One question though. COuld it also be made, so that a person has to pass the quiz, before he/she is allowed to register on the forums?
In other words, guests need to pass the quiz, before being allowed to register on the website.
twobob
04-19-2006, 09:12 PM
Great hack! One question though. COuld it also be made, so that a person has to pass the quiz, before he/she is allowed to register on the forums?
In other words, guests need to pass the quiz, before being allowed to register on the website.
That would be really handy! For adult content sites, a question could be put to new users to confirm whether or not they were of (say) legal drinking age ...
Is it possible to have the quiz pop up as part of the registration process? Cheers, twobob
fridayweb
05-20-2006, 04:47 PM
I figured out part of the phrase dilemma. You need to add the phrases "quiz_not_taken" and "quiz_failed" to the Front-End Error Messages category in order for them to work. It will not work just adding them to GLOBAL.
Now that I have those phrases showing up, it won't display the $foruminfo[score] nor the link to the quiz. Any suggestions?
workplaybiz
07-14-2006, 07:18 PM
p.s. If you want your users to have to pass the quiz before they can even read in your forum, copy the plugin code from newthread_start and create new plugins using forumdisplay_start and showthread_start as the hooks with the same source code.
I haven't tested that, but it should work.
Can someone please do this for me? or can someone at least tell me where to find newthread_start, forumdisplay_start and showthread_start?
pkallberg21
12-30-2007, 01:32 PM
I really like this mod, but would it work for vB 3.6.8, or better yet on 3.7.0?
I would greatly appreciate if you could possibly remake the mod so that it would work on the newer versions.
Thank you.
Alfa1
12-30-2007, 02:16 PM
Indeed. This is a nice hack. It would be nice to see a upgrade to 3.7
Alfa1
04-15-2008, 05:24 PM
Does anyone have this working on vb 3.7?
Nothing shows up in the forum manager.
Alfa1
04-25-2008, 06:48 AM
Does anyone know how to get this mod working on vb 3.7?
It seems to be working fine for me in 3.7, no importing errors, but I am still configuring the adminCP options. They are there, however.
My questions are silly ones:
1. Where do I find the quiz id I need to enter?
2. What do I enter for a score? A percentage, or 10/10, etc.?
3. If a user fails, are they able to try again? Would be kind of silly if they were not.
4. Once the quiz is completed for a user, does it go away, or will they have to do it every time they enter the forum?
Thanks.
Alfa1
06-10-2008, 12:18 AM
Yes, they are there, but there is no blockade for users. I can still access the forum, without entering any quiz. In fact I do not get anything that alerts to the existence of a quiz.
1. You can go to quiz.php and browse quizzes. quiz.php?do=Take&id=X where X is quizID.
2. Yes, a percentage.
3. I have no idea. I have not seen a function to stop retries. So I guess members cn try again and again. So multiple choice is not adviced.
4. So far they do not have to enter anything.
Hey thanks for answering Alfa!
Great info, thanks for your help. I'm just not too clear on #4...
What I am looking for is for members to be able to enter the forum after they pass the quiz, without having to take it every time. Is there a flag that is set or something so that the forum remembers they have passed?
Ahh I'll test it out myself tonight and let you know. :) I'm ready to give it a go. My forum isn't live yet so I'll be sure to keep you updated on any issues I might have in 3.7, and maybe we can work them out together. I'm setting it up to quiz members on the specific rules for that particular forum, so I consider this hack ESSENTIAL, and I intend to make it work any way I can with my limited knowledge, haha.
I apologize profusely, but I looked through the quiz.php and I do not find any mention of specific quiz id's. Shouldn't the quiz I import have the id somewhere in plain sight? This is getting frustrating now, I've been working on this hack for three days. I think I'll just scrap it and redesign my rules. Coders have great minds and come up with the most interesting things, but they're not very good at relating those things to regular people. This, for instance:
p.s. If you want your users to have to pass the quiz before they can even read in your forum, copy the plugin code from newthread_start and create new plugins using forumdisplay_start and showthread_start as the hooks with the same source code.
Sure, no problem. Right after I design a better space shuttle for NASA, give me a few minutes.
Sadly, this could have been a great hack if it just had more user-friendly install and configuration options. I am bitterly disappointed, because I feel it's something my forum won't be able to do without.
Alfa1
06-13-2008, 09:56 AM
You can find the quizID, by looking at the url. I know it is stupid to have to do it this way, but once you see it, it will be simple. For example:
- Browse to www.yoursite.com/forum/quiz.php
- Then select the category the quiz that you need the quizID from, is in. That url should look like this www.yoursite.com/forum/quiz.php?do=Cat&id=1
- Then select the quiz that you need the quizID from.
- This url should look like:
www.yoursite.com/forum/quiz.php?do=Take&id=1
In my example above '1' is the quizID. Please take a look at your url and note down your quizID.
Ok so I knocked that one off, thanks again, now I am getting (what appears to be standard from reading the other posts) the "cannot find phrase 'quiz_not_taken'" error.
I created the phrase and assigned it to the product "Must pass quiz to start", but no results. I saw others were having this problem, but there was no solution offered by the coder. Have you managed to figure this one out?
I altered the plugin code from this:
eval(standard_error(fetch_error('quiz_not_taken',
to this:
eval(standard_error(fetch_error($vbphrase[quiz_not_taken],
which changed the error message to this:
Could not find phrase 'You have not yet taken the quiz to enter this forum. You must do so in order to access it.'.
which is the phrase I assigned to the variable.
I am not very proficient at this so I can only assume I am doing something wrong here. I am so close I can taste it though. Any other suggestions?
Alfa1
06-13-2008, 09:20 PM
People will be able to enter the forum, even if they do not pass the quiz.
They will not be able to post if they do not pass.
It seems that there is only a reference to the phrase, but not the phrase itself. The only phrase that this mod seems to add, is quizID prase.
quiz_failed is also not there.
Maybe these phrases once where in Inferno Quiz.
People will be able to enter the forum, even if they do not pass the quiz.
They will not be able to post if they do not pass.
Yeah I gathered that already from this:
p.s. If you want your users to have to pass the quiz before they can even read in your forum, copy the plugin code from newthread_start and create new plugins using forumdisplay_start and showthread_start as the hooks with the same source code.
I haven't tested that, but it should work.
Although I have no idea how to go about implementing it... it will be the hurdle I undertake after I get it working.
It seems that there is only a reference to the phrase, but not the phrase itself. The only phrase that this mod seems to add, is quizID prase.
quiz_failed is also not there.
Maybe these phrases once where in Inferno Quiz.
Interesting, so what you are saying is you've never solved the issue then? I'll have a look for those references in the plugin code and see what removing them altogether accomplishes, or possibly changing the reference to whatever similar phrase is currently used in Inferno. Would seem like the next logical step to take...
Ok there seems to be a problem with this code in Amy's plugin:
else
{
eval(standard_error(fetch_error('quiz_failed', $foruminfo['score'], "<a href='quiz.php?do=Take&id=".$foruminfo[quizid]."'>$quizinfo[q_name]</a>")));
}
}
else
{
eval(standard_error(fetch_error('quiz_not_taken', $foruminfo['score'], "<a href='quiz.php?do=Take&id=".$foruminfo[quizid]."'>$quizinfo[q_name]</a>")));
}
}
Now I am not sure if it's her code or Inferno's yet, so I am going to remove everything and re-install inferno from the ground up using the xml import and making all the necessary mods to the code for 3.7, essentially make sure it works beyond a doubt, and then I'll throw the plugin back in to see what happens. Shouldn't take long, I'll get back to ya.
OK, well I have managed to get it to work, as in I can set a quiz id to the forum and I get denied posting access, and after I take that particular quiz I can post no problem. What I am having difficulty with is getting the plugin to find the phrases we've been talking about. Once it finds them ok, I can edit them to say whatever I like, even point directly to the quiz if I want.
I edited the xml file for the plugin and added the phrases in there, uninstalled and re-imported, and it puts the phrases into the phrase manager, but the code in the plugin is still not pointing to them correctly. So basically I have confirmed what I said above, that there is a problem with those lines in the code. In particular, these parts of the lines:
eval(standard_error(fetch_error('quiz_not_taken',
same goes for the "quiz_failed" line.
Here is where my limited knowledge comes into play, as I do not know how to alter those lines to point to the proper phrase, ie "$vbphrase[quiz_not_taken]" So far my attempts have produced mixed results from the standard error: test, you do not have permission to access this page. This could be due to one of several reasons:
1. Your user account may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?
2. If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.
to the one I mentioned before:Could not find phrase 'You have not yet taken the quiz to enter this forum. You must do so in order to access it.'. Which is actually pretty close to what I want, minus the "Could not find phrase" of course...
I do not really need the plugin to jump right to the quiz, just to the phrase, and I can direct users to the quiz from there. Any suggestions? I was thinking the entire lines need to be reworked and the error references taken right out, replaced with something that simply directs users to that particular phrase. I will keep going, at least I am making some progress here. :)
Alfa1
06-14-2008, 01:30 PM
Interesting, so what you are saying is you've never solved the issue then?
No, I did not encounter the issue before, since I did not get the result I expected: to deny forum access to members that have not passed the test.
I do not really need the plugin to jump right to the quiz, just to the phrase, and I can direct users to the quiz from there. Any suggestions? I was thinking the entire lines need to be reworked and the error references taken right out, replaced with something that simply directs users to that particular phrase. I will keep going, at least I am making some progress here. :)
Yes, I agree. Since the phrases are nowhere to be found in the templates, I worked through the code of the inferno quiz php files, but as expected there is nothing in there either. It seems that Amy forgot a part of the code.
If we could find a code that just shows a text message, then that would work for me. I am not in need of any translations or phrases. This would also make it easy to include a hyperlink to the related quiz.
I have been trying different code, in a trial and error sort of way, but not much luck until now.
I just added the same plugin to the hook newthread_start and that 'works' in exactly the same manner as the existing plugins: it gives the same error. So I guess that if this error is solved, it will work.
I solved the missing phrase issue.
When you manually create the phrase ('quiz_not_taken' or 'quiz_failed'), the "Phrase Type" field must be set as "Error Messages" rather than "GLOBAL". I did this and all "Could not find phrase" errors were gone, and the correct phrases showed up.
However, I still cannot get it to direct to the quiz id itself (the rest of the code in the line, I am assuming). Here is the code again:
eval(standard_error(fetch_error('quiz_not_taken', $foruminfo['score'], "<a href='quiz.php?do=Take&id=".$foruminfo[quizid]."'>$quizinfo[q_name]</a>")));
So this is the part I need to look at now:
$foruminfo['score'], "<a href='quiz.php?do=Take&id=".$foruminfo[quizid]."'>$quizinfo[q_name]</a>"
I can put a link to the quiz in the phrase translation of course, but I have two different forums requiring quizzes, and I need to set a different quiz for each forum. This solution would only allow me to direct users to one quiz for all forums.
Again, progress :)
I'll keep at it.
I can insert
<a href='quiz.php?do=Take&id=".$foruminfo[quizid]."'>$quizinfo[q_name]</a>
into the phrase translation and it provides a link to quiz.php, but the variables '.$foruminfo[quizid].' and '$quizinfo[q_name]' are not resolving. So I get to the quiz page, but it tells me on the right side (in the actual quiz area) that the quiz does not exist. I can still find the quiz from that point and take it though by flipping through the right-hand column.
Well since I can still set a certain quiz id as the requirement for the forum, I think I am going to stop obsessing over the re-directs and do a band-aid solution... just insert a link into the phrases that points to the category the quizzes are in, and be specific in the quiz descriptions so the users know which one to take when they get there. Too much else to do so I am drawing the line on this one, at least it works to an extent, so I can use it.
Just remember after you import the product:
go to the phrase manager and add the phrases "quiz_not_taken" and "quiz_failed". Be sure to add them as the phrase type "Error Messages".
edit the phrase translations to include your message, and point to wherever your quiz or category is located.
you can find the quiz ID, for the quiz you want to enter in the forum manager, by browsing to it through your forums and looking in your address bar for "do=Take&id=2" Where "2" is the quiz ID
the "minimum acceptable score" field must be a percentage. I entered "100", but enter whatever you like.
I've tested it, and the requirement does disappear after you pass the quiz. I have not tested the failing option yet though, but I imagine it is ok as well, I'll post again if it isn't.
Thanks so much for all your help Alfa1. Let's hope someone updates these mods, I'll be looking forward to it.
Here we go again. For some reason, all of a sudden, it doesn't recognize that I have passed the quiz. It appears there may be a problem with this:
if($foruminfo['score'] <= $quiztaken['r_score'])
or, more to the point this:
$quiztaken['r_score']
Everything works great except if I pass the quiz I keep getting re-prompted to take it when I attempt to post a thread.
I does recognize when I have failed the quiz, however.
I looked for the phrase r_score and found nothing, as usual. Feels good to be doing someone else's work for them, especially when I have no clue what I am doing. Here I thought I was going to be running a forum, not coding one. If I cannot fix this I am going to suggest that this hack be sent to the graveyard, and I'm going to avoid any of amy's hacks from now on. They have, so far, wasted 4 days of my time, and it appears they are going to continue to do so.
Alfa1
06-14-2008, 09:15 PM
Yes, too have what I need. A link to the correct quiz would be nice, but the band-aid solution will do as well.
Here are my phrases:
You have not passed the quiz, needed to enter this forum.
<br>You need to prove your knowledge first
<br><br>
<a href="quiz.php?do=Cat&id=1">Click here to take the quiz. </a>
You have not taken the quiz, needed to enter this forum.
<br>You need to prove your knowledge first
<br><br>
<a href="quiz.php?do=Cat&id=1">Click here to take the quiz. </a>
ThanX TFEX.
EDIT: I saw your post too late. I am currently wrestling with this in another way: once the quiz is taken, it does not let the user take it again. Thus leaving the member shut out of the forum. (if a mistake is made with the quiz)
In relation to your problem: I cant help but notice that there is a problem with $foruminfo['score'] again.
Anyway: go to styles and templates -> search in templates
Then search for 'r_score'
You will land in the template quiz_leaderboard_row
{$gData['r_score']}
quiz.php is full with references to r_score:
// Insert Results
$DB->query("insert into ".TABLE_PREFIX."quiz_results
(`r_data`,`r_userid`,`r_score`,`r_forquiz`)
values
('".addslashes(serialize($Answers))."',".$vbulletin->userinfo['userid'].",$Overall,$Quiz[qid])");
// 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']}'
");
while($Result = $DB->fetch_array($Get_Results)){
$Results[] = "<a href='quiz.php?$session[sessionurl]do=UserStat&userid={$Result['r_userid']}&id={$Quiz['qid']}'>{$Result['username']}</a>";
$Average += $Result['r_score'];
$Done++;
}
I've come to the conclusion that half of this hack is missing, the rest is badly neglected and/or poorly written, and it's not worth wasting your time on. Trust me, I've wasted plenty of mine, and I am finished.
My recommendation to anyone wanting something like this, is to post a request in the "Requests for Paid Services" forum. I doubt you will get much of a response though since Inferno Quiz is no longer supported either.
If I avoided this hack in the first place, I would be much farther ahead than I am now. Please move it to the graveyard whoever, it is utterly useless.
Alfa your problem with users being shut out is solved here
https://vborg.vbsupport.ru/showthread.php?t=83130&page=38
have a look at the last post. I wish you the best of luck, I am done with this, my kids miss me, and I am getting nowhere after 4 days. One gong-show after another. Save yourself the time.
Alfa1
06-14-2008, 10:44 PM
Many thanks for that solution!
I cant reproduce the error you are getting. I have tried it with various accounts and settings, but it seems that it works for me. Please check your quiz results and settings.
holy tunnel-vision batman.
It works for me as well now. I had forgotten that the forum I am using it on does not allow registered users to post new threads, only reply to them. The answer was in my forum permissions. As soon as I logged in as admin and posted a thread for my test account to reply to, everything was green. I am going to run through it all again just to be sure. I WILL post the results and we'll know beyond a doubt that this hack is useable or not.
Ok I re-tested and the fail option works fine, but I still get stuck in a loop after that, meaning every time I go to reply to a thread I get told I have not yet passed the quiz... yada yada
Seems this is a result of the results from all of "test's" tries remaining in the moderation queue. I would like to bypass this altogether anyhow, and it is an inferno issue, not for this hack. I believe we are done here... I might have said that before though... :)
I believe I also said one gong-show after another... I hold to this.
Chadi
07-19-2008, 09:10 PM
Option is showing up mixed in with Goldbrick mod. Can you please fix this or explain how to fix this?
This of course is in the forum manager area
Alfa1
07-20-2008, 12:31 PM
This mod is unsupported. Your best bet would be to contact the coder of the goldbrick mod and ask if he can provide a fix.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.