Skip to content

[BB-873] Support for filters, and multiple roots in problem response reports - #21413

Merged
ormsbee merged 1 commit into
openedx:masterfrom
open-craft:kshtij/problem-response-multi-root-and-fitler
Aug 19, 2020
Merged

[BB-873] Support for filters, and multiple roots in problem response reports#21413
ormsbee merged 1 commit into
openedx:masterfrom
open-craft:kshtij/problem-response-multi-root-and-fitler

Conversation

@xitij2000

@xitij2000 xitij2000 commented Aug 22, 2019

Copy link
Copy Markdown
Contributor

Add support for generating problem response reports for multiple blocks, 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 consistently uses absolute path for the location in the report instead of relative paths.

This redoes #19781 which had a glaring issue introduced during refactoring.

JIRA tickets: If there is a related publicly viewable JIRA ticket, mention that here. Also mention the OSPR ticket
number here once it gets created (after you open the PR), if applicable. Otherwise omit this.

Discussions: https://github.com/edx/edx-platform/pull/19507

Dependencies: None

Sandbox URL:

Merge deadline: None

Testing instructions:

  1. Log in as an instructor
  2. Post to the get_problem_responses API (this needs to include session information till [BB-728] Add problem response report API #19635 lands) and with problem_location set to a comma-separated list of problem locations. (API url: https://pr21413.sandbox.opencraft.hosting/courses/course-v1:edX+DemoX+Demo_Course/instructor/api/get_problem_responses )
  3. This should start generating a report with all those problem locations
  4. Post to the same api again, this time use the course (or a section) as the problem_location, but also provide a problem_types_filter
  5. Check the generated report, it should include only blocks of the type specified in problem_types_filter.

Reviewers

  • (OpenCraft internal reviewer's GitHub username goes here)
  • edX reviewer[s] TBD

@xitij2000
xitij2000 requested a review from a team August 22, 2019 19:59
@openedx-webhooks

Copy link
Copy Markdown

Thanks for the pull request, @xitij2000! I've created OSPR-3799 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:

  • supporting documentation
  • edx-code email threads
  • timeline information ("this must be merged by XX date", and why that is)
  • partner information ("this is a course on edx.org")
  • any other information that can help Product understand the context for the PR

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.

@openedx-webhooks openedx-webhooks added needs triage open-source-contribution PR author is not from Axim or 2U labels Aug 22, 2019

@giovannicimolin giovannicimolin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

  • I tested this:
  1. Checked that python tests are passing locally ✔️
  2. Performed the same testing as in the previous PR (https://github.com/edx/edx-platform/pull/19781#discussion_r312544842).
  3. Logged in as staff and answered some problems on the demo course.
    Generate problem response reports for 2 problems sending comma-separated values. I used these:
block-v1:edX+DemoX+Demo_Course+type@problem+block@d2e35c1d294b4ba0b3b1048615605d2a
block-v1:edX+DemoX+Demo_Course+type@problem+block@75f9562c77bc4858b61f907bb810d974
  1. Checked that the report was correctly generated and responses for both problems were included ✔️
  2. Checked that we can generate a problem response report for the entire course with block-v1:edX+DemoX+Demo_Course+type@course+block@course ✔️
    5.Used section block-v1:edX+DemoX+Demo_Course+type@course+block@course and tested the problem_types_filter with three values:
openassessment
problem
openassessment,problem
  1. Checked that the generated reports contained only the problems that were specified on each operation heavy_check_mark
  • I read through the code
  • Includes documentation: doesn't include documentation ⚠️
  • I checked for accessibility issues NA

@xitij2000 Thanks for fixing this bug and creating this again! Nice work! 😁

I used the same testing method as before, but changed the problems I used.

@openedx-webhooks openedx-webhooks added waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. and removed needs triage labels Aug 23, 2019
@natabene

Copy link
Copy Markdown
Contributor

@xitij2000 Thank you for your contribution. Please let me know once it is ready for our review.

@xitij2000
xitij2000 force-pushed the kshtij/problem-response-multi-root-and-fitler branch from 6694cd4 to 5a8012b Compare August 26, 2019 09:23
@xitij2000

Copy link
Copy Markdown
Contributor Author

@natabene This is ready.

@natabene

Copy link
Copy Markdown
Contributor

@marcotuts Do you want to review this before it goes to engineering?

@openedx-webhooks openedx-webhooks added product review PR requires product review before merging and removed waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. labels Aug 26, 2019
@marcotuts

Copy link
Copy Markdown
Contributor

This can move to @ormsbee next as it is a follow-on to a previous contribution. Thanks!

@openedx-webhooks openedx-webhooks added awaiting prioritization and removed product review PR requires product review before merging labels Sep 25, 2019
@xitij2000
xitij2000 force-pushed the kshtij/problem-response-multi-root-and-fitler branch from 5a8012b to 08a9ec4 Compare October 30, 2019 06:10
@giovannicimolin

Copy link
Copy Markdown
Contributor

jenkins run all

@xitij2000
xitij2000 force-pushed the kshtij/problem-response-multi-root-and-fitler branch 3 times, most recently from b8ba240 to 91ead21 Compare December 16, 2019 17:38
@xitij2000
xitij2000 force-pushed the kshtij/problem-response-multi-root-and-fitler branch 2 times, most recently from 39cc9bb to 40c3245 Compare July 17, 2020 11:40
@xitij2000

Copy link
Copy Markdown
Contributor Author

@bradenmacdonald This is ready for review.

@xitij2000
xitij2000 force-pushed the kshtij/problem-response-multi-root-and-fitler branch from 40c3245 to 69c50e2 Compare July 27, 2020 20:55
@xitij2000
xitij2000 force-pushed the kshtij/problem-response-multi-root-and-fitler branch from 69c50e2 to cfebd4e Compare August 7, 2020 20:45
@xitij2000
xitij2000 force-pushed the kshtij/problem-response-multi-root-and-fitler branch from cfebd4e to 9be0a0a Compare August 12, 2020 20:36

@bradenmacdonald bradenmacdonald left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 My only remaining concern is that the filenames generated with comma-separated xblock IDs in them can get absurdly long. A nice future improvement would be to limit the filename length to something reasonable.

  • I tested this: using the sandbox as described. Test method:
const apiUrl = 'https://pr21413.sandbox.opencraft.hosting/courses/course-v1:edX+DemoX+Demo_Course/instructor/api/get_problem_responses';
let result;
result = await $.post(apiUrl, {'problem_location': 'block-v1:edX+DemoX+Demo_Course+type@problem+block@Sample_Algebraic_Problem'})
result = await $.post(apiUrl, {'problem_location': 'block-v1:edX+DemoX+Demo_Course+type@problem+block@Sample_Algebraic_Problem,block-v1:edX+DemoX+Demo_Course+type@problem+block@a0effb954cca4759994f1ac9e9434bf4'})
result = await $.post(apiUrl, {'problem_location': 'block-v1:edX+DemoX+Demo_Course+type@chapter+block@interactive_demonstrations', 'problem_types_filter': 'problem'})
# From what I can tell, the sample course on the sandbox doesn't have anything other than 'problem' blocks that would show up in this report? So I just tested with html, which made an empty report
result = await $.post(apiUrl, {'problem_location': 'block-v1:edX+DemoX+Demo_Course+type@chapter+block@interactive_demonstrations', 'problem_types_filter': 'html'})
  • I read through the code
  • I checked for accessibility issues: n/a
  • Includes documentation - yes, in comments. Should really be in the get_problem_responses docstring too though.

@xitij2000
xitij2000 force-pushed the kshtij/problem-response-multi-root-and-fitler branch from 4a86a97 to fb6c118 Compare August 13, 2020 08:35
@xitij2000

Copy link
Copy Markdown
Contributor Author
* Should really be in the `get_problem_responses` docstring too though.

I've added docs there now.

My only remaining concern is that the filenames generated with comma-separated xblock IDs in them can get absurdly long. A nice future improvement would be to limit the filename length to something reasonable.

Would it make sense to only use the following logic for the name:

  • block key + timestamp for single block
  • course key + timestamp for multiple blocks
  • course key + filters + timestamp if filters are provided

@bradenmacdonald

Copy link
Copy Markdown
Contributor

@xitij2000 That logic sounds good. Would that keep the filenames unchanged for existing reports? I'm not sure that matters but is probably a good requirement to stick to, if for nothing else other than to not break organization on the file system for people who regularly download these reports and save them into a local folder.

@xitij2000

Copy link
Copy Markdown
Contributor Author

@bradenmacdonald Currently only a single block at a time is supported by the API and UI, and for that case, the file name will remain unchanged.

The new file naming logic will only kick in for multiple blocks, or when filters are used. Currently, there is no way to initiate such reports from the UI so until that happens, there is no easy way to generate such reports anyway.

@bradenmacdonald

Copy link
Copy Markdown
Contributor

@xitij2000 Great. I'm unclear on the status now: are you ready to merge this (if so please squash), or are you going to push a commit to add file name shortening? I'm fine either way.

@xitij2000
xitij2000 force-pushed the kshtij/problem-response-multi-root-and-fitler branch from ecb848d to 8f29501 Compare August 17, 2020 11:25
@xitij2000

Copy link
Copy Markdown
Contributor Author

@bradenmacdonald I've just added a commit to add better file-name handling and tests for it.

@xitij2000
xitij2000 force-pushed the kshtij/problem-response-multi-root-and-fitler branch from 8f29501 to ac23167 Compare August 17, 2020 14:42

@bradenmacdonald bradenmacdonald left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks! My approval still stands. The latest commit looks good. Please squash and we'll get this merged.

Comment thread lms/djangoapps/instructor_task/tasks_helper/grades.py Outdated
…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.
@xitij2000
xitij2000 force-pushed the kshtij/problem-response-multi-root-and-fitler branch from 4478ff3 to 2eff127 Compare August 18, 2020 16:58
@xitij2000

Copy link
Copy Markdown
Contributor Author

jenkins run all

@edx-status-bot

Copy link
Copy Markdown

Your PR has finished running tests. There were no failures.

@ormsbee
ormsbee merged commit a0762c0 into openedx:master Aug 19, 2020
@openedx-webhooks

Copy link
Copy Markdown

@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.

@edx-pipeline-bot

Copy link
Copy Markdown
Contributor

EdX Release Notice: This PR has been deployed to the staging environment in preparation for a release to production.

@edx-pipeline-bot

Copy link
Copy Markdown
Contributor

EdX Release Notice: This PR has been deployed to the production environment.

@xitij2000
xitij2000 deleted the kshtij/problem-response-multi-root-and-fitler branch August 31, 2020 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants