mitodl / rapid-response-xblock

a django app plug-in for edx-platform
BSD 3-Clause "New" or "Revised" License
0 stars 2 forks source link

Refactor the usage of CapaModule/CapaDescriptor #85

Closed arslanashraf7 closed 3 years ago

arslanashraf7 commented 3 years ago

Tests are breaking on this repo with errors for both Travis & Github actions: Travis, Github.

____________________ ERROR collecting tests/test_events.py _____________________
ImportError while importing test module '/rapid-response-xblock/tests/test_events.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
tests/test_events.py:11: in <module>
    from xmodule.capa_module import CapaDescriptor
E   ImportError: cannot import name 'CapaDescriptor'

A further look revealed that CapaDescriptor has been refactored in edx-platform with ProblemBlock. The relevant PR could be seen as https://github.com/edx/edx-platform/pull/20023. We might need to make relevant refactoring in our rapid-response-xblock since we are using CapaDescriptor in the process, getting the tests to pass as well.

Looking at https://github.com/edx/edx-platform/pull/20023, it's clear that this refactoring was made in the transition from Ironwood to Juniper release of open edX.

Required effort to do this transition is not estimated, I tried replacing the CapaDescriptor with ProblemBlock makes other tests to fail as well.

pdpinch commented 3 years ago

@gsidebo do you think this is related to the Rapid Response issue you've been looking into?

gsidebo commented 3 years ago

@pdpinch Very possible. I'm looking into that now

gsidebo commented 3 years ago

I'm still unable to get LMS running locally with Koa. The end of my most recent stacktrace when trying to log in:

File "/edx/app/edxapp/edx-platform/openedx/core/djangoapps/user_api/accounts/utils.py", line 121, in retrieve_last_sitewide_block_completed
    if not completion_waffle.waffle().is_enabled(completion_waffle.ENABLE_COMPLETION_TRACKING):
AttributeError: module 'completion.waffle' has no attribute 'waffle'

I was able to get a devstack "assistant" tool working with Koa (https://github.com/mitodl/odl_devstack_tools). Using this tool will let you mount your local rapid-response-xblock repo into LMS/Studio, and any changes you make to the rapid response repo will trigger a server restart and will be immediately available in LMS/Studio. You can set breakpoints as well. If you get Koa running successfully, that will make it a lot easier to debug this issue. If you're interested, here's a Gist with a relevant yml file, json file, and brief usage details. Sorry I couldn't be more help on this one.