Bin-Blog logoBin-Blog

Learn about the latest in Web Development – as soon as I do.

Quizzin WordPress Plugin for Quiz Creation

By Binny V A • Nov 22nd, 2008 • Category: Blogging, Scripts, WordPress

WordPress Plugin Week

Quizzin WordPress Plugin lets you add quizzes to your blog. This plugin is designed to be as easy to use as possible. Quizzes, questions and answers can be added from the admin side. This will appear in your post if you add a small HTML comment in your post.

Welcome to Plugin week – in Plugin week, I release a new WordPress Plugin each day, every day for one week. This is the sixth (and final) plugin in that series. The plugins released so far are…

Note 1: Quzzin is a beta plugin(as are most of the plugins released in the Plugin Week) – so watch out for bugs. And trust me, there will be quite a few.

Installation

  • Download the zipped file.
  • Extract and upload the folder to /wp-contents/plugins/ folder
  • Go to the Plugin management page of WordPress admin section and enable the Quizzin plugin
  • Go to the Quizzin Management page(Tools > Manage Quiz) to create or edit Quizzes
  • After creating the quiz, create a new post and add the HTML comment [QUIZZIN 1] in it. Here the ’1′ should be the ID of the quiz to be inserted.

Usin’ Quizzin Plugin

This plugin is pretty straight forward – after enabling the plugin, go to the Manage Quiz page(Manage > Manage Quiz). All the existing quizzes will be show here. You also have the option of creating a new quiz – or editing an existing one.

Quizzin WordPress Plugin - Manage

Click on the ‘Create new Quiz’ link to create a new quiz – you have to fill in three fields – the quiz name, the description and the Final Screen.

Quizzin WordPress Plugin - Create

The ‘Final screen’ field is very important – you can customize the result of the quiz using this. Basically, what you fill in here will be shown when a user completes the quiz. You can use several variables here. For example, if you put in the text ‘%%SCORE%%’, it will be replaced by the score the user got in the quiz.

The other possible variables are…

Variable Value
%%SCORE%% The number of correct answers
%%TOTAL%% Total number of questions
%%PERCENTAGE%% Correct answer percentage
%%GRADE%% 1-10 value. 1 is 10% or less, 2 is 20% or less, and so on.
%%WRONG_ANSWERS%% Number of answers you got wrong
%%RATING%% A rating of your performance – it could be ‘Failed’(0-39%), ‘Just Passed’(40%-50%), ‘Satisfactory’, ‘Competent’, ‘Good’, ‘Excellent’ and ‘Unbeatable’(100%)
%%QUIZ_NAME%% The name of the quiz
%%DESCRIPTION%% The text entered in the description field.

Once you have filled out this form, you will be taken to the next page where you can manage your questions. Click on the ‘Create new Question’ to add your questions and answers. You have to select one of the answers as the correct one.

Quizzin WordPress Plugin - New Question

Quizzin WordPress Plugin - Mange Questions in Quiz

After you have added all the question, create a new post and add the HTML comment [QUIZZIN 1] – here the 1 should be the ID of the quiz to be inserted. That’s it – you should have a working quiz on your blog now.

See it in Action

I have created a WordPress Quiz using the Quizzin plugin. Lets see how well you know wordpress. If you take the quiz, post your results in the comments field.

Credits

Thanks to ‘The’ Anand for suggesting the idea of a Quiz plugin. Also, Mani Karthik provided a lot of encouragement to create the plugin.

As a matter of fact, Quizzin is the first plugin in the plugin week series. When those two suggested the Quiz plugin, my lazy brain immediately saw the benefits – I get 3 plugins for the price of one. Once the quiz plugin is created, just remove the correct answer option, limit the question to just one and record the answers – and you have a Poll plugin. To create a survey plugin, just remove the correct answer option and record the user’s input. You also need to create a interface to show the results. Voila – you have a survey plugin. That’s right – the Pollin Plugin and Surveys plugin are based on the Quizzin Plugin.

The eventr plugin was created for the Barcamp Kerala. Again, the credit for its suggestion goes to Anand. After that plugin was ready, I am sitting on four unreleased plugins(that is, two plugins and an idea for two more) – that’s when the thought of doing a plugin week hit me. The rest, as they say, is history.

Feedback

