-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FC-0049] feat: Serialize tag data in OpenAssessmentBlocks #2171
[FC-0049] feat: Serialize tag data in OpenAssessmentBlocks #2171
Conversation
Thanks for the pull request, @yusuf-musleh! 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:
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. |
b9b410c
to
fb2b60f
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2171 +/- ##
=======================================
Coverage 94.95% 94.95%
=======================================
Files 191 191
Lines 20675 20691 +16
Branches 1879 1880 +1
=======================================
+ Hits 19631 19647 +16
Misses 780 780
Partials 264 264
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
8667fa7
to
f0cd479
Compare
f0cd479
to
5e9424c
Compare
Hey @yusuf-musleh, this will need to go through internal review before we can mark it as ready for upstream review, right? |
@itsjeyd Yup that's correct. Awaiting review/feedback from @ChrisChV and/or @bradenmacdonald first. |
openassessment/xblock/utils/xml.py
Outdated
if hasattr(oa_block, 'serialize_tag_data') and callable(oa_block.serialize_tag_data): # pylint: disable=no-member | ||
tag_data = oa_block.serialize_tag_data() # pylint: disable=no-member | ||
if tag_data: | ||
root.set('tags-v1', tag_data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest that in TaggedBlockMixin
you put these lines of code:
into a helper function called add_tags_to_node
. And then this can just become:
if hasattr(oa_block, 'serialize_tag_data') and callable(oa_block.serialize_tag_data): # pylint: disable=no-member | |
tag_data = oa_block.serialize_tag_data() # pylint: disable=no-member | |
if tag_data: | |
root.set('tags-v1', tag_data) | |
if hasattr(oa_block, 'add_tags_to_node') and callable(oa_block.add_tags_to_node): # pylint: disable=no-member | |
# This comes from TaggedBlockMixin | |
oa_block.add_tags_to_node(root) # pylint: disable=no-member |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, much cleaner. I've updated it, and also updated the edx-platform PR to use it as well.
5e9424c
to
c16553c
Compare
c16553c
to
c3e6ed5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yusuf-musleh Looks good 👍
- I tested this: I followed the testing instructions of [FC-0049] feat: Serialize tag data in OLX for blocks edx-platform#34145 and I tested to copy an OpenAssessmentBlocks.
- I read through the code and considered the security, stability and performance implications of the changes.
- Includes tests for bugfixes and/or features added.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
- I tested this on my devstack by following the steps in the PR
- I read through the code
-
I checked for accessibility issuesN/A -
Includes documentationN/A -
User-facing strings are extracted for translationN/A
@yusuf-musleh 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future. |
TL;DR - This PR utilizes changes introduced in openedx/edx-platform#34145 to serialize and include tags data in OpenAssessmentBlocks
What changed?
serialize_tag_data
is called and the result (if any) is added to the OLX nodeDeveloper Checklist
Testing Instructions
Follow the testing instruction in openedx/edx-platform#34145 and make sure to setup ora2 locally on this branch, and include a few OpenAssessmentBlocks in the course and apply a few tags on it and then double check that
tags-v1
is included in the OLX (if tags are applied to the block)Reviewer Checklist
Collectively, these should be completed by reviewers of this PR:
FYI: @openedx/content-aurora