fix(builder): display quiz post ID in course builder quiz card header#3193
Open
faisalahammad wants to merge 1 commit into
Open
fix(builder): display quiz post ID in course builder quiz card header#3193faisalahammad wants to merge 1 commit into
faisalahammad wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.phpBefore:
<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
idandhas_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
Result:
ID: <post_id>appears below the quiz title.Test 2: Unsaved quiz hides ID
Result: The
ID:label is not shown while the quiz still has atemp_ID.Test 3: Lesson ID display unchanged
Result: The existing
ID:display for lessons is unchanged.Screenshot