Skip to content

[BD-05] [TNL-7308] Add ORA Zipped File Download for Submission Text + Attached Files - #24541

Merged
davestgermain merged 1 commit into
openedx:masterfrom
open-craft:0x29a/bb2651/ora_zipped_data
Aug 24, 2020
Merged

[BD-05] [TNL-7308] Add ORA Zipped File Download for Submission Text + Attached Files#24541
davestgermain merged 1 commit into
openedx:masterfrom
open-craft:0x29a/bb2651/ora_zipped_data

Conversation

@0x29a

@0x29a 0x29a commented Jul 20, 2020

Copy link
Copy Markdown
Contributor

This PR adds new button to the course instructor dashboard:
Screenshot_2020-07-22_16-54-29

Click on this button spawns a task, which downloads all submission files (texts and attachments), puts them into zip archive and uploads it to reports storage.

Structure of generated zip file:

.
└── CourseId
    ├── BlockId1
    │   ├── StudentId1
    │   │   ├── attachments
    │   │   │   ├── SomeFile1
    │   │   │   └── SomeFile2
    │   │   ├── part_0.txt
    │   │   └── part_1.txt
    │   └── StudentId2
    │       ├── part_0.txt
    │       └── part_1.txt
    ├── BlockId2
    │   └── StudentId3
    │       ├── attachments
    │       │   └── SomeFile4
    │       └── part_0.txt
    └── downloads.csv

Where downloads.csv is a list of all downloaded files with their metadata: description, size, etc.

JIRA tickets:

Dependencies:
This PR depends on openedx/edx-ora2#1453

Sandbox URL: https://pr24541.sandbox.opencraft.hosting

Merge deadline: None

Testing instructions:

(skip if you're testing with sandbox) To test this, you need to install ORA with related change:

  1. Go to $devstack_root/src.
  2. Clone OpenCraft's ORA repo here:
    git clone https://github.com/open-craft/edx-ora2
    
  3. Switch cloned ORA to branch with new aggregate method:
    cd edx-ora2 & git checkout 0x29a/bb2651/ora_zipped_data
    
  4. Go back to $devstack_root/src.
  5. Install the ORA in the platform containers:
    # From the devstack folder $devstack_root/devstack:
    make lms-shell
    > pip install -e /edx/src/edx-ora2
    # Then exit the shell and run
    make studio-shell
    > pip install -e /edx/src/edx-ora2
    

(skip if you're testing with sandbox) After you installed ORA with related changes, you need to switch edx-platform to new branch:

  1. Go to $devstack_root/edx-platform

  2. Add new remote:

    git remote add opencraft https://github.com/open-craft/edx-platform.git
    
  3. Fetch branch with changes:

    git fetch opencraft 0x29a/bb2651/ora_zipped_data
    
  4. Switch repo to this branch:

    git checkout 0x29a/bb2651/ora_zipped_data
    

    Platform should restart automatically, but if not, do that manually. And now you should see new button in instructors dashboard.

Now you need to prepare some data to be exported:

  1. Add ORA block to existing course via studio. Before publishing it, adjust its settings to require only 1 peer assessment and require attachments:
    Screenshot_2020-07-20_13-30-06
    Screenshot_2020-07-20_13-30-25

  2. Add a few answers with attachments.

  3. Click on download button:
    Screenshot_2020-07-22_16-54-29

  4. Soon you should see new report at the bottom of dashboard:
    Screenshot_2020-07-22_16-54-44

  5. This report should contain all submission attachments with .csv file describing each download.
    Example of CSV: downloads.csv.zip

Reviewers

@openedx-webhooks

Copy link
Copy Markdown

Thanks for the pull request, @0x29a! I've created BLENDED-474 to keep track of it in Jira. More details are on the BD-05 project page.

When this pull request is ready, tag your edX technical lead.

@openedx-webhooks openedx-webhooks added blended PR is managed through 2U's blended developmnt program needs triage labels Jul 20, 2020
@0x29a
0x29a force-pushed the 0x29a/bb2651/ora_zipped_data branch from a5afa46 to 9e87a4b Compare July 20, 2020 22:29
@0x29a 0x29a changed the title [WIP] [BD-05] [TNL-7308] Add ORA Zipped File Download for Submission Text + Attached Files [BD-05] [TNL-7308] Add ORA Zipped File Download for Submission Text + Attached Files Jul 22, 2020

@xitij2000 xitij2000 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 think the code can be cleaned up a bit but looks good so far! I need to test it.

I think more of this code should be moved to the ORA repo, perhaps most if not all of the report generation. I feel like it's more tied to how ORA works than how edx-platform works.

Comment thread lms/djangoapps/instructor/views/api.py Outdated
Comment thread lms/djangoapps/instructor/views/api_urls.py Outdated
Comment thread lms/djangoapps/instructor_task/tasks_helper/misc.py Outdated
Comment thread lms/djangoapps/instructor_task/tasks_helper/misc.py Outdated

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.

Thanks for adding these detailed docs!

Comment thread lms/djangoapps/instructor_task/tasks_helper/misc.py Outdated
Comment thread lms/djangoapps/instructor_task/tasks_helper/misc.py Outdated
Comment thread lms/djangoapps/instructor_task/tasks_helper/misc.py Outdated
@0x29a
0x29a force-pushed the 0x29a/bb2651/ora_zipped_data branch from f5ba086 to 17c16f8 Compare August 7, 2020 13:52

@xitij2000 xitij2000 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: followed the testing instruction
  • I read through the code
  • [na] I checked for accessibility issues
  • [na] Includes documentation

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.

nit: We can just assume Python3 now, since there is need for backwards-compatibility.

Comment thread lms/djangoapps/instructor/views/api_urls.py Outdated
@0x29a

0x29a commented Aug 20, 2020

Copy link
Copy Markdown
Contributor Author

@davestgermain I changed extract to export and fixed all failing CI checks.

@0x29a
0x29a requested a review from davestgermain August 20, 2020 08:49

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

Thanks. Could you squash the commits?
I'll merge this on Monday, the 24th

@0x29a
0x29a force-pushed the 0x29a/bb2651/ora_zipped_data branch from 11bdd26 to 921875b Compare August 21, 2020 23:39
@0x29a

0x29a commented Aug 21, 2020

Copy link
Copy Markdown
Contributor Author

Could you squash the commits?

Thanks @davestgermain, done.

@edx-status-bot

Copy link
Copy Markdown

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

@davestgermain
davestgermain merged commit 34d1e46 into openedx:master Aug 24, 2020
@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.

@0x29a
0x29a deleted the 0x29a/bb2651/ora_zipped_data branch August 24, 2020 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blended PR is managed through 2U's blended developmnt program merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants