You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The aside sends the block's Studio display_name and the feedback drawer labels itself with it. For most block types that name is never drawn on the page, so learners see internal authoring notes like "Wk3 intro copy - REVISED, do not reuse".
Adds a curated block-type → title-field map (DEFAULT_VISIBLE_TITLE_FIELDS) and sends the result as a new visibleTitle field on the ol-feedback::drawer-open payload. It is "" for types that render no title, which is the drawer's cue to name the block type instead.
blockDisplayName is unchanged, so the submitted record still carries the Studio name the content team uses to find the component.
Bumps the package to 0.3.1 and documents the map in the README.
Implementation details
Most mapped types report display_name. Two don't, because their Studio "name" input writes somewhere else:
openassessment renders its own title field.
survey renders block_name — the Studio editor writes the name input to block_name (poll/poll.py:1260,1275) and leaves display_name at the class default "Survey". Its template confirms it: survey.html:6 is <h3 class="poll-header">{{block_name}}</h3>.
The two polls are different blocks and land on opposite sides of the map:
poll (the third-party poll package) is mapped. poll.html:7 renders <h3 class="poll-header">{{ display_name }}</h3>, and the question lives in a separate question field shown as the fieldset legend.
poll_question (the built-in) is not mapped. Its extracted template renders only a hidden JSON config div and the JS draws the question text; display_name never reaches the page.
drag-and-drop-v2's title only renders when the author's show_title toggle is on, so TITLE_VISIBILITY_TOGGLES gates it. A runtime missing the field is treated as hidden rather than assumed visible.
The map keys on the usage-key category. The xblocks-contrib extracted variants register under _<name>_extracted entry points but keep the plain category and render the name the same way, so they need no separate entry.
Types outside the map report no visible title on purpose. Omitting one costs generic wording in the panel; adding a wrong one leaks an author's private note.
The map is a constant, not a setting. An operator-settable version can only widen what the panel shows, which is the leak this PR exists to close, and each entry is a claim about what a block draws on the page — that belongs in reviewed code. get_visible_title still type-checks the value it reads, because most of the mapped blocks ship in third-party packages that can redefine a field in any release, and this runs inside student_view_aside where a raise breaks the learner's page rather than just the panel.
Screenshots (if appropriate):
Full-page shots from a Tutor LMS, one per map case, with the companion smoot bundle deployed. The red outline marks the block whose 📣 was clicked; the drawer is in the right sidebar, so each shot shows both what the block draws on the page and what the aside told the panel to say.
Video — mapped to display_name. The name is on the page as a heading, so sending it is safe.
Problem — mapped to display_name. Same, with the name rendered above the choices.
poll (third-party) — mapped. This is the evidence for mapping poll but not poll_question: the <h3> is display_name ("WHICH APPROACH DID YOU PREFER?") and the question field is separate below it ("What is your favorite color?").
survey — mapped to block_name, not display_name. The heading is block_name, and that's what the panel names.
Text block — not mapped. Its Studio name is Wk3 intro copy - REVISED, do not reuse; the block renders only its body text. The name is on neither the page nor the panel.
poll_question (built-in) — not mapped. It draws its question text, so the aside withholds the title and the drawer names the type.
Problem with a blank Studio name. A mapped type with a blank name reports no visible title rather than an empty one.
Unmapped type.done is outside the map, so no title is sent and the drawer falls back to generic wording.
How can this be tested?
Install the plugin in the LMS and enable the ol_openedx_feedback.feedback_enabled CourseWaffleFlag (globally or per course). The panel wording also needs the companion smoot bundle (mitodl/smoot-design#263) deployed in the Learning MFE — an older bundle ignores visibleTitle and keeps showing the Studio name.
Author a unit with one block per case: a video named in Studio, a text/HTML block, and a built-in poll. Give the text block a deliberately author-only name like Wk3 intro copy - REVISED, do not reuse so a leak is obvious.
Open the unit as a signed-in learner and click the 📣 on each block:
Title path — the video panel reads What kind of feedback do you have about <the video's title>?
Fallback path — the text block reads "…about this text?" and the poll "…about this poll?", with no Studio name anywhere in the panel.
Record unchanged — submit from the text block and confirm the mit-learn row still has block_display_name set.
Automated: pytest src/ol_openedx_feedback/tests — 50 pass. test_utils.py covers each mapped field, the show_title toggle, lazy translation proxies, and a non-string title; test_aside.py asserts the payload carries visibleTitle for a video and withholds it for an html block while still sending blockDisplayName.
Inside a Tutor dev container that command needs --ds=lms.envs.test. The container exports DJANGO_SETTINGS_MODULE=lms.envs.tutor.development, and pytest-django ranks the environment variable above the DJANGO_SETTINGS_MODULE in this package's setup.cfg, so collection otherwise fails on COMMON_TEST_DATA_ROOT:
Run on a Tutor LMS against a test course with a section per case — the screenshots above are that run, one shot per case. drag-and-drop-v2's show_title toggle, lazy translation proxies and non-string titles are covered by unit tests only.
Require compatible drawer clients to enforce hidden display names
src/ol_openedx_feedback/README.rst:19
The “never shown” guarantee is not enforced by this plugin: blockDisplayName is still sent to the learner’s browser, and the currently deployed drawer reads this field until the paired smoot-design change is deployed. Phrase this as a requirement for compatible drawer clients so the documentation remains accurate during the documented staggered rollout.
…render one
For most block types display_name is an authoring label that never appears on
the learner's page ("Wk3 intro copy - REVISED, do not reuse"), so the feedback
drawer was naming blocks with text only the author was meant to see.
The payload now carries `visibleTitle`, set from a curated map of the types
that do draw a title and the field holding it — display_name for most, `title`
for openassessment, `block_name` for survey. A type outside the map sends "",
which the drawer renders as generic block-type wording. drag-and-drop-v2 is
gated on its author-controlled `show_title` toggle.
blockDisplayName is still sent, so the submission keeps recording the Studio
name for the content team.
Each map entry asserts that the type draws that field on the learner's page, so
a wrong entry leaks the author's private note — which is the bug the map exists
to prevent. It is therefore deliberately not a deployment setting, every entry
was verified against the rendering template, and a test fails if a new
display_name entry ships uncovered.
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
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.
What are the relevant tickets?
Part of https://github.com/mitodl/hq/issues/13643
Paired with mitodl/smoot-design#263 — both are needed for the fix to show up.
Description (What does it do?)
The aside sends the block's Studio
display_nameand the feedback drawer labels itself with it. For most block types that name is never drawn on the page, so learners see internal authoring notes like "Wk3 intro copy - REVISED, do not reuse".DEFAULT_VISIBLE_TITLE_FIELDS) and sends the result as a newvisibleTitlefield on theol-feedback::drawer-openpayload. It is""for types that render no title, which is the drawer's cue to name the block type instead.blockDisplayNameis unchanged, so the submitted record still carries the Studio name the content team uses to find the component.Implementation details
Most mapped types report
display_name. Two don't, because their Studio "name" input writes somewhere else:openassessmentrenders its owntitlefield.surveyrendersblock_name— the Studio editor writes the name input toblock_name(poll/poll.py:1260,1275) and leavesdisplay_nameat the class default"Survey". Its template confirms it:survey.html:6is<h3 class="poll-header">{{block_name}}</h3>.The two polls are different blocks and land on opposite sides of the map:
poll(the third-partypollpackage) is mapped.poll.html:7renders<h3 class="poll-header">{{ display_name }}</h3>, and the question lives in a separatequestionfield shown as the fieldset legend.poll_question(the built-in) is not mapped. Its extracted template renders only a hidden JSON config div and the JS draws the question text;display_namenever reaches the page.drag-and-drop-v2's title only renders when the author'sshow_titletoggle is on, soTITLE_VISIBILITY_TOGGLESgates it. A runtime missing the field is treated as hidden rather than assumed visible.The map keys on the usage-key
category. Thexblocks-contribextracted variants register under_<name>_extractedentry points but keep the plain category and render the name the same way, so they need no separate entry.Types outside the map report no visible title on purpose. Omitting one costs generic wording in the panel; adding a wrong one leaks an author's private note.
The map is a constant, not a setting. An operator-settable version can only widen what the panel shows, which is the leak this PR exists to close, and each entry is a claim about what a block draws on the page — that belongs in reviewed code.
get_visible_titlestill type-checks the value it reads, because most of the mapped blocks ship in third-party packages that can redefine a field in any release, and this runs insidestudent_view_asidewhere a raise breaks the learner's page rather than just the panel.Screenshots (if appropriate):
Full-page shots from a Tutor LMS, one per map case, with the companion smoot bundle deployed. The red outline marks the block whose 📣 was clicked; the drawer is in the right sidebar, so each shot shows both what the block draws on the page and what the aside told the panel to say.
Video — mapped to
display_name. The name is on the page as a heading, so sending it is safe.Problem — mapped to
display_name. Same, with the name rendered above the choices.poll(third-party) — mapped. This is the evidence for mappingpollbut notpoll_question: the<h3>isdisplay_name("WHICH APPROACH DID YOU PREFER?") and thequestionfield is separate below it ("What is your favorite color?").survey— mapped toblock_name, notdisplay_name. The heading isblock_name, and that's what the panel names.Text block — not mapped. Its Studio name is
Wk3 intro copy - REVISED, do not reuse; the block renders only its body text. The name is on neither the page nor the panel.poll_question(built-in) — not mapped. It draws its question text, so the aside withholds the title and the drawer names the type.Problem with a blank Studio name. A mapped type with a blank name reports no visible title rather than an empty one.
Unmapped type.
doneis outside the map, so no title is sent and the drawer falls back to generic wording.How can this be tested?
Install the plugin in the LMS and enable the
ol_openedx_feedback.feedback_enabledCourseWaffleFlag (globally or per course). The panel wording also needs the companion smoot bundle (mitodl/smoot-design#263) deployed in the Learning MFE — an older bundle ignoresvisibleTitleand keeps showing the Studio name.Author a unit with one block per case: a video named in Studio, a text/HTML block, and a built-in poll. Give the text block a deliberately author-only name like
Wk3 intro copy - REVISED, do not reuseso a leak is obvious.Open the unit as a signed-in learner and click the 📣 on each block:
What kind of feedback do you have about <the video's title>?block_display_nameset.Automated:
pytest src/ol_openedx_feedback/tests— 50 pass.test_utils.pycovers each mapped field, theshow_titletoggle, lazy translation proxies, and a non-string title;test_aside.pyasserts the payload carriesvisibleTitlefor a video and withholds it for anhtmlblock while still sendingblockDisplayName.Inside a Tutor dev container that command needs
--ds=lms.envs.test. The container exportsDJANGO_SETTINGS_MODULE=lms.envs.tutor.development, and pytest-django ranks the environment variable above theDJANGO_SETTINGS_MODULEin this package'ssetup.cfg, so collection otherwise fails onCOMMON_TEST_DATA_ROOT:Run on a Tutor LMS against a test course with a section per case — the screenshots above are that run, one shot per case.
drag-and-drop-v2'sshow_titletoggle, lazy translation proxies and non-string titles are covered by unit tests only.Additional Context