1. Home
  2. Docs
  3. Overview
  4. Intro to Template Variables

Intro to Template Variables

The Quiz and Survey Master plugin simplifies quiz and survey creation by automating key components. For instance, in a quiz, you might want to tailor how results are displayed—adding details like the quiz name, number of correct answers, or the correct answers themselves.

These details vary by quiz, user, and number of attempts, making it impossible to include them in advance. This is where template variables shine. They let you insert placeholders (variables) into your quiz or survey result, email, or text tabs, which are replaced with specific values when the user completes it.

For example, since you can’t know a user’s score before they take the quiz, you can add the variable %POINT_SCORE% to the results page template. Once the quiz is taken, the plugin automatically replaces it with the user’s total points.

USING TEMPLATE VARIABLES

There are lots of variables you can use in your templates. Almost all of the template variables follow the same format, with percent signs at the beginning and end and the variable name in the middle, ex. %QUIZ_SCORE%  

Note that there are no spaces between the % and the name – that’s important!

Each section of a quiz (like the result page, email, or text) includes a list of variables that work in that template. For example, the Text Before Quiz template can only have the variables %QUIZ_NAME% and %CURRENT_DATE%. So be sure to check which variables are effective before you customize the message in the template.

In QSM, you can mostly use the template variables to customize your messages in the Text tab, Result Page, & Email Template.

You also get extra template variables to customize templates through the Extra Template Variable add-on. To know more about it, view the Extra Template Variables Documentation

List of Core Template Variables (Free)

qsm template variables core

%POINT_SCORE% – This is used to show the number of points a user earned during the quiz. For example:

Great job! You earned %POINT_SCORE% points!

%MAXIMUM_POINTS% – This is used to display the maximum possible points one can score in the given test/quiz. For example:

Welcome! This test is of %MAXIMUM_POINTS% points. Good Luck!

%MINIMUM_POINTS%  – This variable displays the minimum possible points one can score in the given test/quiz. 

Welcome! This test is of %MINIMUM_POINTS% points. Good Luck!

%AVERAGE_POINT% – It displays the average number of points the user earned per question. For example:

Great Job! You earned %AVERAGE_POINT% points per question!

%AMOUNT_CORRECT% – The number of questions the user answered correctly in a quiz or exam.

You answered %AMOUNT_CORRECT% questions correctly!

%AMOUNT_INCORRECT% – The number of questions the user answered incorrectly. For example:

You answered %AMOUNT_INCORRECT% questions incorrectly!

%AMOUNT_ATTEMPTED% – The number of questions that the user attempted. For Example:

You attempted %AMOUNT_ATTEMPTED% questions in this test.

%TOTAL_QUESTIONS% – The total number of questions there are in a quiz. For example:

The quiz you just took had %TOTAL_QUESTIONS% questions!

%CORRECT_SCORE% – It displays the percentage score the user earned when using correct/incorrect grading in the quiz. For example:

Great job! You scored %CORRECT_SCORE% % on this quiz!

%USER_NAME% – The name the user entered in the contact form before taking the quiz.

Thank you %USER_NAME% for taking this quiz!

%FULL_NAME% – This will display the full name, i.e, the First and Last name of the registered user, if you’ve enabled the “Require User Login” in the Options tab. If the “Require User Login” option is disabled, then the output will be blank.

Thanks %FULL_NAME% you have successfully taken the online test.

%USER_BUSINESS% – It shows the company the user entered into the Business contact field. For example:

%USER_NAME% from the company of %USER_BUSINESS% just took this quiz!

%USER_PHONE% – The phone number the user entered into the Phone contact form field box. For example:

The %USER_NAME% just took the quiz. This user can be reached at %USER_PHONE%.

%USER_EMAIL% – The email the user entered into the Email text box. For example:

The %USER_NAME% just took the quiz and can be emailed at %USER_EMAIL%

%QUIZ_NAME% – The name of the quiz. For example:

Great Job %USER_NAME%! You have just taken the %QUIZ_NAME%.

%QUIZ_LINK% – This will display the link of the current quiz. For Example:

You are free to share this link with your friends %QUIZ_LINK%

%QUESTIONS_ANSWERS% – This shows the questions, answers provided by users, and the correct answers. This variable can be edited on the Text tab.

Great Job %USER_NAME%! You earned %POINT_SCORE% points. Review your answers below to see which questions you answered correctly and which ones you did 
not. %QUESTIONS_ANSWERS%

