Quiz Merge Tags

Quiz Merge Tags

List of Quiz Merge TagsWhere are Merge Tags Used?

List of Quiz Merge Tags

The Quiz Add-On introduces several new Gravity Forms Merge Tags that can be used anywhere within Gravity Forms where merge tags are supported.

TagDescription{all_quiz_results}Displays the results of all Quiz Fields that exist in the form.{quiz_score}Displays the total score for the quiz. The score is affected by weighted scoring.{quiz_percent}Displays the percentage score the user achieved. This is affected by weighted scoring.{quiz_grade}Displays the Grade the user achieved based on Letter Grading configured in the Quiz Settings.{quiz_passfail}Displays either Passed or Failed based on the Pass/Fail settings configured in the Quiz Settings.{quiz:id=x}Displays the specific quiz question along with your answer and the correct answer

Where are Merge Tags Used?

Merge Tags can be used:

in form Confirmation messagesin form Notification messages in the Quiz Confirmation messages

{quiz} Merge Tag

{quiz} Merge Tag

SummaryUsageModifiersNotes

Summary

Displays the specific quiz question along with your answer and the correct answer

Usage

{quiz:id=x}

Modifiers

:id

The ID of the specific quiz question

Notes

Quiz and Survey related merge tags can only be used in confirmations and notifications.For more information, refer to our Quiz Add-On documentation.

Quiz

Quiz

SummaryCommon SettingsGeneral SettingsNotesMerge TagsRelated Filters

Summary

The Quiz field for Gravity Forms allows you to quickly create quizzes that are automatically graded or scored when the form is submitted. It is available under the Advanced Fields section within the form editor if you have the Quiz Add-On installed. For more information on setting up your Quiz field please review this article, and the other user guides for the Quiz Add-On.

Quiz field as displayed in the Field Library

Quiz field as displayed in the Form Editor.

Common Settings

For a description of each of the common field settings, refer to this article. Below you will find descriptions of specialty settings that are particular to this field.

General Settings

SettingDescriptionQuiz QuestionEnter your question here.DescriptionDisplays on your form to provide some additional direction to the user.Quiz Field TypeSelect between allowing a single choice using radio buttons or a drop down, or allowing multiple choices using a checkbox field typeQuiz AnswersAdd answers for this quiz question. Clicking the + to the right of a choice row to add more answer slots, or delete the current rows by clicking x. Select which answer, or answers, are correct by clicking the gray checkmark (turning it green).You must identify at least one correct answer for each Quiz field.Weighted Score By default, a correct answer counts as 1, and an incorrect answer as 0 towards the overall Quiz score. When Weighted Score is selected, a box with a 『0』 will show up to the right of each choice. Here you can define what the contribution to the quiz score will be for each answer when chosen. See note 1.Bulk Add / Predefined ChoicesCustomize the predefined choices or paste your own list of choices to add. This article covers this in more depth.Randomize Quiz AnswersRandomize the order in which the answers are displayed to the user. This setting affects only the quiz front-end. It will not affect the order of the results.Enable Answer ExplanationThis option enables you to provide an explanation of the answer. See note 2.

Notes

For detailed examples of weighted quiz scoring and how it is calculated, refer to this article. The Answer Explanation is shown to the user if Instant Feedback is enabled in the form level Quiz settings. The explanation will be shown immediately after answering each question. You can also display the explanation with the quiz results on your form』s confirmations or notifications via merge tags (i.e. {quiz:id=1} or {all_quiz_results}),

Merge Tags

You can view quiz-specific merge tags in this article.

For more information on the use of merge tags, refer to these articles.

Related Filters

The following filters were added to Gravity Forms in support of the quiz field:

gform_quiz_show_choice_valuesgquiz_answer_indicatorgquiz_incorrect_indicatorgquiz_correct_indicator

Quiz Add-On Change Log

Quiz Add-On Change Log

3.8 | 2021-10-143.7 | 2021-04-283.6 | 2020-10-193.5 | 2020-09-283.4 | 2020-09-283.3 | 2020-05-133.2 | 2019-08-073.13.02.4.52.4.42.4.32.4.22.4.12.42.32.22.12.01.1.11.11.01.0.beta2

