-
Notifications
You must be signed in to change notification settings - Fork 4
Fix Python and JavaScript (Karma) tests for Problem XBlock #151
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
base: problemblock
Are you sure you want to change the base?
Conversation
3c433b8 to
e0497fd
Compare
|
|
||
| - name: Build JavaScript bundles | ||
| run: | | ||
| npm install |
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.
same as above comment.
https://github.com/openedx/xblocks-contrib/pull/151/changes#r2773284533
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 added the npm run build step because the package requires the bundled JavaScript and CSS files in the public folder for the problem XBlock. These assets aren’t stored in the repo (public is gitignored) and are only supposed to be included in the published PyPi package.
kdmccormick
left a comment
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'm still working through the review, here are my comments so far
| try: | ||
| from openedx.core.djangoapps.waffle_utils import CourseWaffleFlag |
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.
Instead of bringing this flag in here, I think we should add this function the XQueueService, and then ensure that the service is available in LMS. The implementation in openedx-platform would check the waffle flag, and on the xblocks-contrib side, we would just do something like self.service(self, 'xqueue').use_edx_submissions_for_queue().
If you don't want to do that refactor as part of this PR, that makes sense--it would be good to get this PR merged in soon since it's so big. But I would like to remove this import before we enable the block in openedx-platform.
cc'ing @farhan, as has experience moving methods into XBlock services from the Video extraction work.
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.
Just studied XQueueService, it seems like we are going to create new XBlock service in the edx-platform naming 'xqueue` for this waffle flag, is it correct? @kdmccormick
9c42194 to
c52b875
Compare
| FEATURES = getattr(settings, "FEATURES", {}) | ||
| except ImproperlyConfigured: | ||
| FEATURES = {} | ||
| class InheritanceKeyValueStore(KeyValueStore): |
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.
Can we try avoid its definition and use xblock/runtime.py:DictKeyValueStore directly from xblock package as we are not using inherited_settings of InheritanceKeyValueStore in its usage.
|
|
||
| return xblock | ||
|
|
||
| @property |
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.
We can create a separate mixin like we did in video block here; also avoid usage of name xmodule
| f"Unable to create xml for block {self.location}. " | ||
| f"Context: '{lines[line - 1][offset - 40 : offset + 40]}'" | ||
| ) | ||
| raise ValueError(msg) from err |
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 think its better to define SerializationError keeping it in sync with source code.
| return block | ||
|
|
||
| @classmethod | ||
| def parse_xml(cls, node, runtime, keys): |
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.
@ttqureshi Can you please review this parse_xml method?
comparing
https://github.com/openedx/openedx-platform/blob/master/xmodule/xml_block.py#L309
Summary
This PR fixes the Python and JavaScript (Karma) tests for the newly extracted Problem (CAPA) XBlock.
Context
What Changed
tests/to align with the new directory structure.npm build.Notes