1. Home
  2. Docs
  3. Addons
  4. Extra Template Variables

Extra Template Variables

Documentation for 7.0 version of plugins is available at QSM 7.0 Documentation

The Extra Template Variables is an add on that we have that will give you access to more template variables that can be used in the results pages and emails.

INSTALLATION/SETUP

Once you have purchased the addon, you will have access to download the addon. To install, simply upload the addon as a normal WordPress plugin. To do so, go to the Plugins page and click Add New. Then, click Upload. From there, upload the zip file that you downloaded when downloading the addon.

Once the addon has uploaded, you should now have the plugin QSM Extra Text Variables listed in your list of plugins. Then all you will need to is click Activate to activate the plugin.

AVAILABLE VARIABLES:

  • %QUESTION_ANSWER_CORRECT% – This variable shows all questions and answers for questions the user got correct.
  • %QUESTION_ANSWER_INCORRECT% – This variable shows all questions and answers for questions the user got incorrect.
  • %QUESTION_ANSWER_GROUP%%/QUESTION_ANSWER_GROUP% – This variable shows all questions and answers for questions where the user selected the matching answer. For example, %QUESTION_ANSWER_GROUP%Always%/QUESTION_ANSWER_GROUP% would show the questions and answers for questions where the user answered “Always”.
  • %CUSTOM_MESSAGE_POINTS%%/CUSTOM_MESSAGE_POINTS% – This variable shows a custom message based on the number of points a user has earned. For example, you could say “Based on your points, you are a ____” where blank is the custom message. For usage, %CUSTOM_MESSAGE_POINTS%loser:0-49;winner:50-100;%/CUSTOM_MESSAGE_POINTS% where the loser would be shown for users with points between 0 and 49 and winner would be shown for users with points between 50 and 100.
  • %CUSTOM_MESSAGE_CORRECT%%/CUSTOM_MESSAGE_CORRECT% – This variable shows a custom message based on the score a user has earned. For example, you could say “Based on your points, you are a ____” where blank is the custom message. For usage, %CUSTOM_MESSAGE_CORRECT%loser:0-49;winner:50-100;%/CUSTOM_MESSAGE_CORRECT% where the loser would be shown for users with a score between 0 and 49 and winner would be shown for users with a score between 50 and 100.
  • %QUESTION_POINT_SCORE% – This variable shows the number of points allotted to each question in the Quiz/Survey and displays it at the end of the quiz. One of the ways to use this variable with %QUESTIONS_ANSWERS% in the Text Tab of the Quizzes/Surveys Plugin.
QSM- Extra Template Variables - Updated 2021
QSM- Extra Template Variables

EXAMPLES:

The below image depicts the configuration done on the results page of the demo quiz

QSM- Extra Template Variables -2- Updated 2021.png
QSM- Extra Template Variables – Adding Variables

And, the following are the results:

QSM- Extra Template Variables -Final Results- Updated 2021.png
QSM- Extra Template Variables – Final Output – Positive

 

QSM- Extra Template Variables -Final Results Negative- Updated 2021.png
QSM- Extra Template Variables – Final Results Negative

Also, an example of the Question Points Variable can be seen below.

QSM- Extra Template Variables - Question Point Score Variable - Updated 2021.png
QSM- Extra Template Variables – Question Point Score Variable in Action