WordPress Quiz Plugin - Shortcodes


Shortcodes 

Back to User Guides

TIP: What Are Shortcodes

Shortcodes add dynamic content to your site via a small piece of code.

Learn more: Shortcodes - How To Use | Finding ID of Post/Page/Other Content

The WordPress Quiz Plugin supports two shortcodes. 

1) Show a Quiz

  • Shortcode[cm_quiz id="xxx"]
  • Use: Displays a quiz
  • Obligatory parameters
    • id - Insert either the quiz id or the slug.
  • Example:

Example

Example - Questionnaire Plugin WordPress
Example

2) Display Content Depending on Score Range

  • Shortcodes[cm_quiz_success][/cm_quiz_success] and [cm_quiz_fail][/cm_quiz_fail]
  • Use: Displays the content inside the shortcode only if the user's score for that quiz is inside a set range.

    [cm_quiz_success] will show the content only if the score is equal or higher than the chosen one.

    [cm_quiz_fail] will show the content only if the score is lower than the chosen one.

  • Obligatory parameters
    • id - Insert either the quiz id or the slug.
    • score - Value in percentage. 
  • Example: The example below considers a user that has a score above 50% in the chosen quiz. Note that only content inside the shortcode [cm_quiz_success]  appears.

Example

Example - WordPress Test Plugin
Example

3) Show Number of Remaining Retakes

How It Works

This shortcode sets a countdown for completions of a quiz. It's purely a countdown - the quiz is not locked after the number reaches 0.

  • Shortcode[cm_quiz_countdown id="quiz_id" starting_number="any_number" output="remain|passed"]
  • Use: Displays a countdown counter of how many more times the quiz can be taken. 
  • Obligatory parameters
    • id - Insert either the quiz id or slug.
    • starting_number - The maximum count of completions for that quiz. 
    • output - Accepts both below. If nothing is set, it will be remain.
      • remain - returns how many users can still pass the test.

        For example, if starting_number is 10 and 3 people finished the quiz, remain will return 7.

        Note that his number can be negative! In the example above, if 11 people finished the quiz, remain will return 3.

      • passed - returns how many users have passed the test.

        For example, if starting_number is 10 and 3 people finished the quiz, passed will return 3.

  • Example: You should rush! Only   [cm_quiz_countdown id="56" starting_number="100" output="remain"]  people can still take the exam!

Back-end and Front-End

Example - Create Quiz WordPress
Example

More information about the WordPress Quiz Plugin

Other WordPress products can be found at CreativeMinds WordPress Store

Let us know how we can Improve this Product Documentation Page

To open a Support Ticket visit our support center
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.