edx-platform
edx-platform copied to clipboard
feat: Adding 'Show Answer' setting argument passing support in XBlock
Problem
The global setting for the Show Answer button is not working for the d&dv2 block;
Fix
Adding 'Show Answer' setting argument passing support in XBlock
This is a part of xblock-drag-and-drop-v2 #294
json_init_args = frag.json_init_args
if hasattr(block, "showanswer"):
json_init_args["showanswer"] = block.showanswer
template_context['js_init_parameters'] = json_init_args
Testing instructions
- creating a new course or using Demo Course created by devstack.
- go to "Settings" -> "Advanced Settings" in the studio and search for "Show Answer" and set it to "finished".
- Enabling Drag and Drop in Studio
- Go to Studio UI and create a new unit
- Select Problem > Advanced > Drag and Drop, to create a v2 drag and drop XBlock
- Click Edit and change mode to Assessment
- Click Continue twice and Save
- Click on View Live Version
- "showanswer" with value "finished" will be added to the problem init_parameters
Deadline
"None" if there's no rush, or provide a specific date or event (and reason) if there is one.
Other information
Include anything else that will help reviewers and consumers understand the change.
- Current PR should unblock https://github.com/openedx/xblock-drag-and-drop-v2/pull/294
Thanks for the pull request, @abodacs! Please note that it may take us up to several weeks or months to complete a review and merge your PR.
Feel free to add as much of the following information to the ticket as you can:
- supporting documentation
- Open edX discussion forum threads
- timeline information ("this must be merged by XX date", and why that is)
- partner information ("this is a course on edx.org")
- any other information that can help Product understand the context for the PR
All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here.
Please let us know once your PR is ready for our review and all tests are green.
@abodacs Thank you for the contribution. Once you CLA has been finalized, we will be able to review.
@abodacs Thanks for sorting out the CLA agreement.
📣 💥 Heads-up: You must either rebase onto master or merge master into your branch to keep passing required checks.
We added a new required check, "Tests Successful," that this PR does not yet run. Rebasing will get it started.
If you have any questions, please reach out to the Architecture team (either #architecture on Open edX Slack or #external-architecture on edX internal Slack).
Hi @abodacs! Are you planning to pursue this PR? If so, looks like you will need to rebase (per the comment above), and re-run the failing test(s). Thank you!
I don't think we need this PR as @Agrendalath showed me how to pass an argument in XBlock
Thanks @mphilbrick211 You are free to close this PR
Thanks for the ping, @abodacs - I wasn't aware of this PR. We can close it.
cc: @mphilbrick211
@abodacs Even though your pull request wasn’t merged, please take a moment to answer a two question survey so we can improve your experience in the future.