[BB-873] Support for filters, and multiple roots in problem response reports - #19781
Conversation
|
Thanks for the pull request, @xitij2000! I've created OSPR-3070 to keep track of it in JIRA. JIRA is a place for product owners to prioritize feature reviews by the engineering development teams. Feel free to add as much of the following information to the ticket:
All technical communication about the code itself will still be done via the GitHub pull request interface. As a reminder, our process documentation is here. |
|
@xitij2000 Thank you for your contribution. Can you let me know once all checks are green? |
409bd2f to
262463c
Compare
|
@natabene Certainly. This will need a somewhat complex rebase after https://github.com/edx/edx-platform/pull/19635 lands, so I will wait on that. |
c74049e to
02d24a5
Compare
There was a problem hiding this comment.
👍
- I tested this:
- I used the EdX Demo Course as base for testing this.
- Logged in as staff and answered some problems and assessments on the demo course.
- Generate problem response reports for 2 problems sending comma-separated values. I used these two:
block-v1:edX+DemoX+Demo_Course+type@problem+block@c554538a57664fac80783b99d9d6da7cblock-v1:edX+DemoX+Demo_Course+type@problem+block@d2e35c1d294b4ba0b3b1048615605d2a
- Checked that the report was correctly generated and responses for both problems were included ✔️
- Checked that we can generate a problem response report for the entire course with
block-v1:edX+DemoX+Demo_Course+type@course+block@course✔️ - Used section
block-v1:edX+DemoX+Demo_Course+type@course+block@courseand tested theproblem_types_filterwith three values:
openassessmentproblemopenassessment,problem
- Checked that the generated reports contained only the problems that were specified on each operation ✔️
- I read through the code
- Includes documentation: on the docstrings
-
I checked for accessibility issuesNA
Nice work! 😁
This is blocked on https://github.com/edx/edx-platform/pull/19635, I can test this again when that is merged.
Note: To make testing this easier, I logged in LMS on Chrome, generated a problem response report and copied a cURL request like the one below.
curl 'http://edx.devstack.lms:18000/courses/course-v1:edX+DemoX+Demo_Course/instructor/api/get_problem_responses' -H 'Pragma: no-cache' -H 'Origin: http://edx.devstack.lms:18000' -H 'Accept-Encoding: gzip, deflate' -H 'Accept-Language: en-US,en;q=0.9' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.96 Safari/537.36' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' -H 'Accept: application/json, text/javascript, */*; q=0.01' -H 'Cache-Control: no-cache' -H 'X-Requested-With: XMLHttpRequest' -H 'Cookie: openedx-language-preference=en; Ooyala=RpOGxhMTE6p6DkTB8MBGtKN6v0_A_BdQ|28:1544803457&o|28:1544803457&5zdHcxOlM7fQJOMrCdwnnu16WP-d|28:1544803457&RpOGxhMTE6p6DkTB8MBGtKN6v0_A_BdQ|2:1544803457&o|2:1544803457&5zdHcxOlM7fQJOMrCdwnnu16WP-d|2:1544803457&RpOGxhMTE6p6DkTB8MBGtKN6v0_A_BdQ|1:1544803457&o|1:1544803457&5zdHcxOlM7fQJOMrCdwnnu16WP-d|1:1544803457&o|19:1544803456&5zdHcxOlM7fQJOMrCdwnnu16WP-d|19:1544803456&o|5:1544546327&5zdHcxOlM7fQJOMrCdwnnu16WP-d|5:1544546327&RpOGxhMTE6p6DkTB8MBGtKN6v0_A_BdQ|5:1544546327; experiments_is_enterprise=false; djdt=show; ecommerce_sessionid=jpwfbe6n4keygeozechyp1d1x0homgph; edxloggedin=true; edx-jwt-cookie-header-payload=eyJhbGciOiJSUzUxMiIsImtpZCI6ImRldnN0YWNrX2tleSJ9.eyJzY29wZXMiOiBbInVzZXJfaWQiLCAiZW1haWwiLCAicHJvZmlsZSJdLCAiYWRtaW5pc3RyYXRvciI6IHRydWUsICJwcmVmZXJyZWRfdXNlcm5hbWUiOiAic3RhZmYiLCAiZmlsdGVycyI6IFsidXNlcjptZSJdLCAiaWF0IjogMTU1MDY2NTgwMywgInN1YiI6ICI5MDIzNGM1NmE5NGNiODJkNWRjZDgxYTIzYmRhNjAwNyIsICJmYW1pbHlfbmFtZSI6ICIiLCAidXNlcl9pZCI6IDksICJhdWQiOiAibG1zLWtleSIsICJpc3MiOiAiaHR0cDovL2xvY2FsaG9zdDoxODAwMC9vYXV0aDIiLCAiZW1haWxfdmVyaWZpZWQiOiB0cnVlLCAibmFtZSI6ICIiLCAidmVyc2lvbiI6ICIxLjEuMCIsICJnaXZlbl9uYW1lIjogIiIsICJleHAiOiAxNTUwNjY5NDAzLCAiaXNfcmVzdHJpY3RlZCI6IGZhbHNlLCAiZW1haWwiOiAic3RhZmZAZXhhbXBsZS5jb20ifQ; edx-jwt-cookie-signature=I-Ib0NtTRY_mr0sKuBeTgGRU6wdjxHAhFpEjH4DGvh5nCCSzS0I_5b3nMeb0PzMo0KGkVGaDInpIsK--fV50mKAV_A7BZD06dmHK9m8nJw9Fd1iTweZ8f7kKdGLcUSIvQ9mH_yWwLPO_ICsULx2SbmcB_-rGbKxfV7FwBFc93FI7VO0MBRlzdpZM_B5-qhT-NgCDv-JruLinbtVU388_FWzUWm9l8Sbefh0_pO4akftXjjS3o9b7Ic_EU_atRKvdx80EqvZuFNUo8PzUeS2oJ4GBcbWT7-w6pG11FWTkR2oK2nuu2ffX5LVrCfJBqrxb8vgdhhw_0RJ9Szjwnke_1A; csrftoken=giMBf2s0gYqzk8mh8NvuZ8lfXzGsKUAWDM6VBsaxYU1Gc1yJfoGaUHO0r7olSZSd; edx-user-info="{\"username\": \"staff\"\054 \"version\": 1\054 \"enrollmentStatusHash\": \"09d498ab1dd69884525f4cdfa9cca6a6\"\054 \"header_urls\": {\"learner_profile\": \"http://edx.devstack.lms:18000/u/staff\"\054 \"resume_block\": \"http://edx.devstack.lms:18000/dashboard\"\054 \"logout\": \"http://edx.devstack.lms:18000/logout\"\054 \"account_settings\": \"http://edx.devstack.lms:18000/account/settings\"}}"; edx-jwt-refresh-cookie=TkaF7obCsGUrssLel2eRKC3Da7cSS6; sessionid="1|p0twgpm0ftuhfbineuhvwrv09c7xtonc|k8jFi8FgoWHO|IjVjZTc3M2NhMDZmMjNhYWQ5ZDA3YWY2Njc3ZDNhZmMwMzU5NzliN2QzZjI3MTE2MTVlZjU5N2U2NWVkNmM2Mzci:1gwR0p:KnavxYauF92EKRulzSvjOzMIdaM"' -H 'Connection: keep-alive' -H 'X-CSRFToken: giMBf2s0gYqzk8mh8NvuZ8lfXzGsKUAWDM6VBsaxYU1Gc1yJfoGaUHO0r7olSZSd' -H 'Referer: http://edx.devstack.lms:18000/courses/course-v1:edX+DemoX+Demo_Course/instructor' --data 'problem_location=block-v1%3AedX%2BDemoX%2BDemo_Course%2Btype%40problem%2Bblock%40c554538a57664fac80783b99d9d6da7c%2Cblock-v1%3AedX%2BDemoX%2BDemo_Course%2Btype%40problem%2Bblock%40d2e35c1d294b4ba0b3b1048615605d2a' --compressed
02d24a5 to
106a94a
Compare
|
@natabene This is ready for review now. |
106a94a to
c4d25f9
Compare
|
@xitij2000 Sorry, missed this somehow. Could you fix the failing test? |
|
jenkins run all |
c4d25f9 to
c7cfec4
Compare
|
Sorry about that. I've made the fixes, no problems locally, will ping once the tests pass. |
c7cfec4 to
163dfe6
Compare
|
@ormsbee This is now ready for your review. |
163dfe6 to
f374b42
Compare
3a30509 to
fbc7b63
Compare
|
Ok, @ormsbee can take a look at that and will reply as soon as he can. |
a0dff34 to
ec2e257
Compare
|
jenkins run js |
ec2e257 to
4514e10
Compare
|
@ormsbee I have rebased the branch on the latest changes on master, and all tests are now passing. It seems some of the tests were stuck earlier. |
|
@ormsbee This is ready for your now. |
…ks, or filtered block types. This change adds support for specifying multiple root blocks while generating problem response reports. It also allows specifying a block type filter so that only blocks of the filtered types will be included in the report. Finally, this change also consistenly uses absolute path for the location in the report instead of relative paths.
4514e10 to
98af749
Compare
|
@ormsbee This seems to be already be approved. I've just rebased it on the latest changes in master. Could you have a look and merge it if seems OK? |
|
@xitij2000 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future. |
|
Please add changes to the Juniper page if you have not done so already. Thank you. |
|
EdX Release Notice: This PR has been deployed to the staging environment in preparation for a release to production on Friday, August 09, 2019. |
|
@ormsbee Thanks! Will do. |
|
Your PR has finished running tests. The following contexts failed:
|
|
@xitij2000 @ormsbee I am afraid we will have to revert this PR. Following error is happening for both local and stage: and here is a screenshot from the Splunk: I am creating a revert, and if you think it is not necessary, please let me know. |
|
@DawoudSheraz I'm a bit surprised this is happening. I did not expect this API to be called without a problem_location. I'll look into and make a corrected PR. |
|
@DawoudSheraz: Thank you so much for catching this. |
|
EdX Release Notice: This PR has been deployed to the production environment. |
| task_class = calculate_problem_responses_csv | ||
| task_input = {'problem_location': problem_location, 'user_id': request.user.pk} | ||
| task_input = { | ||
| 'problem_location': problem_locations, |
There was a problem hiding this comment.
The error is right here. This should be problem_locations.
I'm afraid I changed this back to problem_locaiton for backwards compatibility but didn't update it in the final place. I will update it here now since the task name has already been changed to avoid clashes.

This PR includes the following changes to the problem response report API:
Support for specifying multiple root blocks.
With this feature, you can now pass a comma-separated list of problem locations, and the generated report will include both of them (and children).
Support for specifying a problem type filter.
This feature allows you to request a report for only one or more types of blocks. In this case you can request a report for the entire course, but filter it to only blocks of specific types.
JIRA tickets: OSPR-3070
Discussions: https://github.com/edx/edx-platform/pull/19507
Dependencies: https://github.com/edx/edx-platform/pull/19507, https://github.com/edx/edx-platform/pull/19635
Sandbox URL: TBD - sandbox is being provisioned.
Merge deadline: None
Testing instructions:
Concerns:
The locations to be included in the report are stored in this field which is limited to 255 characters. This limits us to generate a report for a maximum of around 3/4 blocks (or less if the locations are longer). It would be nice if we could somehow remove this restriction by increasing the size of this field.
The task_input is limited to 255 chars, yet this line only throws an error if the task_input is longer than 265 characters, I'm not sure why that is.
Reviewers