LMS & eLearning

Building a Quiz Template in Elementor for LearnDash

How the LearnDash Elementor Single Quiz document works: the Quiz Content widget, the attempts alert and progression checks the add-on renders, materials, and why quizzes often need no template at all.

Building a Quiz Template in Elementor for LearnDash

Quizzes are the step type where an Elementor template adds the least design freedom and carries the most risk. The questions, timer, results and retake button are produced by LearnDash's quiz engine with its own markup and scripts, and a template can only decide what surrounds them. Early versions of the LearnDash Elementor add-on were known for unlimited retakes and missing quiz content inside templates, both since fixed. This guide explains how the Single Quiz document works in version 1.0.9.1, what the Quiz Content widget actually renders, and how to decide whether to build a quiz template at all.

What the Single Quiz document does

The add-on registers a Single Quiz document in Elementor Pro's Theme Builder, with its condition tied to the quiz post type. Unlike the lesson and topic documents it does not add video content or a step-start activity record, because quizzes track attempts themselves. On a singular quiz it filters the_content only to attach the Materials according to the document's Materials Display setting. Everything else about access comes from the Quiz Content widget and the quiz view template the add-on swaps in.

The Quiz Content widget

The widget wraps [ld_quiz]. Its Settings section has a Quiz field and a Course field, both numeric IDs, and a Preview Setting section with autocomplete pickers for a preview quiz and course. On a Theme Builder template leave the Quiz field empty so the current quiz is used; set it only when embedding a specific quiz on a page. In the editor, if no preview quiz is chosen, the add-on uses the quiz being edited or the first published quiz, so you see real questions while designing. The Style tab covers the Start button's color and background and little else; question styling remains LearnDash's.

When the widget renders on the front end, LearnDash's quiz shortcode resolves to the advanced quiz output, the same [LDAdvQuiz] markup a normal quiz page uses, with the quiz scripts enqueued. That is why a template cannot change the question layout: the widget is a container, not a re-implementation.

What the quiz view adds around the widget

When a quiz is in Elementor edit mode or covered by a document, the add-on replaces LearnDash's quiz template with its own view. That view renders, in order: the quiz infobar; the progression checks, wrapped in the learndash-quiz-progression-before and learndash-quiz-progression-after actions, which show LearnDash's message when the previous lesson or topic is incomplete; the attempts alert when the learner has used up the allowed repeats, wrapped in learndash-quiz-attempts-alert-before and learndash-quiz-attempts-alert-after; and the quiz itself between learndash-quiz-actual-content-before and learndash-quiz-actual-content-after. The attempts message reads "You have already taken this quiz N time(s)" followed by the allowed number, and it is the fix for the unlimited-retake bug: the view checks attempts before rendering the quiz rather than trusting the widget alone. Our guide to limiting quiz attempts explains the settings the check reads.

Access checks

Quiz access is evaluated with LearnDash's learndash_is_quiz_accessable(), which considers the course, the parent lesson or topic and progression. The add-on's user step access helper returns a state for quizzes based on that function, so a quiz reached by URL before its lesson is complete shows the progression message rather than the questions. Administrators who can bypass progression see the quiz regardless, and the widget rendering filter that blanks unready widgets on other steps leaves the quiz widget alone, because it is on the default allowed list. Test with a learner account, as always.

Build the template

  1. Open Templates > Theme Builder, add a Single template for the quiz post type, and import the saved LearnDash Single Quiz template or start blank.
  2. Place a dynamic Post Title, a Course Infobar widget (it shows as Quiz Infobar and renders breadcrumbs and status), Elementor Pro's Post Content widget for the quiz description, and the Quiz Content widget.
  3. Leave the Quiz and Course fields empty on the widget. Set a preview quiz so the editor shows questions.
  4. Set Materials Display in the document settings; append is the imported default.
  5. Publish with Include > Quizzes > All.

Keep the layout narrow and free of sticky elements near the quiz, because LearnDash's quiz scripts scroll the page to the question list and the results box, and a fixed header that overlaps them is the most common complaint after launch.

The quiz description and version 1.0.9

Version 1.0.9 fixed a bug where the quiz post content did not appear for enrolled users inside a template. With the fix, the Post Content widget shows the description you wrote in the quiz editor and the add-on appends the materials. If the description is missing on your site, confirm the add-on version first, then check whether the quiz has "quiz materials" enabled with an empty field, which produces nothing by design.

When to skip the quiz template

Many sites gain nothing from a quiz template. If your lesson and topic templates already carry the branding, and the quiz page's job is simply to present questions, leaving quizzes on the LD30 template or in Focus Mode gives you LearnDash's tested layout and sidebar for free. A quiz template is worth building when the quiz page needs the same header, footer and typography as your Elementor site and your theme's defaults clash, or when quizzes are sold or used standalone outside a course and need a marketing layout around them. The trade-offs between Focus Mode and Elementor are covered in Focus Mode and the Elementor add-on.

Common problems

  • Questions never load, only a spinner. A script is being deferred or combined by an optimization plugin. Exclude the LearnDash quiz scripts and jQuery from optimization for quiz pages.
  • Start button appears but clicking does nothing. Usually a JavaScript error from another widget on the template. Check the browser console and remove widgets one at a time.
  • Quiz shows for everyone, including before the lesson. You are testing as an administrator, or a snippet returns true from learndash_previous_step_completed for all users.
  • Results page styling is off. LearnDash's quiz CSS expects its wrapper classes; a template section with custom typography on all paragraphs will override the result table. Scope your typography to a class.

A broader list of template failures, including Mark Complete problems, is in fixing Elementor templates that break LearnDash Mark Complete and quizzes. If the quiz experience itself needs changing, such as custom result pages or per-question feedback layouts, that is quiz template and hook work rather than Elementor work; our LearnDash services team handles both, and a LearnDash developer can advise which layer to change.

Frequently asked questions

Can I style individual quiz questions in Elementor?

No. The Quiz Content widget styles the Start button only. Question, answer and result styling comes from LearnDash's quiz CSS and is changed with custom CSS or LearnDash template overrides.

Does the quiz template respect the number of allowed attempts?

Yes. The add-on's quiz view checks attempts before rendering and shows the attempts alert instead of the quiz when the limit is reached, using LearnDash's repeat settings.

Can I embed a quiz on a normal Elementor page?

Yes. Add the Quiz Content widget to the page and set the Quiz ID. Course-linked quizzes still enforce enrollment and progression through LearnDash's access check.

Should quizzes use Focus Mode instead?

If Focus Mode is enabled, LearnDash keeps processing quiz pages even with the add-on active, so many sites leave quizzes in Focus Mode and template only courses. Either approach works; pick one and test it.

Add WorldWin Coder to your preferred sources

Add worldwincoder.com as a preferred source on Google, or open this article in your AI assistant to use it as a source.

· Developers and project managers

Articles written and reviewed by the developers and project managers at WorldWin Coder, who build and maintain websites, web applications and mobile apps on WordPress, Moodle, PHP, Laravel, CodeIgniter and Flutter.

Free consultation

Need help with LearnDash?

Tell us what you are working on. A developer who does this every week reads your message and replies within one business day with next steps and a free quote.

  • Free consultation and quote
  • NDA on request
  • You own the source code
  • Reply within one business day

Tell us about your project

Add budget and timeline optional, helps us quote faster

This form is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Keep reading

Have something to build, fix or move?

Tell us where you are. A developer reads every inquiry, and you get next steps and a free quote within one business day.