Repository navigation
fix: close the LTI gaps from the built-in block - #360
irfanuddinahmad wants to merge 1 commit into
Conversation
Port the two platform changes that never reached xblock_lti, and fix five places where the extracted block behaves worse than the built-in one: - Docs link in the Studio help text: edx.readthedocs.io -> docs.openedx.org (openedx/openedx-platform#36461). - pytz -> zoneinfo in block.py and the LTI tests, and drop the direct pytz dependency (openedx/openedx-platform#37562). - lti.html: the grader feedback label used Mako syntax in a Django template, so learners saw the literal ${_("...")}. Use {% trans %}. - Score text: render "{points} / {total_points} points" and "{total_points} points possible" with the block's catalog, as the built-in block did, instead of "(1.0 total_points possible)". - The "View resource in a new window" default and the missing launch_url message used _() inside template variables, which reads Django's global catalog. Use {% trans %} so they come from the block's catalog. - lti.js: wrap the three confirm() prompts in gettext() again, using the block's JS catalog (window.XBlockLTII18N) when the runtime provides one. - lti.css: scope every rule to the block's .lti-wrapper root, so LTI styles no longer restyle other blocks' .problem-progress / .problem-header. Closes openedx#359. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks for the pull request, @irfanuddinahmad! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. DetailsWhere can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
Summary
xblock_lti, and five places where the extracted LTI block behaves worse than the built-in one.Changes
docs.openedx.orgpytz→zoneinfo(platform #37562)block.pyand the LTI tests usezoneinfo;pytzis no longer a direct dependency (two lines removed fromuv.lock)${_("...")}{% trans %}inlti.html{points} / {total_points} pointsand{total_points} points possiblewith its own catalog, as the built-in block didconfirm()prompts are English-onlygettext(), using the block's JS catalog (window.XBlockLTII18N) when the runtime provides one, else the page's globalgettext_()inside template variables reads Django's global cataloglaunch_urlmessage use{% trans %}lti.cssis scoped to the block's.lti-wrapperrootTranslations: "View resource in a new window" and "{points} / {total_points} points" are already translated in openedx-translations. "{total_points} points possible", the feedback label, the missing-
launch_urlmessage and the three prompts are new to this catalog, so they show in English until the next translation cycle.Test plan
New
src/xblock_lti/tests/test_lti_student_view.py(11 tests) rendersstudent_viewand checks each item, including translations through a stub block catalog. 10 of them fail onmain; the 11th checks English score text, whichmainalready got right.pytest src/xblock_lti/tests/: 55 passed.ruff check,ruff format --checkandpylint src/xblock_ltiare clean.uv lock --checkpasses with uv 0.12.6 and 0.13.12.Live in a local Tutor (platform master, xblocks-core 4.0.0 with this PR's four LTI files on top; LTI is unchanged between 4.0.0 and
main), as a learner, in a unit with two scored LTIs, an LTI withoutlaunch_urland a Problem:${_("Feedback on your work from the grader:")}.problem-progressnext to the LTIpadding-left: 5px,font-weight: 100(LTI's rules)0px,400confirm()on the new-window linkgettext()Closes #359. Part of the Slash-n-Burn Built-In XBlocks epic.
🤖 Generated with Claude Code