%COMMENT_SECTION%  – The comment the user entered into the quiz comment section (if enabled). An example of usage would be:

The %USER_NAME% took the quiz and left these comments:
%COMMENT_SECTION%

%TIMER% – This variable is used to show the total time the user took to complete the quiz in seconds. 

The user took %TIMER% seconds to complete this test.

%TIMER_MINUTES% – It shows the amount of time the user spent on a quiz in minutes. Note that this variable will only show the time in “minutes,” excluding any decimal values of seconds. i.e., If the total time is 3 minutes 38 seconds. This will output 3.

Hi %USER_NAME%, you took %TIMER_MINUTES% minutes to complete the quiz.

%TIMER_SECONDS% – It is used to show the leftover seconds the user spent on the quiz. i.e., if the total time is 3 minutes 38 seconds. This will output 38 seconds.

Hi %USER_NAME%, you took %TIMER_MINUTES% minutes and %TIMER_SECONDS% seconds to complete the quiz.

%CATEGORY_POINTS_X%–  It displays the number of points a user earned in a specific category. An example of the usage where X is the History category:

You earned %CATEGORY_POINTS_History% points in the History category.

%CATEGORY_SCORE_X% – This displays the score percentage achieved by the user in a specific category. For example:

You earned %CATEGORY_SCORE_Math% in the Math category of this quiz.

%CATEGORY_AVERAGE_POINTS% – This displays the average number of points a user earned from all categories. For Example:

On average, you earned %CATEGORY_AVERAGE_POINTS% points in every category for this quiz.

%CATEGORY_AVERAGE_SCORE% – Displays the average percentage score the user earned from all categories. For example:

On average, you earned %CATEGORY_AVERAGE_SCORE% % per category for this quiz.

%QUESTION_MAX_POINTS% – This will display the Maximum points allotted to a question. This variable will work in a loop; you can use this variable in the Text tab. For Example:

You have earned %QUESTION_MAX_POINTS% points for the asked question.

%RESULT_LINK% – This will display the link to the results page. For Example:

Thanks for taking this exam, here is the results link: %RESULT_LINK%

%CONTACT_X% – This is used to show the value the user entered into the contact field. Where X is the number of contact fields. For example, the first contact field would be %CONTACT_1%. 

Great Job %CONTACT_1% Stay connected for more!

%CONTACT_ALL% – This is used to list the user values for all the contact fields entered by the user. 

Great Job! These are the details you entered %CONTACT_ALL%

%AVERAGE_CATEGORY_POINTS_X% – Here “X” is the Category name. This will display the average amount of points a specific category earned. For Example:

Awesome! Your Average Category Score was %AVERAGE_CATEGORY_POINTS_X%.

%QUESTION_ANSWER_X% – The output of this variable depends on where you are using it.

If you are using the %QUESTION_ANSWER_X% variable in the Emails Template, then the output format will be according to the format of your %QUESTIONS_ANSWERS_EMAIL% Text message of the Text Tab.

And, if you are using the %QUESTION_ANSWER_X% variable in the Results Page, then its output will be according to the Results Page %QUESTIONS_ANSWERS% Text message format of the Text Tab.

It can be used to display the result of a particular question. Where ‘X‘ is the Question ID. Question ID can be found in the Edit Question Window in the Questions Tab. For Example:

Your response for Question 10 was %QUESTION_ANSWER_10%

%ANSWER_X% – Shows the answer to a particular question. Where ‘X‘ is the Question ID. Question ID can be found in the Edit Question Window in the Questions Tab. For Example:

The answer to Question 5 is %ANSWER_5%

%TIME_FINISHED% – Displays the current time (exact time in HH:MM XM) to the user after they submit the quiz.
Note: This is the website’s time on which the quiz is being attempted and not the user’s system or local time.

Your response has been recorded. You atttempted the quiz on %TIME_FINISHED%.

%QUESTIONS_ANSWERS_EMAIL% – Show the question, the answer provided by the user, and the correct answer while sending emails to the user and the quiz admin.

You answered %QUESTIONS_ANSWERS_EMAIL%

%POLL_RESULTS_X% – This is used to display the poll results bearing a particular question ID. Note: It’s only supported for multiple-choice answers. For Example:

Here are the Poll results %POLL_RESULTS_1%

