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)

Emmy2 05-14-2004 10:48 AM

LOL, you caught me off-guard! I'm still fiddling with my Quiz Center and have a lot of wonky display (haven't released it to my members yet) but give me a day or two and I'll set up a quiz and a test user account if anyone wants to have a look.

Emmy2 05-14-2004 12:49 PM

STOP THE PRESSES!!

There is another way to do this without using html!!!

I just kept thinking about the process....what the change in code was essentially doing was telling the system to parse the question text field just like it parses text in the forum specified (in my case forumid 13). So, because I enabled html in forum 13 it would parse any html I entered in the quiz question, and hence display my images.

BUT, I got to thinking......maybe the problem with using the vbcodes (in my case using vbcodes didn't work...I just got the image url as a link) was because it wasn't told what forum to mimic for parsing vbcodes. In other words.....if I have vbcode enabled in forum 13 and I tell it to mimic forum 13 (by replacing the X in the previous code) and then I USE vbcode in the quiz question will it work? The answer is YES!!!! I tried it! (so actually right now, I can use both html and vbcodes to insert images....unless I remove the html permissions for forum 13).

So for anyone who can't get images to show up in quiz questions using vbcode (ie. you get a link instead of an image) all you need to do is tell it to mimic one of your forums that has vbcode enabled (all of mine do, so any forum number will work) and then use VBCODE to insert your images!!!

I prefer this method as I'm always hesitant to enable html anywhere, even for other mods/admins.

Where's the happy dancing emoticon??? :p

Emmy2 05-14-2004 03:27 PM

ok, this is very very rough but I've put a quiz up on my site that uses images (the first image is posted using html, the second using vbcodes...so you can see both work with the modification). I've also created a test account for anyone who wants to log in to view the quiz.

I'm putting the information inside code tags so I only get vbulletin traffic....also, I will remove the test account after a bit so if you miss the trial period you'll have to register to the site.

PHP Code:

The test account is....

usernamevbulletin
password
vbtest

Address 
for a quiz using images....

[
url]http://bonanzaworld.net/forums/quiz.php?s=&quizid=6[/url] 

I'm sure I could do a lot more with the code and tags (like centering the image etc.) but this is just a rough mock-up.

Emmy2 05-14-2004 03:36 PM

My brain is still working here.....

I wonder if it's possible to use images in the ANSWER fields. For example, the question is "Which of the pictures below is the winkey smiley?" and then the four choices are pictures ....

- :)
- :D
- ;)
- :(

And respondents choose the right picture by clicking the radio button next to it. Seems doable, will check it out.

lmongello 05-14-2004 04:19 PM

Looks great.. too bad it's not for vb3 :ermm:

Emmy2 05-14-2004 11:56 PM

Yes it is possible to put images in your answer text using a very similar modification to the script (although watch out for the replacement variable for correct_answer).

TWTCommish 05-16-2004 02:50 PM

Just to let you all know, I've fiddled with the old code a bit and so far things are going well. I've got a few new ideas that I'll be exploring. All in all it could be a few more weeks, at least, until I've got some kind of beta version out, but I'll keep at it and update you all before long.

cinq 05-16-2004 03:21 PM

Fantastic Chris :D
Using the existing version, can't wait for what you have in store for us in the next :)

Emmy2 05-17-2004 01:31 PM

I really love this script and am having fun setting it up for my members to use.

Chris (or anyone if you can help) is it possible to display how many questions are in a quiz on the Recently Added Quizzes page (along with the title and description information), and on the quizid page (where it lists top scorers)? So instead of say, 9, it would say 9/10? I think I saw this on someone else's quiz page here. Right now the only place the number of questions shows up is on the Results page when it tells you you got 9 out of 10 (90%) correct. I tried a few things (just inserting the $question_count variable I found on the results page on those other pages but it didn't work....also tried $quiz[question_count] but that didn't work either....maybe cuz I'm just guessing here :p).

Is there a way to do this? Any help much appreciated!

Emmy2 05-17-2004 09:29 PM

I've got another question about vbquiz. I used the add-on below so my users can leave comments on quizzes....I have 2 questions though....one, the comments entered are displayed from oldest to newest....is there a way to have them display from newest to oldest? (essentially the opposite of what I have in the forums, but it would seem to work better for the quizzes to have the most recent comments at the top). Second, the comments just pile up infinitely...ie. they don't ever go onto a second page. Not that I'm expecting LOTS of comments on the quizzes but if over time I accumulated 40 or 50 comments that's a lot to display on one page. Anything that can be done for that?

Any help appreciated.

Quote:

Originally Posted by LangTuDaTinh
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




All times are GMT. The time now is 02:47 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.01990 seconds
  • Memory Usage 1,830KB
  • 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
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (3)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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