Writing software and articles to help improve understanding. – Larry Battle
RSS icon Email icon Home icon
  • jQuizMe 2.0 Released.

    Posted on July 5th, 2009 Larry 78 comments

    Hey everyone,

    jQuizMe 2.0: Features a everything you need to make a javascript quiz online.

    After a few months of programming I’ve finally finish jQuizMe. It took a some time to get done but it feels rewarding.

    Anyhow, jQuizMe 2.0 is at code.google now.

    http://code.google.com/p/jquizme/

    Share and Enjoy:
    • Print
    • Digg
    • Sphinn
    • del.icio.us
    • Facebook
    • Mixx
    • Google Bookmarks
    • DZone
    • Kirtsy
    • LinkedIn
    • Slashdot
    • StumbleUpon
     

    78 responses to “jQuizMe 2.0 Released.” RSS icon

    • JQuizMe looks like a really cool plug-in to generate quizzes & am looking forward to use it soon.

      Seems like there is a small bug though. The demo –> http://bateru.com/jquery/jquizme2/demo3.html breaks for the questions having an input box.
      e.g Question –> What is the value of x?
      x = 9 + 8 + ’7′

      • hey m having trouble saving the result to database can anyone out there dictate me how to retrieve the final answer and store it to the database. i need help pls!

    • Thanks for the report.
      Fixed this issues in jQuizMe 2.0.2 and updated site.

      Enjoy jQuizMe.

    • Gary McCafferty

      Hi,
      I’m following up on the question I posted on the google code wiki page regarding an option to ask the user to try again if they get answer a question incorrectly. (http://code.google.com/p/jquizme/wiki/HowToUse)

      It would be great if it was an option on a quiz by quiz or even question by question basis. I am creating an e-learning course for a university assignment and we’ve been told that it can be good idea to let the learner have another try. Not for every question, e.g. those with only 2 options, but sometimes it would be desirable.

      Ideally I would like the option to give the learner a hint along with the second chance.

      Keep up the good work.

    • Is there a way with your quiz where if the user answers x amount of questions correctly, the browser auto redirects to a new page.

    • @Gary McCafferty
      Ok. About your feature. I’m adding a option that will allow for the user to try again or move on to the next question if their answer is wrong. However, for hints, you can provide that in the questions.

      @Adam
      Yes. options.statusUpdate would enable you to do so. However there is a small bug in it. So wait until 2.0.3 is release to used it. I’m also going to update the documentation soon.

      options.statusUpdate = function( isQuizOver, stats ){
      if( stats.right.length > 1){
      document.location = "http://www.google.com";
      }
      };

    • Just wondering if there is any way in the future that there might be a point value system incorporated, e.g. question one is worth 1 point, question two is worth 2 points, etc.

      Thanks!

      • In the next release you will be available to by using the options.statusUpdate function.
        Because that function will give you all the status information that you need to create a function for your needs.
        Please bear with me. I’m currently studying like crazy to pass my finals this week. So wait until this weekend to see an updated release.

        I’ll add a tutorial that goes over this for you mike.

    • Awesome job Larry!

      Your quiz is really really slick :)

    • Gary McCafferty

      Hi Larry,
      I posted an issue on google code. There’s a problem the way jQuizme handles entities in answers.

      I’ve explained it in detail here: http://code.google.com/p/jquizme/issues/detail?id=3

    • Hi Larry,

      I am wondering something regarding the review window. How would I be able to put some text next to the checkbox? I looked through the jquizMe-packed.js file and wasn’t sure where to find it.

      Thanks!

    • @Gary McCafferty:
      Yeah, you’re right. What happens is that jQuizMe get the user answer from the html file and not from the index of the right answer. So the special characters is converted to a html tag, which changes the user’s answer. I’ll look into it.

      @mark:
      Read the jQuizMe-uncompressed.js file to understand it.
      Search for the first following match
      ” *”
      and replace it with what you want.
      “Missed * ”

      @Everyone
      I’m halfway done with the updates for jQuizMe but I got stuck with examinations for college and moving. Bare with me.

    • http://talktomartyb.com/anger-assessment.html

      How do I get rid of the “=” signs under each questions?

    • @ Chris Siebels
      Thanks for the website link. It really did help at solving your problem.

      Solution:
      Change the ans:”" } part of the quiz types to ans: true }
      Your answers are strings. Change them to a boolean.
      ans: “” is a string.
      While, ans: true or ans:1 is a boolean.

      Why?
      In the true or false quiz type, if you answer is a true or false, then your questions will not be modified. Otherwise, they will be compared with other answer to form a true or false statement.

      More technical answer:
      The = appears because if your answer is not a boolean, then it will make up a question by comparing other answers from the quiz type section of the object.

    • Thanks Larry, that worked! Great plugin!!

    • Hi Larry!

      This plugin is absolutely fantastic! I develop websites with a company that offers online education for “at risk” students. This is a great way to allow them to practice some exercises before the exam!

      so far, so good. This accomplishes everything i was hoping to do. I keep running into, what seems to be a minor snag that i was hoping you could help with.

      In some of the questions i need to put a button graphic, with a rollover effect, that plays an audio file. I typically use this in the head of my html doc:

      $(document).ready(function(){
      $(“.flashplay”)
      .hover(function(event){
      $(this).attr(“src”, “playButton_on.gif”);
      },
      function(event){
      $(this).attr(“src”, “playButton_off.gif”);
      });
      });

      The “snag” is that this will work properly when hitting “begin quiz.” As soon as you hit next, the jquery statement stops working. I know that i need to add the jquery function somewhere else, but i am new to jquery and wasn’t sure where to put it. So far, everything i have tried has not worked.

      Any help would be wonderful. Thanks for all of the hard work! This is a really awesome plugin! Nice job!

    • Hi again,

      I had one more question. Is there any way to have more than 1 quiz on a page? We use several quizzes throughout one page/lesson. I am having a problem with adding more than 1 quiz. Any help would be wonderful.

      Thanks again for all of the hard work! This really is a nice app you created.

    • # After restart, quiz switches to last.
      - You’re right. That is a bug. The bug is jQuizMe misused the $.extend function.
      The bug is fix now. But I will release the fix after this weekend.
      Here’s the fix if you want to do it yourself.

      From: jQuizMe-uncompressed.js, line 167
      //## Old Code
      var settings = $.extend( _settings, options ), lang = $.extend( true, _lang, userLang );
      //## End of Old Code

      //## New Code
      var settings = $.extend( {}, _settings, options ), lang = $.extend( true, {}, _lang, userLang );
      //## End of New Code

      # Audio with jQuizMe
      - Use jPlayer to add audio to your website.
      http://www.happyworm.com/jquery/jplayer/

      # Rollover issues
      - When a quiz restarts or moves to the next problem, the element event or the “binding” event get ereased.
      To solve this problem use the “live” event, instead of normal binding actions. This makes sure that new elements will all maintain the same event properties.
      jQuery live: http://docs.jquery.com/Events/live

      Change your code to the following:
      From: sample.html
      //## Old Code
      $(“.flashplay”)
      .hover(function(event){
      $(this).attr(“src”, “playButton_on.gif”);
      },
      function(event){
      $(this).attr(“src”, “playButton_off.gif”);
      });
      //## End of Old Code

      //## New Code
      $(“.flashplay”).live( “mouseover”, function(e){
      $(e.target).attr(“src”, “playButton_on.gif”);
      }).live( “mouseout”, function(e){
      $(e.target).attr(“src”, “playButton_off.gif”);
      });
      //##End of new code

      Hope that helped.
      Donations are welcomed.
      http://pledgie.com/campaigns/3174

      Thanks for your time,
      Larry Battle

    • Hi,

      Excellent quiz – worth more than $10!

      I need to direct students to a specific page, or give them feedback based on the range their score falls into. I didn’t follow the explanation about options.statusUpdate – could you please clarify or point me at any documentation?

      Thanks!

    • Larry,

      I am so sorry for the delay in a great big THANK YOU!!!! Your suggestions/fixes solved everything.

      I have been playing with jquizme quiz a bit including skinning/customizing it. Man, you did a fantastic job in thinking ahead and making it VERY flexible! It is very easy to follow follow your code and with your comments (and css classes defined in jquizme) you have made it very easy to style whatever i want. You really thought this through! This is a top notch project and very professional. Thanks for your hard work and sharing it with us.

      I really appreciate you taking the time to help me out. Donation definitely coming your way.

      Thanks again!

      • Thanks for your comment!
        Yeah, I’ve tried my best to make jQuizMe both fast and readable. But doing so takes a LOT of time, and IE 6 doesn’t help.

    • I see the pledgie campaign is closed. Where can I make my donation?

      Thanks again!

    • Hi Larry,

      I am working on a quiz using JQuizMe where one of the questions has an “All of the above” option (the whole quiz is of the multiList type). The answers to each question are automatically randomized which defeats the purpose of the “All of the above” option as it doesn’t always appear last in the list.

      I looked through the wiki at code.google.com for the option, tried setting allRandom and random to false but that did not work.

      How can I get the options for a question to appear in the same order every time?

      • Hey Tony,
        You’re right. Multiple choice questions are always randomized. Since there is no option or feature for setting the answer’s position, I’ll include that in the next release.

        Also, the random and allRandom options are for question order and not answer order. But I might change the names to make that more clear.

        Thank you for your comment and helping me improve jQuizMe.

    • Hi Larry,

      I am trying to send you a donation and couldn’t figure out how. I went to the page but didn’t see an option other than the 6 month pledge? I could be missing something. Can you let me know? I definitely want to help you out.

      I will send you a sample of what i have so you can see how others(me) are using jquizme. I wanted rounded corners, drop shadows, etc. So i added a bunch of divs to the source. Turned out quite nice!

      I was having one problem though. I am having a hard time getting IE7 & 8 to obey the animationType(0, 1, or 2). I wanted to use the fade animation so i changed it to 1 in the source(to experiment). It works great in FireFox but IE7 and IE8 just keep using the default. Also, when i call it by using “options” when setting up the quiz it works in FF but not IE. Maybe i am not calling it right?

      anyway, thanks again for this terrific app!

    • Nevermind. :o ) I figured it out. It looks like the checkAnimation function had a line targeting IE. I changed this value to from 0 to 1 and now the fades work.

      Still need to know how to give you money. :)

      • Hey Shae,
        The reason why checkAnimation will disable animation selection for IE is because there is a CSS bug with IE6 and sometimes with IE7. However IE 8 work right. So I will adjust this setting in the next release.

        IE BUG:
        Start quiz, then restart.
        Now, go through the questions and the quiz should will become deformed on one of the questions.

        Now about donating,
        Donations can be made at the following link.
        http://pledgie.com/campaigns/6475

        The old donation fund ended, so I started a new one that will last for 6 months.
        Note: Pledge.com just take donations, which are called pledges. So if you donate, it’s a one time thing, and not a reoccurring payment.
        If I’m wrong, then I’ll refund your money and fix the problem.

        • ah. i totally see what you mean. The second time through, for me, the hidden info boxes start popping up when they aren’t supposed to. bummer. thanks for the info!

          thanks for the donation info too. Checking it out now.

    • Hey great module!

      I am curious, is there any way to customize the summary to include a “go to the next chapter” button?

      I want to put several quizzes on one page, each embedded in a chapter. Chapters are div’s and I am using jquery to go from one to the next. I only want users to see the next button if they score a certain percentage.

      I checked the http://code.google.com/p/jquizme/wiki/HowToUse manual, but did not see any custom summary message where I could add the “gotonext” button code.

      Thank you so much for your amazing work on this!!

      • Hello,
        If I understand correctly, you want a function that will give you the score of a completed quiz, in order to see if the grade is passing or not.
        options.statusUpdate will fix that problem. But there is a small bug with it.
        Here’s how to fix it. Fix

        Hey Everyone,
        * Heavy exams in college have been taking all my time these past few months. Sorry for not releasing earlier.
        Please check back on monday for the next release of jquizme.

    • jQuizMe 2.1 was released.
      Check it out at google code, jQuizMe

    • I went through the docs and these comments and forgive me if I skipped over it. I’m looking for a way to grab the answer that the user selects or types. I’d like to merge this with another quiz app I have built that records the user’s answer in a database… any tips or pointers or is this possible?

      • Hello John,
        That’s a great idea for a new addition to the next update. I thought something was missing.
        Here’s the quick fix.
        File: release jQuizMe 2.1/js/jQuizMe-uncompressed.js
        Line: 530 -> in function sendStatus.
        Add: “userAns”: userAns.concat(),

        //# Old Code
        var quizInfo = {
        “right”: stats.rightAns,
        //# End of Old Code

        //# New Code
        var quizInfo = {
        “userAns”: userAns.concat(),
        “right”: stats.rightAns,
        //# End of New Code

        userAns is an array of all the user’s responses. The userAns indexes corresponse to right and wrong indexes. Read the below to better understand.

        Usage:

        var options.statusUpdate = function( info, currQuiz ){
        if( info.hasQuit ){
        alert( info.userAns );
        alert( info.right ); // List of right indexes.
        alert( info.wrong ); // List of wrong indexes.
        alert( info.userAns[ info.right[ 0 ] ] || ‘no right answers.’); // This is the first right answer.
        alert( info.userAns[ info.wrong[ 0 ] ] || ‘no wrong answers.’); // This is the first wrong answer.
        }
        }
        $( el ).jQuizMe( quiz, options );

        Hoped that helped.
        Help promote jQuizMe!
        - Larry Battle

        • Thanks a ton. I actually should of downloaded the zip but instead I viewed your source and copied the js from your source URLs. Anyways – got the uncompressed version and that opened it right up – now I can follow along :-)

          This array will work. I’m using ColdFusion in the backend and will use a cfc and jquery to post to the server each answer without having to go to another page.

          Great work and thanks more then a ton

    • Hey Larry,

      I just dropped you a donation. Thanks again for your help and work on this project. I have had a lot of fun with it and have also learned a lot about jquery.

      In my experimenting I was having a problem that i was hoping you could help me with. I have been experimenting with some Spanish quizzes. Obviously there are a number of special characters in Spanish. JQuizMe handles these characters just fine unless the special character is the last character in the answer. For instance, if the answer is “está” it will be flagged as a wrong answer even when you typed it in correctly (ALT+0225). This only happens when the accent is the last character in the answer. For instance “estás” works just fine without any problems.
      I did notice that the answer would show as correct if i added a space (spacebar) after the last character (where you type the answer in the input field – the actual answer in the js does not have the space). I was going to try to append a nbsp; to the answer (when the check btn is clicked) but figured i should ask you in case you know of a more practical way around it.

      Thanks again for all the work. I will keep the donations coming when i can.

      • Hey Shae,
        Thanks a lot for the donation!!

        Could you send me a link to your file?
        It sounds like the encoding in your file format in set to ANSI and not UTF-8. But I’m not sure.
        Also try using options.showHTML = true; in jQuizMe 2.1.

    • Please leave new comments on the below page.
      jQuizMe 2.1 Release Page

    • Thanks for getting back so quickly. It appears that i am an idiot. I didn’t notice that there was a new release until after i posted the message. I downloaded 2.1 and all problems are resolved. You made a lot of changes! Really great ones too! Thanks again for the hard work. It’s a great project!

    • Hi Larry,

      Thanks for the great application. I have been able to put it to good use on my own website where we have an entire section for quizzes at http://www.landofcode.com/web-development-quizzes/

    • Here is another sort of test builder for giving secure tests online from any ordinary web site:

      http://mynichecomputing.org/NOnline_Test_Bldg_Kit7/autoTest.htm

    • When is ansSel used with a t/f question and why? I see one like this in the JavaScript test example and when that property is taken out of the item, the item displays improperly, but I don’t see why.

      • Thanks for all your comments.
        I’m updating the documentation this week, so everything should become more precise and informative.
        Here’s what happens on TF quizzes.
        File: jQuizMe-uncompressed.js
        line: 703
        If the answer for a question is a boolean, then that is the answer. Otherwise, a true or false question will be formed by using the ansSel( answer selections ) property, if provided, or the answers to the other questions within in the quiz type.

        By doing the above, this allows all quiz types to be interchangeable and not fixed to a curtain format.

    • In the JavaScript example quiz t/f questions you use “=” all over the place where “==” is what you certainly mean. = is always assignment. No logical comparison is done with =

    • You’re right, it should technical be “==”.

      In jQuizMe 2.1, you have the option of changing the equal sign for the true or false questions. Do the following.
      var newLang = { quiz: { tfEqual: “==” }};
      $( el ).jQuizMe( quiz, options, newLang );

    • Suggestion: You might consider adding a checkbox type, so questions may have more than one answer.

      It would also be nice if a teacher could have questions given in order, yet not all the questions of a given type in a row. (I.E., it might be nice to allow for more than one block each with a set of a given type of question. )

      You could also incorporate a secure-graded test option, where the answers would all gotten via ajax at the end of the test (like I do with my testing system — which, by the way has been ‘out there’, available to teachers for 10 years (though the ajax part is new)).

      Still, your system is very, very, nice and easy to use. I DO recommend it.

    • Larry

      Another Suggestion: You might also want to make a JavaScript Builder to build the code in the web page for a test using your system. I provide a lot of builders on my site to make things easy for teachers. Making a Builder for teachers using your great system would be very easy.

      Larz

      • - jQuizMe supports multiple answers.
        Use an array for multiple answers. This works best with fill in the blank questions.
        Ex. ans: [ "answer 1", "answer 2" ]

        - Additional quiz types
        I’ll consider adding an option and documentation for developers to make their own quiz types.

        - Security
        JavaScript isn’t secure. So PHP or another language must be used in conjunction to provide anti-hacking measurements.
        The easiest security procedure *could* be the following.

        var options = {
        review: false,
        showAns: false,
        showAnsInfo: false,
        statusUpdate: function(){
        /*
        The quiz only have questions. With each answers being “x”.
        On quit, send the user’s answers to be check using ajax and php. Then report back the score to the user.
        Refer to John L. comment above for getting user’s answers.
        */
        }
        }

        - Randomness
        Did you try settings.random or settings.allRandom?

        - GUI question maker
        If others want it, then I’ll consider it.

        Hoped that helped.
        - Larry Battle

    • Hello Larry!

      1.Can I collect the results of the quiz and send them into an e-mail after the last question?

      2.Can I have the next question depending by the previous one?
      Ex:
      Q1. Are you a male: Yes NO

      -clik on yes the second question will be: Q2. How old are you?
      -click on no the Q2 is: how tall are you?

      Thank you for your help!

    • Hi,

      Is there a possibility of implementing questions with varying marks and calculating the score as per the weightage given to individual questions ?

      Thanks & Regards
      Ritwik

    • You made some good points here.Keep us posting. What template do you use in your site

    • Good work, keep us posting, you are very good writer.

    • @Marco I know what your saying there . In the current economy its hard to find a company to work for that pays good enough to live on and is consistent. I have found that if you just work hard and are consistent you can go places . Look at the writer of this article, they are oviously hard working and have just been consistent over time and are now enjoying at least what would appear as somewhat of a success. I would encourage everyone to just keep hustling and moving forward.

    • Just looking at your post on my brand new Garmin Phone , and I wanted to check if it would let me comment or if it was going to me go to a full pc to do that. Ill check back later to see if it worked.

    • Just want to tell you that your site content is interesting, but you must improve site graphics

    • In multiList type, it’s possible to answer by just selection the radio button and not by clicking on the “check” button?
      How can I hide “quit” and “help” buttons? only with css?
      Is it possible to hide the questions when showing the result of each one?
      Many thanks!

      • Hides the quit and help buttons.

        var options = {};
        options.statusUpdate = function( info, $quiz ){
            $(".q-help").hide();
        }
        $(el).jQuizMe( quiz, options );
        

        I’ll get back to you on the other questions.

        • Thanks Larry!
          The most important one for me right now is to hide the answer’s when showing if the answer is correct or not, like question/answers – result – new question/answers.
          Thanks!

        • I updated the wiki to include too missing options.
          options.showAns and options.showAnsInfo.

          But about your problem. This will be fixed in the next release. I’ll add an option for it. The next jQuizMe should be out by next sunday, July 12.
          But… if you need it asap. Just send me an email and I’ll give you a modified version.

        • Btw, in case other people need this the params according to the wiki are others, Larry:

          statusUpdate: function( quizInfo, currQuiz ){
          $(“.q-help”).hide();
          }

          Many thanks and still waiting for you help about hidding the answer’s when showing the result :)

        • Use $(“.q-help”, currQuiz ).hide(); instead of $(“.q-help”).hide();.
          So that way you only mess with the quiz that the function is corresponding to.

      • Hey Bruno,
        Here are two hacks for jQuizMe. You need to use jQuery 1.4.2 for these to work.
        These simple hacks are taking advantage of jQuery’s delegate function.
        jQuery Delegate: http://api.jquery.com/delegate/

        1) When using the “multiList” quiz type, auto-click the check button when an answer is selected.
        Solution:
        ### Code ###
        $( “#quizArea” ).delegate( “.q-ol-li”, “click”, function(e){
        var $checkBtn = $(e.target).parent().parent().parent().parent().find( “.q-check-btn” );
        $checkBtn.click();
        });
        ### End of Code ###

        2) When using the “multiList” quiz type, hide the question and answer when showing the result of the answer selection.
        Solution:
        ### Code ###
        $(“.q-check-btn”).click( function(){
        $( e.target ).parent().parent().find( “.q-ansSel, .q-ques” ).slideToggle();
        });
        ### End of Code ###

        Note: Change “#quizArea” to the appropriate selector that contains the jQuizMe element.

    • Larry, thanks a lot!
      I’ve send you some e-mail with my situation and with a bug that I found on ans that isn’t handling arrays correctly.
      Waiting for your answer as soon as possible.
      Many thanks!

    • Hi. Thanks for this nice plugin. I try to use your plugin with Ezmark Checkbox and Radio button plugin. But because my javascripting is not good, i could figure out to make them work. Actually i can make Ezmark work in first stage as changing button, but when user click, the button does not change at all but your script got the answer and work. I think this is because both relay on :checked attribute. Can you offer me a way to solve this problem?

      • I spent some time reviewing the code and discovered that the plugin ezMark is geared more towards inputs in forms.
        Since jQuizMe doesn’t use the form tag and assign radio inputs with names, then ezMark will fail.
        Therefore, unless ezMark is modified, it *should* not work properly with jQuizMe.

    • Hey Larry,

      Great work on the plugin!

      Is there a way to add a custom text summary to the end of the quiz? Something like

      “Thank you for taking our quiz! If you would like more information, click here” Etc Etc

      Also, is there a way to always show ansInfo regardless if the question was correct or incorrect? Currently it only shows if the question was incorrect.

      Thanks for everything!
      -Ronnie

      • In jQuizMe, the ansInfo property is only shown when the user answer is incorrect. So I will have to change that feature to allow you to show the ansInfo property every time.

        options.statusUpdate will help for triggering quiz events.
        You can find that in “release jQuizMe 2.1/demo/simple guide/” or at the link below.
        http://www.bateru.com/jquery/jquizme2.1/demo/Simple_guide/jquizme-settings-updated.html
        Something like the following might help you get started.

        … // declare quiz and options
        options.statusUpdate = function( quizInfo, $currQuiz ){
        if( quizInfo.hasQuit ){
        alert( “Thank you for using jQuizMe. \n For More information google ‘jQuizMe’.” );
        }
        };
        jQuizMe( quiz, options );

    • I’m hoping to use this for my online courses. I’m wondering if there’s a way to get the plugin to pull questions from a MySQL database. Would that require JSON? Is there a pure PHP solution? Otherwise all questions have to be hardcoded in the JS, right?


    Leave a reply

    Spam Protection by WP-SpamFree

Bad Behavior has blocked 14 access attempts in the last 7 days.