Knowledge Base
PressPrimer Quiz

Shortcodes & Blocks

This guide covers all available shortcodes and Gutenberg blocks across the PressPrimer Quiz plugin family. Use these to embed quizzes and quiz-related content anywhere on your WordPress site.

PressPrimer Quiz (Free Plugin)

The free plugin provides the core quiz functionality with two shortcodes and two Gutenberg blocks.

Quiz Shortcode

Embed any quiz on a page, post, or custom post type.

[pressprimer_quiz id="123"]

Attributes

AttributeTypeRequiredDefaultDescription
idintegerYesThe quiz ID to display. Find this in the URL when editing a quiz.
contextstringNostandaloneThe context in which the quiz is being displayed. Used internally by LMS integrations. Possible values: standalone, learndash, tutor, lifter, learnpress.
show_descriptionbooleanNotrueShow the quiz description on the start page.
show_question_countbooleanNotrueShow the number of questions on the start page.
show_quiz_typebooleanNotrueShow the quiz type (e.g., “Test Mode”) on the start page.
show_time_limitbooleanNotrueShow the time limit on the start page (only if a time limit is set).
show_pass_percentagebooleanNotrueShow the passing score percentage on the start page.
show_attempt_historybooleanNotrueShow the user’s previous attempt history on the start page.
show_attempt_countbooleanNotrueShow the total number of attempts on the start page.
show_scorebooleanNotrueShow the score on the results page.
show_pass_failbooleanNotrueShow the pass/fail status on the results page.
show_time_spentbooleanNotrueShow the time spent on the results page.
show_category_breakdownbooleanNotrueShow the category performance breakdown on the results page.
show_question_reviewbooleanNotrueShow the question-by-question review on the results page.
show_retake_buttonbooleanNotrueShow the retake button on the results page. Hidden automatically when the student has no retakes remaining.
show_averagebooleanNotrueShow the average score on the results page.
pre_test_idintegerNoLink a pre-test quiz for pre/post comparison (requires Educator addon). The specified quiz ID is used as the pre-test for comparison on the results page.

Examples

Hide the description and question count on the start page:

[pressprimer_quiz id="42" show_description="false" show_question_count="false"]

Show only the score on the results page (hide everything else):

[pressprimer_quiz id="42" show_pass_fail="false" show_time_spent="false" show_category_breakdown="false" show_question_review="false" show_retake_button="false"]

Link a pre-test for comparison (Educator addon):

[pressprimer_quiz id="42" pre_test_id="10"]

Notes

  • The quiz must be published to display on the frontend.
  • If the quiz ID is invalid or the quiz doesn’t exist, nothing will be displayed.
  • Access restrictions (guest mode, login required) are enforced based on quiz settings.

Quiz Block

The Quiz block provides a visual way to embed quizzes using the Gutenberg editor.

Block Name: PPQ Quiz

How to Use

  1. In the block editor, click the + button to add a new block.
  2. Search for “PPQ Quiz”.
  3. Select the block and use the dropdown in the block settings to choose a quiz.
  4. The block will display a preview of the selected quiz title.

Notes

  • The block shows a placeholder if no quiz is selected.
  • Only published quizzes appear in the dropdown selector.
  • The block renders identically to the shortcode on the frontend.
  • Display option toggles are available in the block inspector sidebar. These control the same options as the shortcode display attributes (e.g., show_description, show_score).

My Attempts Shortcode

Display a table of the current user’s quiz attempts. Useful for student dashboards or profile pages.

[pressprimer_quiz_my_attempts]

Attributes

AttributeTypeRequiredDefaultDescription
per_pageintegerNo10Number of attempts to show per page. Set to -1 to show all attempts without pagination.
show_scorebooleanNotrueWhether to display the score column. Use true, false, 1, or 0.
show_datebooleanNotrueWhether to display the date column. Use true, false, 1, or 0.

Examples

Basic usage (shows 10 attempts with score and date):

[pressprimer_quiz_my_attempts]

Show 20 attempts per page:

[pressprimer_quiz_my_attempts per_page="20"]

Show all attempts without pagination:

[pressprimer_quiz_my_attempts per_page="-1"]

Hide the score column:

