Autoformat Problem XBlock Source Files for Consistency (1/3)#37476
Autoformat Problem XBlock Source Files for Consistency (1/3)#37476irtazaakram merged 4 commits intomasterfrom
Conversation
c2f0f65 to
e3f3005
Compare
7920e3e to
8a5ec40
Compare
| we'll combine the system's per-student seed with the problem id in picking the bin. | ||
| """ | ||
| r_hash = hashlib.sha1() | ||
| r_hash = hashlib.sha256() |
There was a problem hiding this comment.
This is to address https://github.com/openedx/edx-platform/security/code-scanning/465
|
Sandbox deployment failed 💥 |
|
Sandbox deployment successful 🚀 |
|
Sandbox deployment failed 💥 |
|
Sandbox deployment successful 🚀 |
|
Sandbox deployment successful 🚀 |
|
Sandbox deployment successful 🚀 |
|
Sandbox deployment successful 🚀 |
|
Sandbox deployment successful 🚀 |
|
Sandbox deployment successful 🚀 |
d5a4e6e to
072eceb
Compare
|
Sandbox deployment successful 🚀 |
|
Sandbox deployment successful 🚀 |
|
Sandbox deployment successful 🚀 |
…#37476) * fix: run formatter black and isort * fix: linting, pydocstyle, xsslint and security issues
This PR applies consistent formatting across all Problem XBlock–related files to align with the formatting conventions used in the
xblocks-contribextraction. The goal is to minimize noise during the extraction review and ensure that only functional differences remain when moving the Problem XBlock out ofedx-platform.We are in the process of extracting the Problem XBlock into
xblocks-contrib/problem, where all code and templates are already formatted consistently. To make the migration diff easier for reviewers—and to avoid unnecessary churn caused by formatting—we are pre-formatting the corresponding files insideedx-platformusing the same tools and configuration.Related PR: openedx/xblocks-contrib#63
Python Files
Targeted files include:
Testing:
partial_credit="EDC", selected a mix of right/wrong answers, and confirmed a partial score (e.g., 50%) was awarded.partial_credit="halves", selected one wrong option, and confirmed the score was cut exactly in half.inline="1"and confirmed the dropdown rendered inside the text flow, not on a new line.type="ci"(Case Insensitive), submitted"paris"for answer"Paris", and verified it was accepted.type="cs"(Case Sensitive), submitted"paris"for answer"Paris", and verified it was rejected.[1, 2]), submitted a value inside the range, and confirmed it was marked Correct.max_attemptsto 1, submitted an answer, and confirmed the Submit button disabled immediately.max_attemptsto 3, submitted incorrect answers, and confirmed the button remained enabled until the 3rd submission.max_attemptsto 0 (unlimited) and confirmed the problem never locks regardless of submissions.show_reset_button="true", clicked Reset on an un-submitted input, and confirmed the field cleared.show_reset_button="false"and confirmed the Reset button was hidden in the LMS.showanswer="always"and confirmed the Show Answer button was visible immediately upon page load.showanswer="answered"and confirmed the button appeared only after a correct submission.showanswer="attempted"and confirmed the button appeared after the first incorrect submission.showanswer="past_due", manipulated the due date to the past, and confirmed the button appeared immediately.rerandomize="on_reset"(on a problem with a Python script), clicked Reset, and confirmed the random values changed.rerandomize="never", clicked Reset, and confirmed that only inputs cleared while the random values remained static.shuffle="true"on a Multiple Choice problem, reloaded the page 3 times, and confirmed the order of answers changed.<choicehint>), then attempted to switch back to the Visual Editor to confirm the system prevented the action.1 + x^2forx^2 + 1), and confirmed the parser accepted it.During testing on the sandbox, the following problems were observed to be non-functional, but this is not caused by the changes in this PR
Relevant issue: #36538