WordPress.org

Ready to get started?Download WordPress

Plugin Directory

SlickQuiz

SlickQuiz is a plugin for displaying and managing pretty, dynamic quizzes. It uses the SlickQuiz jQuery plugin.

  1. Install the SlickQuiz plugin directly from the WordPress plugin directory. Or upload the SlickQuiz plugin to your /wp-content/plugins/ directory.
  2. Activate the plugin through the "Plugins" menu in WordPress.
  3. Create / publish quizzes via the "SlickQuizzes" option in the WordPress sidebar.
  4. To add a quiz to a post or page, place [slickquiz id=X] the content area, where X is the ID of the quiz you created. The ID can be found in the main SlickQuiz listing.

Dynamic URL Shortcode Setup

You may also dynamically render a quiz by setting the shortcode to [slickquiz id=url]. This will tell the plugin to look for an ID at the end of the page URL and select the quiz with that ID. Note: additional query string parameters will not interfere.

Text Widget Setup

To use the [slickquiz id=X] shortcode in the sidebar Text widget, add the following to yours theme's functions.php file.

add_filter( 'widget_text', 'do_shortcode' )

Developer Hooks

There are currently three filter actions that you may hook into:

slickquiz_admin_options

This allows you to add custom admin options.

slickquiz_after_options

This allows you to add custom markup to the bottom of SlickQuiz Options form (you would likely add data to your custom slickquiz_admin_options here).

slickquiz_after_result

This allows you to add custom markup to the bottom of the quiz results area at the end of the quiz (you would likely output data from your custom slickquiz_admin_options here).

For an example of how to utilize these hooks, see this gist.

Saving Additional Quiz Data

It is possible to store extra data along with the main quiz JSON object. This would be useful if you're extending the quiz or integrating it with another plugin.

There is currently one JavaScript callback that you may use to add data when a quiz is saved to a draft or published. It will save extra data to an attribute named "extra" in the quiz JSON object. You would call it like below:

jQuery(document).ready(function($) {
  $.fn.setPreSaveQuiz(function () {
    // Append some "extra" data to the SlickQuiz POST.
    return { some: 'data', another: 'piece of data' };
  });
});

There is also a slickquiz_save_quiz WordPress action you can use to grab the quiz and extract the "extra" data when the quiz is saved to a draft or published. You might set up something like this:

class YourCustomClass {
  function __construct()
  {
    add_action('slickquiz_save_quiz', array( &$this, 'custom_quiz_data_action' ));
  }

  function custom_quiz_data_action( $quiz, $mode = 'create_draft' )
  {
      $data  = json_decode( $_POST['json'] );
      $extra = $data->extra;
      // Do custom stuff
  }
}

Note, the $mode option will return one of the following values: 'create_draft', 'create_published', 'update_draft', 'update_published'

Requires: 3.0 or higher
Compatible up to: 3.9.2
Last Updated: 2014-8-25
Downloads: 31,745

Ratings

4 stars
4.8 out of 5 stars

Support

9 of 15 support threads in the last two months have been resolved.

Got something to say? Need help?

Compatibility

+
=
Not enough data

1 person says it works.
0 people say it's broken.

0,1,0
100,1,1
33,3,1
100,1,1 100,1,1 100,3,3 100,1,1 100,1,1
0,1,0
100,1,1
100,1,1
100,1,1
100,1,1