Skip to content

fix(builder): display quiz post ID in course builder quiz card header#3193

Open
faisalahammad wants to merge 1 commit into
gocodebox:devfrom
faisalahammad:fix/3024-quiz-id-in-builder
Open

fix(builder): display quiz post ID in course builder quiz card header#3193
faisalahammad wants to merge 1 commit into
gocodebox:devfrom
faisalahammad:fix/3024-quiz-id-in-builder

Conversation

@faisalahammad

@faisalahammad faisalahammad commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Summary

When multiple quizzes share the same title, course instructors cannot tell them apart while configuring quiz-based engagements. This change adds the quiz post ID to the course builder quiz card header, mirroring the existing lesson ID display.

Fixes #3024

Changes

includes/admin/views/builder/quiz.php

Before:

<h3 class="llms-headline llms-model-title">
    <?php esc_html_e( 'Title', 'lifterlms' ); ?>: <span class="llms-input llms-editable-title" contenteditable="true" data-attribute="title" data-original-content="{{{ data.get( 'title' ) }}}" data-required="required">{{{ data.get( 'title' ) }}}</span>
</h3>

<div class="llms-headline llms-quiz-points">

After:

<h3 class="llms-headline llms-model-title">
    <?php esc_html_e( 'Title', 'lifterlms' ); ?>: <span class="llms-input llms-editable-title" contenteditable="true" data-attribute="title" data-original-content="{{{ data.get( 'title' ) }}}" data-required="required">{{{ data.get( 'title' ) }}}</span>
</h3>

<# if ( ! data.has_temp_id() ) { #>
    <span class="llms-item-id"><?php esc_html_e( 'ID:', 'lifterlms' ); ?> {{{ data.get( 'id' ) }}}</span>
<# } #>

<div class="llms-headline llms-quiz-points">

Why: The builder quiz model already exposes id and has_temp_id(), so the template change is the minimal fix. Hidden temp IDs for unsaved quizzes match the lesson card behavior.

Testing

Test 1: Saved quiz shows ID

  1. Open a course in the course builder.
  2. Add a lesson and create a new quiz inside it.
  3. Save the course so the quiz gets a real post ID.
  4. Reopen the quiz card header.

Result: ID: <post_id> appears below the quiz title.

Test 2: Unsaved quiz hides ID

  1. Add a new lesson and start a new quiz.
  2. Do not save.

Result: The ID: label is not shown while the quiz still has a temp_ ID.

Test 3: Lesson ID display unchanged

  1. Open a saved lesson card.

Result: The existing ID: display for lessons is unchanged.

Screenshot

image

@faisalahammad faisalahammad requested a review from brianhogg as a code owner June 16, 2026 18:56
@brianhogg brianhogg moved this to Awaiting Review in Development Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Awaiting Review

Development

Successfully merging this pull request may close these issues.

2 participants