Skip to content

Conversation

@djoseph-apphelix
Copy link
Member

Description:

  • Fixes the “Show Answer” option not working in preview mode by reordering the showanswer condition checks. This ensures preview behavior matches the expected logic without affecting published problems.

Jira:

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a bug where the "Show Answer" option was not working for staff users in preview mode. The issue occurred when the showanswer field had an empty string value, which blocked staff users from seeing answers even though they should have preview access. The fix reorders the condition checks in the answer_available() method to allow staff users to bypass the empty string check while still respecting the explicit SHOWANSWER.NEVER setting.

Key changes:

  • Reordered condition checks in answer_available() method to check for staff users before checking for empty string showanswer values
  • Staff users can now see answers in preview mode even when showanswer == '', enabling proper preview functionality in Studio

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@djoseph-apphelix djoseph-apphelix merged commit 201009d into release-ulmo Dec 1, 2025
70 checks passed
@djoseph-apphelix djoseph-apphelix deleted the fix/TNL2-446 branch December 1, 2025 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants