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

Support submitting multiple files to an assignment #462

Open
theunkn0wn1 opened this issue Feb 2, 2021 · 1 comment
Open

Support submitting multiple files to an assignment #462

theunkn0wn1 opened this issue Feb 2, 2021 · 1 comment

Comments

@theunkn0wn1
Copy link
Contributor

It is possible for instructors to create assignments that require students to upload multiple loose files for a submission, and this library doesn't provide a direct mechanism for facilitating this as a student.

As a practical example: the instructor in one of my current courses requires students to upload no less than 72 loose files per assignment.

The necessary machinery exists, through assignment.upload_to_submission

In my downstream project, I have produced the desired functionality in a downstream by calling Assignment.upload_to_submission in a loop over the input files, and passing the resulting list of file IDs to Assignment.submit in a dict.

Since this route requires working around the Assignment.submit's single file limitation, finding this pathway wasn't immediately obvious.

Desired interface

modify Assignment.submit to accept a list of files, and have a single function call for users.

assignment.submit(file=["/list", "./of", "~/files" ])

Alternatively, and this is the approach I took in the downstream,
is to add a new method for bulk uploads

def submit_assignment(assignment: Assignment, files: List[Path]) -> Submission:
    # step four: upload all relevant files to the submission that doesn't exist yet and enumerate the
    # IDs you get back
    file_ids = mass_upload(assignment, files)

    # step 5: call `assignment.submit` and pass the file IDs acquired via step 4
    return assignment.submit(
        {"file_ids": file_ids, "submission_type": "online_upload"}
    )

@kailukaitisBrendan
Copy link
Contributor

I'd like to take a look at this issue. Looking at the code, it seems like adding a new method for mass uploading might be the way to go instead of modifying the signature of the existing function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants