-
Notifications
You must be signed in to change notification settings - Fork 1
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
Fix capa report generation issue #264
Conversation
In the current state if it is unable to find the answer text for a given response (maybe because it was skipped?) then the report will fail to generate. Adding in a conditional with placeholder text allows the report to generate rather than completely failing to provide this data to the course instructor.
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.
@HamzaIbnFarooq completed first round of review. I'd recommend you add units tests too so we can have a single upstream PR.
common/lib/capa/capa/capa_problem.py
Outdated
@@ -657,7 +657,8 @@ def find_answer_text(self, answer_id, current_answer): | |||
if isinstance(current_answer, list): | |||
# Multiple answers. This case happens e.g. in multiple choice problems | |||
answer_text = ", ".join( | |||
self.find_answer_text(answer_id, answer) for answer in current_answer | |||
self.find_answer_text(answer_id, answer) or 'No Answer Recorded' |
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 should add logic in find_answer_text
to check if there is no text for answered choice it should return Answer Text Missing
.
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.
Updated.
common/lib/capa/capa/capa_problem.py
Outdated
input_cls = inputtypes.registry.get_class_for_tag(choicegroup.tag) | ||
choices_map = dict(input_cls.extract_choices(choicegroup, self.capa_system.i18n, text_only=True)) | ||
answer_text = choices_map[current_answer] | ||
if len(elems) == 1: |
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 need to check all cases
- we have not choice found
- we have 1 choice
- we have more than 1 choices found
if len(elems) == 0:
log.warning("Answer Text Missing for answer id: %s and choice number: %s", answer_id, current_answer)
answer_text = 'Answer Text Missing'
elif len(elems) == 0:
{current implementation}
else
log.warning("Multiple answers found for answer id: %s and choice number: %s", answer_id, current_answer)
answer_text = 'Multiple answers found'
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.
Updated.
@pdpinch Do you think we should create an upstream PR of fixing old data for capa reports generation and add markdown validation in capa problems combined |
My first priority is to get the Residential MITx teams access to their data, but yes we should plan on upstreaming both of these fixes to edx master.
… @pdpinch <https://github.com/pdpinch> Do you think we should create an upstream PR of fixing old data for capa reports generation <#264> and add markdown validation in capa problems <#265> combined
OR
stick with the original plan as mentioned here <#239 (comment)> saying that only add markdown validation in capa problems <#265> should be upstream.
|
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.
👍
@pdpinch you can have a look at the current PR, if it seems good to you then we can merge it right away. I can cherry-pick the commits to create an upstream PR and add some tests afterwards. |
@mitodl/devops can we try deploying this change to lms.mitx.mit.edu to see if it helps address ZenDesk 96001 |
Once it's merged we can run a build to get this through to production. Code looks good to me 👍 |
@blarghmatey the current branch's fix was removed from |
In the current state if CAPA problem response report generation is unable to find the answer text for a given response then the report will fail to generate. Adding a placeholder text allows the report to generate rather than completely failing to provide this data to the course instructor. (cherry picked from commit e94801661a3b964276f7dcac331c39057a095797)
In the current state if CAPA problem response report generation is unable to find the answer text for a given response then the report will fail to generate. Adding a placeholder text allows the report to generate rather than completely failing to provide this data to the course instructor. (cherry picked from commit e94801661a3b964276f7dcac331c39057a095797)
This PR adds MFE API. This is part of the work that is being done to obtain the MFE Runtime Configurations and that has been discussed in the BTR WG. Discussion: https://discuss.openedx.org/t/how-to-use-microfrontend-in-a-multitenant-instance/6936/14?u=mafermazu MFE Runtime configuration - eduNEXT: https://docs.google.com/document/d/1-FHIQmyeQZu3311x8eYUNMru4JX7Yb3UlqjmJxvM8do/edit?usp=sharing feat: add lms setting to set mfe config cache (#262) Co-authored-by: María Fernanda Magallanes Z <maria.magallanes@edunext.co> feat: make mfe config api disabled by default (#263) * feat: make mfe config api disabled by default * fix: simple is better than complex test: add mfe config tests (#264) * test: add mfe config tests * test: fix it and simplify it * test: correct pylint issues fix: correct pep 8 violations fix: add mfe api unit test in github workflow fix: correct unit tests refactor: move mfe api to lms fix: try mfe api urls without regex fix: add app_namespace in lms urls fix: try url without conditional Revert "fix: try url without conditional" This reverts commit 694aab546134b4bd9ad2642e24927b42cac24459. fix: set enable_mfe_config_api feature to true in the tests test: try to add failed test case Revert "test: try to add failed test case" This reverts commit cee6bf656ab1b96492b0b6199ddff32a6d6a65bd. docs: improve explanation and documentation fix: ensure the response is a json object refactor: be consistent with the variable names fix: allow overriding mfe api config cache timeout in production fix: handle 404 response in view refactor: use a guard instead if-else feat: add the possibility to show mfe specific config
Description
Fixes Capa questions report generation issues by providing a default value for the problems having no text values for answer options.
Related Issues
#262
#239
How to test?
Test 1:
Generate the issue without this branch's fix:
Data Download
underInstructor
tabReports
section, select the Problem and pressCreate a report of problem responses
The error will be generated.
Now use this branch and try downloading the report again, it should be fixed now.
Test 2:
Generate the issue without this branch's fix:
Error: There was an error generating your report.
error.Now use this branch and try downloading the report again, it should be fixed now.