vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   vBQuiz 1.0 (https://vborg.vbsupport.ru/showthread.php?t=39719)

vpn 02-20-2003 01:29 AM

just installed it on 2.2.9, great hack.

i was wondering if there was any way to have "Quizzes" displayed as a category on the forum index, with the quiz categories as forums, and then the quizzes in the individual category forums, displayed as posts or something similar?

thanks.

LangTuDaTinh 02-21-2003 06:53 PM

I noticed that when user put the answer text less than the one indicated when they make their quiz, it will appear as blank.

For example: user input 3 answers per question.
but when they input answer texts for a question, they put only 2 answers,

so when they display the quiz, it will appear two answers with one blank answer.

this solution will display only two answers.

one way to prevent this is prevent from display those blank answer

here is the solution
look for this code
PHP Code:

eval("\$answerbits .= \"".gettemplate("quiz_answerbit")."\";"); 

replace with this code

PHP Code:


   
if ($answer[answertext] !="") {
          eval(
"\$answerbits .= \"".gettemplate("quiz_answerbit")."\";");



Silenced Soul 02-23-2003 01:13 AM

flawless install, beautiful usability. I love this hack :D.

Zombie-F 02-26-2003 04:38 PM

Quote:

Originally posted by LangTuDaTinh
search for

PHP Code:

    $quizzes $DB_site->query("SELECT q.quizid, q.quiztitle, q.description, q.timestamp,
                                       SUM(r.totalcorrect) AS correct, COUNT(r.resultid) AS total
                                FROM quiz q
                                LEFT JOIN quiz_results r
                                  ON (q.quizid = r.quizid)
                                WHERE q.approve  = 1
                                  
$clause
                                GROUP BY q.quizid ORDER BY q.timestamp DESC
                                LIMIT 
$start$per_page"); 

change to

PHP Code:

    $quizzes $DB_site->query("SELECT q.quizid, q.quiztitle, q.description, q.timestamp,
                                       SUM(r.totalcorrect) AS correct, COUNT(r.resultid) AS total
                                FROM quiz q
                                LEFT JOIN quiz_results r
                                  ON (q.quizid = r.quizid)
                                WHERE q.approve  = 1
                                  
$clause
                                GROUP BY q.quizid ORDER BY q.quiztitle ASC
                                LIMIT 
$start$per_page"); 


Thanks man. You rock! This will make finding a particular quiz to take 10x easier. :D

Oblivion Knight 03-07-2003 01:00 PM

After over 3 weeks of testing, I have one complaint.
Users are registering now simply to take the quizzes and not posting on the forums. I wouldn't mind this, but even users that haven't verified their e-mail address are able to take the quizzes. Is there any way to stop them from being able to do this?

Regards,
Oblivion Knight

LangTuDaTinh 03-08-2003 12:24 AM

in quiz.php, near the top u will find this line
PHP Code:

if ($bbuserinfo[userid]==0) {
  
show_nopermission();


change 0 to number of usergroup that u want them to have access
if more than 2 usergroups then use "or" between them.

Jethro 03-08-2003 03:31 AM

Okay no idea why, but figure l will add this one and work out the exact reason in due course :)

Fine looking hack btw....

Could people stop posting links to show off their site's using the quiz hack, when you need to register to view those links. :confused:

lynda 03-08-2003 01:05 PM

I didn't want to wade through 46 pages, but I had to make an adjustment in order for the percentages to work right. The % correct at the bottom was showing the right amount, but the % correct at the top was not (on the results page) It was showing 6 out of 6 - 102%

Anyway, here's the change I made, if it hasn't already been documented:

Find:
PHP Code:

    $avg  round($all $number2);
    
$base round(100 $question_count);

    
$multiplied_total   $total $base;
    
$multiplied_average round($avg $base);

    
$total_bar_multiply     $multiplied_total $resultsbarmultiply;
    
$avg_total_bar_multiply round($multiplied_average $resultsbarmultiply); 


Change to:
PHP Code:

    $avg  $all $number;
    
$base 100 $question_count;

    
$multiplied_total   ceil($total $base);
    
$multiplied_average ceil($avg $base);

    
$total_bar_multiply     $multiplied_total $resultsbarmultiply;
    
$avg_total_bar_multiply ceil($multiplied_average $resultsbarmultiply); 


Zachery 03-08-2003 06:16 PM

.

auz1111 03-08-2003 11:07 PM

for some reason when I enter the author name in the ACP it does not get added to the database. everything else works fine. any suggestions?

LangTuDaTinh 03-08-2003 11:18 PM

author name must be userid not username.

check out my quiz section

http://www.phimviet.com/forums/quiz.php

user: test
pas: test
or

add quiz section
http://www.phimviet.com/forums/quizzes/index.php

auz1111 03-08-2003 11:22 PM

1.how do i get my userid. what is the difference in username and id? sorry if the question sounds stupid :(

2. Also... is there a way to erase a users quiz entry or entries if they take it more than once

LangTuDaTinh 03-09-2003 01:58 AM

1. u can get your userid from the link to your profile
ex
https://vborg.vbsupport.ru/member.ph...o&userid=23582

as u can see, your userid on this forum is 23582

usename is "auz1111"

Userid use to is just like your ss#, and username is just like your name....heheeh

2.. quiz entry? u can remove any quiz or quiz's question from your admin cp.

auz1111 03-09-2003 02:16 AM

thanks.

i mean can i delete when someone answers a quiz. say if i answer a quiz 3 times it shows my three scores. I want to delete 2 of the quiz entries i made. thanks again

LangTuDaTinh 03-09-2003 06:01 AM

yes u can do that but currently this script doesn't have that option.

u can set quiz option in your admincp to prevent user from taking those quiz more than 1 times.

however there is another option, u can go to to database and delete it.

auz1111 03-09-2003 10:59 PM

Is there any way to edit or delete the pictures uploaded for a quiz?

LangTuDaTinh 03-09-2003 11:40 PM

it's possible but i don't think it's added in this hack.

have u check modify quiz fuction in quiz admin cp?

auz1111 03-11-2003 03:28 PM

yep...seems like there should be a spot to reupload the pic or delete.

InnerSelf 03-14-2003 04:51 PM

is there also a way to see (if you are admin) to see what the members replied.

would be cool aswell

LangTuDaTinh 03-14-2003 05:22 PM

seee what members replied???? i don't understand your question.

auz1111, if u want i can help u add that option.

InnerSelf 03-14-2003 08:59 PM

wrong word, i ment the asnwer on the quiz-question.

hard to speak english sometimes :)

LangTuDaTinh 03-14-2003 10:36 PM

PHP Code:


//- Add a new table 

CREATE TABLE `quiz_comments` (
  `
cidint(10NOT NULL auto_increment,
  `
quizidint(10NOT NULL default '0',
  `
useridint(25NOT NULL default '0',
  `
dateint(11NOT NULL default '0',
  `
commentstext NOT NULL,
  
PRIMARY KEY  (`cid`),
  
KEY `cid` (`cid`),
  
KEY `userid` (`userid`),
  
KEY `id` (`quizid`)
TYPE=MyISAM;

//- find in quiz.php --------------

MORE WITH THIS SCORE

//- add above it-------------------


// ------------------------------------- DELETE COMMENTS START--------------------------------------------
if ($action=="delcomment"
{
    if (
$bbuserinfo['usergroupid']==6)
        {
            
$DB_site->query("DELETE FROM quiz_comments
                         WHERE cid = '
$cid'");
                           
        }
     eval(
"standardredirect(\"".gettemplate("quiz_comments_delete")."\",\"quiz.php?s=$session[sessionhash]&quizid=$quizid\");");

}

if (
$action=="savecomment")
    {
        
$time time();
         
$quiz $DB_site->query("INSERT INTO quiz_comments (cid, quizid, userid, date , comments) 
                            VALUES (NULL,"
.intval($quizid).", ".intval($userid).", ".time().", '".addslashes($comments)."')");
        eval(
"standardredirect(\"".gettemplate("redirect_postthanks")."\",\"quiz.php?s=$session[sessionhash]&quizid=$quizid\");");
    }


// ------------------------------------- DELETE COMMENTS END --------------------------------------------


//- find in quiz.php --------------

    
$time time();
    eval(
"dooutput(\"".gettemplate("quiz_display")."\");");


//- add above it-------------------


//////////////////////////////////////////////////////////////////////////////////////////////////////////
    
$quizcommentr $DB_site->query("SELECT r.comments, r.date, r.cid,
                                             u.userid, u.username
                                      FROM quiz_comments r, user u
                                      WHERE r.quizid = "
.intval($quizid)."
                                        AND r.userid = u.userid
                                      ORDER BY r.cid ASC
                                      "
);

        while (
$quizcomment $DB_site->fetch_array($quizcommentr)) 
            {
                
$quizcomment[comments] = bbcodeparse(stripslashes($quizcomment[comments]));
                
$cid=$quizcomment[cid];
                  
$quizcomment[date] = vbdate("$dateformat$timeformat"$quizcomment[date]);
                  
                if (
$bbuserinfo[usergroupid]==6
                    {
                        
$quizcommentdel ="<smallfont color=\"#008080\">[<a href=\"quiz.php?s=$session[sessionhash]&quizid=$quizid&action=delcomment&cid=$cid\">Delete</a>]</smallfont>";
                    }  
                if(
$quizcomment[comments]!="")
                    {
                          eval(
"\$quizdisplaybit .= \"".gettemplate("quiz_comments_displaybit")."\";");
                    }
 
            }
                eval(
"\$quiz_display = \"".gettemplate("quiz_comments_display")."\";");

           

//////////////////////////////////////////////////////////////////////////////////////////////////////////


ADD NEW TEMPLATES


//------------ADD NEW "quiz_comments_delete 

Comment deleted successfullyyou will return to the quiz.



//------------ADD NEW "quiz_comments_display 

  
<table width="100%" cellpadding="4" cellspacing="0" border="0" bgcolor="#9999FF">
    <
tr bgcolor="#9999FF">
      <
td colspan="2" width="100%" valign="middle"><normalfont color="#000000"><b>Quiz Discussion</b></normalfont></td>
    </
tr>

    
$quizdisplaybit

  
</table>

//------------ADD NEW "quiz_comments_displaybit"

  
<tr bgcolor="#13486D" >
    <
td width="100%" valign="left"><smallfont color="#008080"Posted by: <a href="member.php?s=$session[sessionhash]&action=getinfo&userid=$quizcomment[userid]"><b>$quizcomment[username]</a></bon $quizcomment[date] </smallfont></td><td valign="right">$quizcommentdel</td>
  </
tr>

  <
tr width="90%" bgcolor="#1C5780">

    <
td colspan="2" width="100%" valign="left"><normalfont>$quizcomment[comments]</normalfont></td>
  </
tr


auz1111 03-15-2003 03:38 PM

Quote:

Yesterday at 07:22 PM LangTuDaTinh said this in Post #700
seee what members replied???? i don't understand your question.

auz1111, if u want i can help u add that option.

I would love that option! I don't have hardly any experience with PHP besides copying and pasting at the moment. I can understand some of it, but I have never written anything so your help would be very appreciated. :)

Jethro 03-16-2003 06:12 PM

Hack installed with 0 problems on our vb 2.2.6 board :)

kevinnguyen 03-19-2003 01:31 AM

Quote:

03-14-03 at 06:51 PM InnerSelf said this in Post #699
is there also a way to see (if you are admin) to see what the members replied.

would be cool aswell

hello DCN, hehe, know me?
nice to meet u here
btw, i installed it already and when i type .../quiz.php
it only shows a blank page
damn

kevinnguyen 03-19-2003 01:47 AM

hella hate, i guess it's becuz of my style
gonna figure it out rite now

DarkDraco07 03-19-2003 03:22 AM

is it possible for members to make a quiz and get it moderated yet?

LangTuDaTinh 03-19-2003 03:50 AM

Quote:

Today at 03:31 AM kevinnguyen said this in Post #705


hello DCN, hehe, know me?
nice to meet u here
btw, i installed it already and when i type .../quiz.php
it only shows a blank page
damn


ehehee where's your site?

DarkDraco07, yes it possible,

kevinnguyen 03-19-2003 03:56 AM

keke, i have been a member of ur site rite for a few months
my site? damn, i've just screwed it up 3 days ago cuz of my silly mistake
now im recovering it but use vbb instead of ibf
thats why i dun have much exp on vbb

LangTuDaTinh 03-19-2003 04:00 AM

eheeh, never try ibf so i don't know but vbb is much easier. about 5 months ago, i don't even know 1 php code. now i'm getting better...hehe what' was happen? did u erased your database? i did that one....

kevinnguyen 03-19-2003 04:09 AM

oh man, my pain
i spent months to build my site
i added tons of cool hacks (shop, bank...) for ibf
and i killed it within 1 nite
damn, i misuploaded a file and didnt know that to backup
the next morning when i noticed that, holy, it was too late
now i have to start over, not really cuz db is still there
i had my friend convert db from ibf to vbb

yeah, hehe, same here, 5 months ago i dun even know how to install a forum
but now i have much exp about PHP and MySQL, especially for IBF
I added severel mods on Ibresource (mod site like this one)
IBF is good, but it easily gets hacked if you are newbie
anyway im a newbie of VBB

DarkDraco07 03-19-2003 06:22 PM

Quote:

DarkDraco07, yes it possible, [/B]
is it in the download or is it a reply? can u please link me to it if its a post cuz i couldnt find it

LangTuDaTinh 03-19-2003 06:55 PM

no, i modified it by myself , give me your email, i will send u the script.

do u want members able to approve their own quiz or only u can do it? cause right now my script alllow members to approve their own quiz. but i can change that.

to kevinnguyen, goodluck man, reinstall all the hack is pain in the ass...u will need at least 3 or more days if your board is heavily hacked. give me your website link when u done...i wanna see it ehheeeh...what is your vbb style? i want to change my style but don't have much time....and not very good /w graphic software....

DOTS 03-20-2003 09:27 AM

hi,
this is going to sound stupid i know
but i cant find anywhere to add the quiz'es im driving crazy!
theres nothing but some options in Admin CP
and when i go /quiz.php it says theres no added quizes
where do i add the quizes and i manage the stuff? please help this hack seems awesome but i cant add anything
thanks

DOTS 03-20-2003 09:31 AM

nevermind im an a stupid ass
i did 1 step wrong.
sorry to bother you whit my stooooooopid questions
awesome hack man. :bandit:

Jitway 03-20-2003 03:59 PM

Awesome hack there. Now to put all my mods and co admins to work. :cheeky:

sabret00the 03-20-2003 04:14 PM

Quote:

Yesterday at 08:55 PM LangTuDaTinh said this in Post #713
no, i modified it by myself , give me your email, i will send u the script.

do u want members able to approve their own quiz or only u can do it? cause right now my script alllow members to approve their own quiz. but i can change that.

won't you realise it as i'd also be interested in using this, if it uses the style sets and not the mod panel colour settings

kevinnguyen 03-21-2003 02:10 AM

Quote:

03-15-03 at 12:36 AM LangTuDaTinh said this in Post #702
PHP Code:


//- Add a new table 

CREATE TABLE `quiz_comments` (
  `
cidint(10NOT NULL auto_increment,
  `
quizidint(10NOT NULL default '0',
  `
useridint(25NOT NULL default '0',
  `
dateint(11NOT NULL default '0',
  `
commentstext NOT NULL,
  
PRIMARY KEY  (`cid`),
  
KEY `cid` (`cid`),
  
KEY `userid` (`userid`),
  
KEY `id` (`quizid`)
TYPE=MyISAM;

//- find in quiz.php --------------

MORE WITH THIS SCORE

//- add above it-------------------


// ------------------------------------- DELETE COMMENTS START--------------------------------------------
if ($action=="delcomment"
{
    if (
$bbuserinfo['usergroupid']==6)
        {
            
$DB_site->query("DELETE FROM quiz_comments
                         WHERE cid = '
$cid'");
                           
        }
     eval(
"standardredirect(\"".gettemplate("quiz_comments_delete")."\",\"quiz.php?s=$session[sessionhash]&quizid=$quizid\");");

}

if (
$action=="savecomment")
    {
        
$time time();
         
$quiz $DB_site->query("INSERT INTO quiz_comments (cid, quizid, userid, date , comments) 
                            VALUES (NULL,"
.intval($quizid).", ".intval($userid).", ".time().", '".addslashes($comments)."')");
        eval(
"standardredirect(\"".gettemplate("redirect_postthanks")."\",\"quiz.php?s=$session[sessionhash]&quizid=$quizid\");");
    }


// ------------------------------------- DELETE COMMENTS END --------------------------------------------


//- find in quiz.php --------------

    
$time time();
    eval(
"dooutput(\"".gettemplate("quiz_display")."\");");


//- add above it-------------------


//////////////////////////////////////////////////////////////////////////////////////////////////////////
    
$quizcommentr $DB_site->query("SELECT r.comments, r.date, r.cid,
                                             u.userid, u.username
                                      FROM quiz_comments r, user u
                                      WHERE r.quizid = "
.intval($quizid)."
                                        AND r.userid = u.userid
                                      ORDER BY r.cid ASC
                                      "
);

        while (
$quizcomment $DB_site->fetch_array($quizcommentr)) 
            {
                
$quizcomment[comments] = bbcodeparse(stripslashes($quizcomment[comments]));
                
$cid=$quizcomment[cid];
                  
$quizcomment[date] = vbdate("$dateformat$timeformat"$quizcomment[date]);
                  
                if (
$bbuserinfo[usergroupid]==6
                    {
                        
$quizcommentdel ="<smallfont color=\"#008080\">[<a href=\"quiz.php?s=$session[sessionhash]&quizid=$quizid&action=delcomment&cid=$cid\">Delete</a>]</smallfont>";
                    }  
                if(
$quizcomment[comments]!="")
                    {
                          eval(
"\$quizdisplaybit .= \"".gettemplate("quiz_comments_displaybit")."\";");
                    }
 
            }
                eval(
"\$quiz_display = \"".gettemplate("quiz_comments_display")."\";");

           

//////////////////////////////////////////////////////////////////////////////////////////////////////////


ADD NEW TEMPLATES


//------------ADD NEW "quiz_comments_delete 

Comment deleted successfullyyou will return to the quiz.



//------------ADD NEW "quiz_comments_display 

  
<table width="100%" cellpadding="4" cellspacing="0" border="0" bgcolor="#9999FF">
    <
tr bgcolor="#9999FF">
      <
td colspan="2" width="100%" valign="middle"><normalfont color="#000000"><b>Quiz Discussion</b></normalfont></td>
    </
tr>

    
$quizdisplaybit

  
</table>

//------------ADD NEW "quiz_comments_displaybit"

  
<tr bgcolor="#13486D" >
    <
td width="100%" valign="left"><smallfont color="#008080"Posted by: <a href="member.php?s=$session[sessionhash]&action=getinfo&userid=$quizcomment[userid]"><b>$quizcomment[username]</a></bon $quizcomment[date] </smallfont></td><td valign="right">$quizcommentdel</td>
  </
tr>

  <
tr width="90%" bgcolor="#1C5780">

    <
td colspan="2" width="100%" valign="left"><normalfont>$quizcomment[comments]</normalfont></td>
  </
tr


did wat your told but dun see anything! why?

kevinnguyen 03-21-2003 02:14 AM

Quote:

03-19-03 at 08:55 PM LangTuDaTinh said this in Post #713
no, i modified it by myself , give me your email, i will send u the script.

do u want members able to approve their own quiz or only u can do it? cause right now my script alllow members to approve their own quiz. but i can change that.


to kevinnguyen, goodluck man, reinstall all the hack is pain in the ass...u will need at least 3 or more days if your board is heavily hacked. give me your website link when u done...i wanna see it ehheeeh...what is your vbb style? i want to change my style but don't have much time....and not very good /w graphic software....

yeah, ur style is so boring man
but if you change a new one, you have to install all ur hack again
paintfull!

LangTuDaTinh 03-21-2003 03:18 AM

hehe i know, orginal vb style is ++++....i can pay $30 to $50 for a new style but i wanna make my own...but i don't have time yet.

hey your style is not bad..... where did you bought it?...

about quiz, i think i forgot one little code in quiz_display

PHP Code:

        <!-- ------------quiz comment------------------- -->
<
form action="$homeurl/forums/quiz.php?s=$session[sessionhash]&quizid=$quiz[quizid]method="post">
<
textarea name=comments rows=7 cols=70></textarea><br>
    <
input type=hidden name="action" value="savecomment">
   <
input type=hidden name="quizid" value ="$quiz[quizid]">
     <
input type=hidden name="userid" value ="$bbuserinfo[userid]">
    <
input type=submit value="Post Comment">
    </
form>
        <!-- ------------
quiz comment------------------- --> 

Quote:

won't you realise it as i'd also be interested in using this, if it uses the style sets and not the mod panel colour settings
if you want your own style sets then this one is no use for u, cause you have use change most of the code or rewrite the whole script. if i have time will would make it more professional..but...


All times are GMT. The time now is 11:33 AM.

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.05860 seconds
  • Memory Usage 1,988KB
  • 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
  • (10)bbcode_php_printable
  • (9)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (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