If you have any suggestions or notice any problems with the Quizzin WordPress plugin, post it in the Quizzin forum.

That’s it! Plugin week is over. 6 days, 6 plugins. Now, I have to go catch up on some much needed sleep. Happy Blogging!


86 Responses »

  1. Andy says:

    I’m having a problem with the Quizzin plugin on my site http://www.pharmtechguide.com.

    The problem is that it shows one quiz on the main page, and it works, but then the second quiz on the main page won’t work.

    If you click on the link on the non-functioning one and show it on only one page, then it works.

    But, if you choose the category menu, then none of the quizzes on the category menu work unless you select the individual quiz and show it on only one page.

    Any ideas on how to make this work?

    Thanks!

  2. Luis Fernando says:

    Hi!

    I just upgrade my wordpress to 2.8.8 and your plugin doesn’t work :S

    When i try to “Create New Quiz” i got the next message: You do not have sufficient permissions to access this page.

    I tried to fix with a lot of solutions in google but nothing works, if someone have a clue of the problem I appreciate your help…

    Greetings

  3. Luis Fernando says:

    I made a mistake with the version, is wordpress 2.8.6

    I found a solution here:

    http://projects.binnyva.com/forum/topic/error-creating-a-new-quiz-wordpress-285-apache-permission-not-granted

    You can download the latest and functional version here:
    http://projects.binnyva.com/forum/topic/error-creating-a-new-quiz-wordpress-285-apache-permission-not-granted

    Thanks anyway! :D

  4. Diana says:

    Very nice plugin! But I was looking for a plugin alike, more like a test not a quizz ?! Where can I ever find this?

    I´m used to insert the code directly into posts, really messy.

  5. Rogerio says:

    Thanks for plugin, its great!

    I have a problem to create a quiz using WP-MU 2.8.4 with FORCE_SSL_ADMIN

    If i disable FORCE_SSL_ADMIN its works

    could you help me ?

  6. Nimish says:

    Thanks for the plugin…
    Its great…Helped me a lot…
    Is there any thing you can do for Multiple answers option… ???

  7. Nawal says:

    It is really a nice plugin for Quiz. I have used it and working fine.

  8. Mel says:

    Is it possible to display on the blog post how many people have already take part in the quiz? If it is possible, how to display it?

  9. Hi Binny,

    I love your Quizzin plugin, as I think I have expressed to you before. I have used it on my Website, but I edited your code to make a couple of minor improvements. However my site is predominantly owned by my partner and he has switched to WordPress MU, and with that you lose the ability to Edit the code of themes and plugins, which really pisses me off. Anyway there have been quite a few people who have used one of my suggested changes to your Quizzin plugin, but if they were to switch to WP MU they too would lose it because they can’t edit the code.

    There is a really simple solution, which would be for you to issue a new release of Quizzin incorporating my suggestions. Of course some people might like it exactly the way it is, so I am suggesting that you make my suggestions new Quizzin settings, or Quiz parameters.

    The first and most important one from my perspective (and this is the one others have copied) is to make whether or not question numbers are displayed a Quizzin setting. When the setting is off it should work as it does now but when it is on, it should display question numbers during the quiz and also with the answers. To do that is very simple. For the final answers display in Show_Quiz.php

    $question_count = 1;
    foreach ($all_question as $ques) {
    $result .= “”;
    $result .= “”. $question_count . ‘. ‘ . stripslashes($ques->question) . “\n”;

    $total++;
    $question_count++;
    }

    And when doing the quiz in Show_Quiz.php

    $question_count = 1;

    foreach ($all_question as $ques) {
    echo “”;
    echo “”. $question_count . ‘. ‘ . stripslashes($ques->question) . “”;

    echo “”;
    $question_count++;
    }

    The other change relates to the ability to give a different response based on the score achieved, in each quiz. So when editing the quiz, instead of using your %%RATING%% variable with its values of ‘Failed’(0-39%), ‘Just Passed’(40%-50%), ‘Satisfactory’, ‘Competent’, ‘Good’, ‘Excellent’ and ‘Unbeatable’(100%), you could have a table of 10 ratings entries (with these values as defaults) that a quiz editor could change to suit their own purposes. Actually maybe 11 entries with one for > 100% for which the default response might be ‘Cheating’. This would also be extremely useful for people creating quizzes in a languages other than English.

    I hope you can see the value in my suggestions and can implement them for me and anybody else who loves your tool.

    Regards Greg

    • Sorry my code segments are missing stuff, I just copied and pasted and the stuff got lost in translation, as did the indetation, but I think there’s enough there for you to get the picture. I also meant to Bold the . ‘. ‘ after $question_count in the two echo statements. because this is also additional to your original code.

      Regards Greg

    • Binny V A says:

      I hate to make an arbitrary choice – I don’t want to put in question count with giving the users an option to turn it off. I’ll see what I can do.

      • Agreed! It should be a Quizzin setting “Display Question numbers?”.

        By the way one of the guys who used my suggested changes, and actually helped me fix the code (ferhat) because I had previously used $ques -> ID, which doesn’t work if you have multiple quizzes (because each question ID is unique across the whole installation not just this Quiz), has his quizzes in a foreign language, so I am sure he’d love the second suggestion regarding the table of user specified %%RATING%% values.

  10. PMN says:

    Great Binny, I like your plugins.

  11. I am going to try out your plugin, but I would really like quiz results posted automatically in the comments, or mailed to me. Is this possible, or do you know if this is possible?

  12. Rowena says:

    Hi Binny!

    Great plugin.
    I need some help though. is it possible to place the answer options in the same line as the question? if so, how do i do this? Im no php genius so it’s a bit difficult to try figure it out :-)

  13. Meghan says:

    Hey, would anybody know an easy way to insert my quizzes as sidebar widgets?
    Any hints or ideas are much appreciated

  14. Stanley says:

    I installed this plugin like admin. But other users of web (WordPress) with no admin role cannot create quizzes because they don’t see it in own Tools menu. How to do that?

  15. Ivana says:

    Can it be shown on sidebar?

  16. bennie says:

    can results be emailed to admin ?

  17. I am a bit depressed now :-/
    looking for a simple one-question thing that changes regularly (quiz widget on sidebar).

    E.g.:
    Today’s Quiz Pit bulls have locking jaws
    O Yes
    O No
    O I don’t know what a locking jaw is

    once you click on “Submit” or whatever – will pops a page, giving the right answer & explanation.

    Any ideas people? pleaase?

  18. VirtuAlthea says:

    Where can I edit so that the Submit button will direct to a specific URL instead?

  19. Rich says:

    I have many questions. I know some are basic, but I cannot figure them out…

    1. I LOVE this plugin! I wanted to say that.

    2. I do understand how to create the polls. Do I have to manually install the polls plugin? Or, can I use the quizzen?

    You wrote:
    “Once the quiz plugin is created, just remove the correct answer option, limit the question to just one and record the answers – and you have a Poll plugin.”
    I cannot find the correct answer option. Which SPECIFIC option are you refering to?

    3. Consequently, I cannot figure out how to make a survey. Do I have to manually install the plugin? Or, can I use the quizzen plugin?

    You wrote:
    “To create a survey plugin, just remove the correct answer option and record the user’s input. You also need to create a interface to show the results. Voila – you have a survey plugin”
    An interface? How do I create this? Or, should I just use the survey plugin.

    4. Do the results get recorded? Hence, after 10 people use it, it says 6 people got this right and four people got it wrong. Can that happen?

    5. Also, can I create a “personality quiz” Ie, I set up 10 questions with no “wrong” answer. After a person fills out the survery, it tell s them their personality.

    For instance, Lets Say I wanted to do it about Seinfeld
    How ofted do you sleep? A. One to two hours B. Three Hours. C. 12 Hours. D. 19 hours.
    Hence, there is no right nor wrong answer. So a person fills out A. After twenty questions like it, it would say “kramer.”
    My blog is about the entertainment field.

    If this could be done, HOW can it be done?

    Thanks in advance!

    ~Rich

    • Binny V A says:

      I’m sorry – but you are reading it wrong. I created 3 plugins using the code of this plugin. I created a Polls plugin and Surveys plugin. You have to use those plugin to get the functionality – you won’t be able to use this.

      About the fourth question, no, quizzin don’t record the results. About the fifth, you’ll have to edit the code to get that effect.

  20. Susan says:

    For the answers to each question– can substitute a picture instead text?

    For example: Which is the cutest pet? And there would be 3 pictures of a kitten, a puppy, a python with a radio button underneath each one.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>