[pressprimer_quiz_my_attempts show_score="false"]

Hide both score and date columns:

[pressprimer_quiz_my_attempts show_score="false" show_date="false"]

Notes

  • Only logged-in users will see their attempts. Guests see a login prompt.
  • The table includes: Quiz Name, Score (optional), Date (optional), and a link to review the attempt.
  • Attempts are sorted by date, most recent first.
  • Clicking on an attempt opens the detailed results view.

My Attempts Block

The My Attempts block provides a visual way to add the attempts table using the Gutenberg editor.

Block Name: PPQ Quiz Attempts

How to Use

  1. In the block editor, click the + button to add a new block.
  2. Search for “PPQ Quiz Attempts”.
  3. Configure the display options in the block sidebar:
    • Show Score Column – Toggle on/off
    • Show Date Column – Toggle on/off
    • Attempts Per Page – Enter a number (or -1 for all)

Notes

  • The block shows a placeholder preview in the editor.
  • Settings can be adjusted in the block’s sidebar panel.
  • Renders identically to the shortcode on the frontend.

Dashboard Shortcode

Display the front-end dashboard, including the My Results screen where students review their past attempts. Premium add-ons add their own screens to the same dashboard.

[pressprimer_quiz_dashboard]

Notes

  • The shortcode has no attributes. Screens and navigation are determined by the active plugins and the user’s role.
  • After placing the shortcode, select the page in the Dashboard Page setting under PressPrimer Quiz > Settings > General so the plugin knows where to link.
  • Each screen has its own hash address (for example #/my-results), so links to specific screens can be bookmarked or added to menus.
  • The dashboard requires a signed-in user. Logged-out visitors see a login message.
  • Using the dashboard page as the site’s static front page is not supported.

Dashboard Block

The Dashboard block provides a visual way to add the front-end dashboard using the Gutenberg editor.

Block Name: PressPrimer Quiz Dashboard

How to Use

  1. In the block editor, click the + button to add a new block.
  2. Search for “PressPrimer Quiz Dashboard”.
  3. Add the block and publish the page. The block has no settings to configure.

Notes

  • The block shows a placeholder preview in the editor.
  • Renders identically to the shortcode on the frontend.
  • See The Front-End Dashboard for setup and screen details.

PressPrimer Quiz Educator

The Educator add-on adds group management, quiz assignments, and collaborative features. It includes shortcodes and blocks for displaying assigned quizzes to students.

Assigned Quizzes Shortcode

Display a list of quizzes assigned to the current user through their group memberships.

[ppqe_assigned_quizzes]

Attributes

AttributeTypeRequiredDefaultDescription
show_completedbooleanNotrueWhether to show completed assignments in the list. Use true, false, 1, or 0.
empty_messagestringNo“You don’t have any assigned quizzes.”Custom message to display when there are no assignments.

Examples

Basic usage (shows all assignments including completed):

[ppqe_assigned_quizzes]

Hide completed assignments:

[ppqe_assigned_quizzes show_completed="false"]

Custom empty message:

[ppqe_assigned_quizzes empty_message="No quizzes have been assigned to you yet. Check back later!"]

Notes

  • Only logged-in users see their assignments. Guests see a login prompt.
  • Assignments are organized by status: upcoming, available, completed.
  • Each assignment shows: Quiz name, Group name, Due date (if set), Status.
  • Clicking an assignment takes the user to the quiz player.
  • Overdue assignments are highlighted if late submissions are not allowed.

Assigned Quizzes Block

The Assigned Quizzes block provides a visual way to add the assignments list using the Gutenberg editor.

Block Name: PPQ Assigned Quizzes

Block Attributes

AttributeTypeDefaultDescription
showCompletedbooleantrueWhether to show completed assignments.
emptyMessagestring“You don’t have any assigned quizzes.”Message shown when there are no assignments.

How to Use

  1. In the block editor, click the + button to add a new block.
  2. Search for “PPQ Assigned Quizzes”.
  3. Configure the display options in the block sidebar:
    • Show Completed – Toggle on/off
    • Empty Message – Customize the no-assignments message

Notes

  • The block shows a placeholder preview in the editor.
  • Requires the Educator addon to be active.
  • Perfect for student dashboards or member areas.

Quiz Player Shortcode

Renders an assigned quiz with full assignment context, including deadline handling and late submission tracking. A page with this shortcode is automatically created on plugin activation and is the target of the assigned quizzes table. Users would generally not add this shortcode to a page themselves.

[ppqe_quiz_player]

Attributes

This shortcode has no configurable attributes. It reads the quiz and assignment context from URL parameters:

URL ParameterDescription
quiz_idThe quiz ID to display.
assignment_idThe assignment ID (for deadline tracking).
group_idThe group ID (for attribution).

PressPrimer Quiz School

The School addon adds spaced repetition functionality with a student-facing review dashboard.

Spaced Repetition Review Shortcode

Display a spaced repetition review dashboard where students can track their mastery progress and start review quizzes.

[pressprimer_quiz_sr_review]

Attributes

AttributeTypeRequiredDefaultDescription
quiz_idintegerNo0Scope the dashboard to a specific quiz. When set, only shows mastery data and due questions from that quiz. Use 0 to show all quizzes.
themestringNodefaultTheme for the generated review quiz. Options: default, minimal, modern.
condensedbooleanNofalseUse condensed display density for the review quiz.
max_questionsintegerNo20Maximum number of due questions to include in a review quiz.

Examples

Basic usage (shows mastery across all quizzes):

[pressprimer_quiz_sr_review]

Scope to a specific quiz:

[pressprimer_quiz_sr_review quiz_id="42"]

Use minimal theme with condensed layout:

[pressprimer_quiz_sr_review theme="minimal" condensed="true"]

Notes

  • Only logged-in users see their mastery data. Guests see a login prompt.
  • Students must complete quizzes that have spaced repetition enabled for data to appear.
  • The dashboard shows overall mastery percentage, counts of questions in each status (Learning, Reviewing, Mastered), and per-category progress bars.
  • When questions are due for review, a button appears to generate and start a review quiz.

Spaced Repetition Review Block

The Spaced Repetition Review block provides a visual way to add the review dashboard using the Gutenberg editor.

Block Name: PPQ Spaced Repetition Review

How to Use

  1. In the block editor, click the + button to add a new block.
  2. Search for “PPQ Spaced Repetition Review”.
  3. Configure the display options in the block sidebar:
    • Quiz – Select a specific quiz or leave as “All Quizzes”
    • Theme – Choose the theme for review quizzes
    • Condensed – Toggle condensed display
    • Max Questions – Set the maximum questions per review quiz

Notes

  • The block shows a placeholder preview in the editor.
  • Requires the School addon to be active.
  • Perfect for student dashboards or learning portals.

Study Session Shortcode

Renders the practice session player for Study Plans. Students land on this page when they start a study plan session from the dashboard.

[pressprimer_quiz_study_session]

Notes

  • The shortcode has no attributes. The session to display comes from the link the student followed, and the player’s theme and display density come from the Practice Sessions settings under PressPrimer Quiz > Settings > Mastery & Study Plans.
  • You normally do not need to place this shortcode yourself: the plugin creates a practice session page automatically the first time one is needed. Add it manually only if you want sessions on a different page, then select that page in the same settings tab.
  • Requires the School addon 3.1 or higher and a signed-in student with an active study plan session. Visitors without a session see a friendly message instead.

Troubleshooting

Quiz Not Displaying

  • Verify the quiz ID is correct.
  • Ensure the quiz is published (not draft or trashed).
  • Check that the user has permission to view the quiz.

Attempts Table Empty

  • The user must be logged in to see their attempts.
  • Verify the user has actually completed quiz attempts.
  • Check that attempts exist in the database (PressPrimer Quiz → Attempts).

Assigned Quizzes Empty

  • Ensure the Educator addon is activated.
  • Verify the user is a member of at least one group.
  • Check that quizzes have been assigned to the user’s groups.
  • Confirm assignments haven’t all been completed (if show_completed="false").

Block Not Appearing in Editor

  • Ensure the relevant plugin/addon is activated.
  • Clear your browser cache and refresh the editor.
  • Check for JavaScript errors in the browser console.

Get Tips, news & Discounts to your inbox

Get your own demo site

Get Tips, news & Discounts to your inbox