3.8 | 2021-10-14

Fixed a display issue with the admin icons in the form editor when field choices are randomized.
Fixed a display issue in the quiz field choices UI.
Fixed PHP notices when using PHP 8.
Fixed an issue where the quiz confirmation is displayed even when the display quiz confirmation setting is disabled.

3.7 | 2021-04-28

Added right-to-left language support for weighted score field settings.
Added the form settings icon for Gravity Forms 2.5.
Updated randomization of choices to be more random.
Fixed an issue where quiz answer inputs display incorrectly in some browsers.
Fixed an issue where the Select All button flickers when selecting the correct choice(s).
Fixed an issue where script tags are output above the document head element.
Fixed an issue where the checked state of the "Randomize order of choices" value is not retained.
Fixed a bug where randomizing choices results in malformed markup.
Fixed the positioning of the add-on icon on the uninstall page.

3.6 | 2020-10-19

Added security enhancements.

3.5 | 2020-09-28

Fixed an issue with scripts and styles not loading.

3.4 | 2020-09-28

Added support for Gravity Forms 2.5.
Fixed an issue where the field label tag is corrupt when using JetSloth Image Choices and the Randomize order of choices setting is enabled.

3.3 | 2020-05-13

Added translations for Hebrew, Hindi, Japanese, and Turkish.
Added security enhancements. Credit: Dominik Schilling.
Updated the width of the weighted score input for the field choices setting in the form editor.
Updated Javascript files, stylesheets to use minified versions.
Fixed a PHP warning, notices, and fatal error which occur when Yoast SEO generates the sitemap and there are multiple forms with the Shuffle quiz fields setting enabled.
Fixed a PHP notice which can occur when a third-party add-on triggers the gform_entry_field_value filter without passing a field object.
Fixed PHP notices which could occur on the Results page.

3.2 | 2019-08-07

Added security enhancements.
Added alt text to instant feedback images for better accessibility.
Added GPL to plugin header.
Updated Plugin URI and Author URI to use https.
Updated strings for translations.
Updated tooltip for "Enable answer explanation" field setting.
Fixed an issue decoding the correct value which, if the value contains certain characters, it could cause an incorrect result to be displayed by the instant feedback.
Fixed an issue with the locations the gform_merge_tags hook was being used to include the merge tags.
Fixed an issue with the {all_quiz_results} output when the answer explanation setting is enabled on the Quiz field.
Fixed issue with double quotes preventing results screen from being loaded.
Fixed PHP notice after Gravity Form 2.4.7 adding tab capabilities check.
Fixed issue where navigating an instant-feedback-enabled quiz field via the keyboard will automatically evaluate the answer.
Removed localize_results_scripts function because the one in the framework is used instead.

3.1

Updated field general settings label classes for consistency with GF2.0+.
Updated the instant feedback to add the gquiz-incorrect-choice class to the choice label.
Updated GF_Quiz::get_form_meta() method to only fetch and cache the requested form (rather than all forms).
Fixed some strings that were not translatable.
Fixed an issue which could prevent the entry detail meta box being added with Gravity Forms 2.0 if an update was available or for locales other than English.

3.0

Added GF_Field_Quiz.
Fixed some untranslatable strings.
Fixed the quiz results appearing in the print footer when the form doesn't use quiz fields.

2.4.5

Fixed an issue with the JS for the display quiz confirmation setting on the quiz settings page.

2.4.4

Fixed php notice on entries list page.

2.4.3

Updated minimum Gravity Forms version to 1.9.10.
Updated to use objection notation when interacting with field object.
Fixed an issue with the select type field placeholder choice being duplicated on validation failure.

2.4.2

Increased width of input boxes for weighted score values.

2.4.1

Fixed an issue which caused quiz merge tags to be replaced during form render.

2.4

Fixed a low severity security vulnerability.

2.3

Added function gf_quiz to easily get a Quiz instance.
Added text domain/path to header.
Added support for Gravity Forms 1.9 form editor drag and drop.
Updated protected functions to be public.
Updated to have the file class-gf-quiz.php and organized code into this file and quiz.php.
Updated version to use a variable.

2.2

Added {quiz_score:id=FIELD_ID} merge tag which renders the score for a single field.
Fixed issue with Javascript causing the "Display Quiz Confirmation" textarea to not get displayed.

2.1

Updated the weighted scores field setting to award scores regardless of whether the response is correct or incorrect.
Fixed an issue in the form editor which can result in the corruption of choice settings in other fields on the form.
Fixed the field title in the Form Editor.
Fixed issue with some merge tags not being rendered properly when resending notifications.
Fixed an issue which prevented shuffled fields from retaining their order between pages of multi-page forms.

2.0

Added Add-On Framework integration.
Added support for the Gravity Forms AWeber Add-On. Entry meta (score info) can be mapped to AWeber fields and choice values will be converted to choice labels before sending to AWeber.
Added support for the Campaign Monitor Add-On.
Added support for the Zapier Add-On.
Added gform_quiz_show_choice_values filter to allow the choice values to be modified in the editor. Warning: editing the values after entries have been submitted will affect the integrity of the results. Delete all entries for the form before editing the values.
Added 'weighted scores' setting to allow complex scoring systems where each choice is given a different score.
IMPORTANT:
1. Negative weightings are allowed for choices but the total score for the quiz will not be allowed to go below zero.
2. Changing this setting after entries have been submitted will result in inaccurate data on the entry detail page and entry list. The results page, however, will recalculate all the results according to the new score weightings.
Added a form setting to control whether to display the quiz confirmation after submission.
Added score, percentage, pass/fail and grade to the conditional logic for form confirmations and notifications.
Updated the Drop Down Quiz field to display the "Select one" option at the top of the list instead of the bottom.
Updated entry meta filters available on the results page to hide filters according to form settings.
Update styles on settings and results page.
Fixed issue with merge tags not being rendered properly when resending notifications.
Fixed Strict notices under PHP 5.4.
Fixed inaccurate permissions for settings pages.
Fixed an issue where quiz merge tags would appear in the list of merge tags available during pre-submission.
Fixed some non localized strings.
Fixed choice re-ordering.
Fixed a PHP warning when overriding a page redirect with the Quiz confirmation message.
Fixed the quiz dropdown field value to retain selected value after failed validation.
Fixed an issue with results not being displayed when double quotes were inside field choices labels.
Fixed an issue with results not being displayed in no conflict mode.
Fixed an issue with instant feedback where the the correct answer may not be highlighted after an incorrect selection for fields which have been created by duplicating another field.
Removed some deprecated filters.

1.1.1

Added support for the Contacts Add-On: contact detail tab displaying entries for contact.

1.1

Added gform_form_pre_results filter so the form object can be manipulated before the results are calculated for the admin results page.
Fixed quiz confirmation messages not appearing below the form confirmation in ajax forms.

1.0

Changed confirmation behavior to ignore a confirmation redirect when grading setting is pass/fail or letter.
Fixed a display issue with confirmation message for multipage and ajax enabled forms.
Fixed instant feedback for multipage, ajax enabled forms.
Fixed the way the form action submenu works with 1.7.
Added tooltips to the results page.
Added support for the Gravity Forms MailChimp Add-On. Entry meta (score info) can be mapped to MailChimp fields.

1.0.beta2

Added Quiz Results page with aggregate results and filters.
Added a form setting to shuffle quiz fields.
Added a form setting to give instant feedback.
Added two new filters gquiz_correct_indicator and gquiz_incorrect_indicator.
Example usage:
add_filter( 'gquiz_correct_indicator', 'gquiz_correct_indicator');
function gquiz_correct_indicator ($correct_answer_indicator_url){
$correct_answer_indicator_url = "http://mydomain.com/correct.png";
return $correct_answer_indicator_url;
}

add_filter( 'gquiz_incorrect_indicator', 'gquiz_incorrect_indicator');
function gquiz_incorrect_indicator ($incorrect_answer_indicator_url){
$incorrect_answer_indicator_url = "http://mydomain.com/incorrect.png";
return $incorrect_answer_indicator_url;
}
Fixed an issue with the grades not saving.
Added form settings page ready for 1.7.

{quiz_score} Merge Tag

{quiz_score} Merge Tag

SummaryUsageModifiersNotes

Summary

Displays the total score for the quiz or for a specific quiz question. The score is affected by weighted scoring.