%RESULT_ID% – this is used to show the result ID. That is the result number. For Example: 5

The result number for this quiz is: %RESULT_ID%

%CURRENT_DATE% – Displays the current date, and you will find this variable in the Text tab.

User attempted this quiz on %CURRENT_DATE%

%FACEBOOK_SHARE% – displays the button to share on Facebook. Note that the Facebook share button currently only supports sharing on personal profiles and not on the Facebook page.

Be sure to share your results on Facebook by using the button below!
%FACEBOOK_SHARE%

%TWITTER_SHARE% – displays the button to share on Twitter

Be sure to share your results on Twitter by using the button below.
%TWITTER_SHARE%

%LINKEDIN_SHARE% – displays the LinkedIn button to share quiz results on the LinkedIn platform.

%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 is with %QUESTIONS_ANSWERS% in the Text Tab of the Quizzes/Surveys Plugin.

Extra Template Variables

Screenshot 2025 07 29 at 12.26.07 PM

%QUESTION_ANSWER_CORRECT% – This variable shows all questions and answers for questions the user got correct.

Here's a list of all the questions you got right: %QUESTION_ANSWER_CORRECT%

%QUESTION_ANSWER_INCORRECT% – This variable shows all questions and answers for questions the user got incorrect.

Here's a list of all the questions you got incorrect: %QUESTION_ANSWER_INCORRECT% 

%Question_Answer_Group_X% (X: Answer value) – This variable shows all questions and answers for questions where the user selected the matching answer. 

%QUESTION_ANSWER_GROUP_Always% would show the questions and answers for questions where the user answered “Always”.

%CUSTOM_MESSAGE_POINTS_X% (X: Points range and message) – 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;% where the loser would be shown for users with points between 0 and 49, and the winner would be shown for users with points between 50 and 100.

%CUSTOM_MESSAGE_CORRECT_X% – 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;% where the loser would be shown for users with a score between 0 and 49, and the winner would be shown for users with a score between 50 and 100.

%QUIZ_TIME% – This variable shows the quiz time that you’ve set in Options -> Quiz submission -> Time Limit. You can use this variable in the Emails & Results tab.

You had %QUIZ_TIME% minutes to complete this quiz.

%QUIZ_PERCENTAGE%—This variable shows the overall quiz percentage. %QUIZ_PERCENTAGE% provides you with the quiz score in percentage based on %POINT_SCORE%, which means the total earned points out of the maximum possible points. 

%QUIZ_PERCENTAGE% will display the overall quiz percentage.

%CATEGORY_PERCENTAGE_X% – This variable displays the percentage of any selected category out of the total quiz score. 

Here's your result of the Addition category - %CATEGORY_PERCENTAGE_Addition% out of the total quiz percentage.

%COUNT_UNATTEMPTED% – The total number of questions not attempted or skipped by the user. 

You skipped %COUNT_UNATTEMPTED% questions in this test.

%SUBMISSION_DATE% – This variable displays the date when the quiz was submitted on the results page and in emails.

Your responses were successfully submitted on %SUBMISSION_DATE%. Thanks for completing the quiz!

%QUESTION_ANSWER_ATTEMPTED% – This variable will only show the questions that were answered by the quiz participant.

Here’s a list of the questions you attempted during this quiz: %QUESTION_ANSWER_ATTEMPTED%

%RETAKE_QUIZ_BUTTON% – This variable will display the retake quiz button once you have submitted the quiz and your results are shown.

You can retake the quiz here: %RETAKE_QUIZ_BUTTON%

%REMAINING_QUIZ_ATTEMPTS% – This variable will display the number of quiz attempts remaining to participants if they want to reattempt their quiz.

Great effort! You still have %REMAINING_QUIZ_ATTEMPTS% chances to improve your score.

%CATEGORY_MAX_POINTS_X% – This variable represents the maximum points a participant can earn in a specific category.

If a question in category X has four options with point values 1, 2, 3, and 4, the maximum points for that category would be calculated as 4.

%CATEGORY_WISE_PERCENTAGE_X% – This variable calculates the percentage of points earned by the user within a category.

Keep it up! You've earned %CATEGORY_WISE_PERCENTAGE_Math% in the Math category so far.

Educators & Professional Web Developers, Try QSM!

4.9 / 5
Over 1 million downloads

Subscribe to Our Newsletter

Get weekly updates, no spam guaranteed we promise ✌️