Skip to content
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

Add submissions zip download feature #1407

Merged
merged 2 commits into from
Oct 10, 2024
Merged

Conversation

ihalaij1
Copy link
Contributor

@ihalaij1 ihalaij1 commented Oct 2, 2024

Description

What?

Add submissions zip download feature.

The submissions can be downloaded per exercise from the UI or API URL /api/v2/exercises/<exercise_id>/submissions/zip?best=yes

image

The zip archive contains a metadata file info.csv and submissions with a specific naming scheme:

  • If the submission was made by a group, the file name starts with all of the group's student IDs joined by + signs.
    Otherwise, there is only one student ID.
  • The student IDs are followed by an underscore and the file number, since some exercises accept multiple files.
  • The file number is followed by an underscore and the number of the submission, since users can have multiple submissions to the same exercise.

Example file names in an exercise requiring two submitted files:

123123_file1_submission1
123123_file2_submission1
123123_file1_submission2
123123_file2_submission2
123456+987654_file1_submission1
123456+987654_file2_submission1

Why?

This was requested by multiple users.

Fixes #1374
Fixes #733

Testing

What type of test did you run?

  • Accessibility test using the WAVE extension.
  • Django unit tests.
  • Selenium tests.
  • Other test. (Add a description below)
  • Manual testing.

Tested that the feature works with groups and multiple file submission exercises.

Did you test the changes in

  • Chrome
  • Firefox
  • This pull request cannot be tested in the browser.

Think of what is affected by these changes and could become broken

Translation

Programming style

  • Did you follow our style guides?
  • Did you use Python type hinting in all functions that you added or edited? (type hints for function parameters and return values)

Have you updated the README or other relevant documentation?

  • documents inside the doc directory.
  • README.md.
  • Aplus Manual.
  • Other documentation (mention below which documentation).

Is it Done?

  • Reviewer has finished the code review
  • After the review, the developer has made changes accordingly
  • Customer/Teacher has accepted the implementation of the feature

No longer open points JSON in a browser tab,
instead download a file.

Fixes apluslms#733
Copy link
Contributor

@murhum1 murhum1 left a comment

Choose a reason for hiding this comment

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

Tried this out with varying numbers and file sizes of submissions, and they worked fine - I'll merge this.

@murhum1 murhum1 merged commit f558f93 into apluslms:master Oct 10, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
4 participants