Usage

{quiz_score}

{quiz_score:id=x}

Modifiers

:id

The ID of the specific quiz question

Notes

Quiz and Survey related merge tags can only be used in confirmations and notifications.For more information, refer to our Quiz Add-On documentation.

{quiz_passfail} Merge Tag

{quiz_passfail} Merge Tag

SummaryUsageNotes

Summary

Displays either Passed or Failed based on the Pass/Fail settings configured in the Quiz Settings.

Usage

{quiz_passfail}

Notes

Quiz and Survey related merge tags can only be used in confirmations and notifications.For more information, refer to our Quiz Add-On documentation.

{quiz_grade} Merge Tag

{quiz_grade} Merge Tag

SummaryUsageNotes

Summary

Displays the Grade the user achieved based on Letter Grading configured in the Quiz Settings.

Usage

{quiz_grade}

Notes

Quiz and Survey related merge tags can only be used in confirmations and notifications.For more information, refer to our Quiz Add-On documentation.

Quantity

Quantity

SummaryCommon SettingsGeneral SettingsMerge TagsUsageModifiersDecimal Quantity

Summary

The Quantity field allows a quantity to be specified for Product. It is available under the Pricing Fields section within the form editor.

Quantity field as displayed in the Field Library

Quantity field as displayed in the Form Editor.

Common Settings

This field uses only common field settings for the Appearance and Advanced settings. For a description of each of the common field settings, refer to this article. Below you will find description of specialty settings that are particular to this field.

General Settings

SettingDescriptionProduct Field MappingSelect which product this field is tied to. This option is only available when there are two or more products. When only one product exists, Option and Quantity will automatically apply to that product.Field TypeSelect the type of field from the available form fields. For Field Types see note 1.Number FormatSelect the format of the numbers that are allowed in this field. You have the option to use a comma or a dot as the decimal separator.RangeEnter the minimum and maximum values for this form field. This will require that the value entered by the user must fall within this range. See note 2.

Field TypesNumberThe Number field type will display as a Number on your form. This option also enables the Number Range property.Drop DownThe Drop Down field type will display as a drop down field on your form. When this option is selected, the General tab will refresh with options to specify multiple quantity choices.HiddenThe Hidden field type will display as a hidden field on your form. This field type is useful when wishing to set a quantity without that quantity being visible or editable by the user.This option is only available when the Number field type is selected.

Merge Tags

For more information on the use of merge tags, refer to these articles.

Usage

{Field Name:2}

Modifiers

This merge tag does not have any modifiers.

Decimal Quantity

Allowing the user to type decimal values in the quantity input field is not supported. However, there is a third-party script that you can use to override this limitation: Enable Decimal Values in Quantity Fields

Decimal values are supported by default when the field is set to Drop Down type. If you』re going to use this field type in a calculation formula, please check the Number Formatting Rules in the Calculations doc page.

Quantity Field CSS Selectors

Quantity Field CSS Selectors

ContainerInput

Container
example: quantity field container (div) – applies to all forms
body .gform_wrapper .gform_body .gform_fields .gfield_price .ginput_container_number {border: 1px solid red;}
example: quantity field container (div) – applies just to form ID #1
body .gform_wrapper_1 .gform_body .gform_fields .gfield_price .ginput_container_number {border: 1px solid red;}
example: quantity field container (div) – applies just to specific container (based on the unique parent element ID – replace 「XX_X」 with your actual element ID)
body .gform_wrapper_1 .gform_body .gform_fields #field_XX_X.gfield_price .ginput_container_number {border: 1px solid red;}
Input
example: quantity field input (input) – applies to all forms
body .gform_wrapper .gform_body .gform_fields .gfield_price .ginput_container_number input {border: 1px solid red;}
example: quantity field input (input) – applies just to form ID #1
body .gform_wrapper_1 .gform_body .gform_fields .gfield_price .ginput_container_number input {border: 1px solid red;}
example: quantity field input (input) – applies just to specific container (based on the unique parent element ID – replace 「XX_X」 with your actual element ID)
body .gform_wrapper_1 .gform_body .gform_fields #field_XX_X.gfield_price .ginput_container_number input {border: 1px solid red;}