SE-1321 add multiple files upload allowed option

Description

This PR adds an option to toggle between allowing multiple files uploaded and only allowing a single file. This is fully backwards compatible. Currently behaviour is to allow students to select an arbitrary number of files for the file upload response. Adding this option allows course authors to limit this to a single file upload.

For now, this is to be treated as a prototype. Hence no tests or updated translations yet.

*JIRA tickets*: (https://openedx.atlassian.net/browse/OSPR-3768)

*Dependencies*: None

*Screenshots*:

![1564542275](https://user-images.githubusercontent.com/9714796/62180562-9c91b200-b38f-11e9-8261-76b731123306.png)

*Sandbox URL*:

*Merge deadline*: None

*Testing instructions*:

1. create a new ora assessment on a course in studio
2. in the settings, make sure the file response is required or optional
3. below that in the settings, change "allow multiple files" to false (it must be true by default)
4. save and publish the ora
5. open the ora in the lms
6. click the button to upload files and confirm that only one file can be selected (ctl+click on multiple files will select multiple files if enabled)
7. select a single file and upload it. verify that it uploads successfully
8. repeat uploading a file to verify that uploading a new file, replacing the old file, still works
9. using the browser dev tools, inspect the upload file input and add the `multiple` attribute.
10. attempt to upload multiple files by selecting multiple files, adding a description for each one, and clicking upload files
11. verify that this is rejected server-side with an error message
12. refresh the page and verify that only the single, previously successfully uploaded file is visible
13. create a new ora assessment with a file response, but leaving "allow multiple files" as True
14. attempt to upload multiple files on this new assessment and verify that this still works successfully

*Author notes and concerns*:

  • Need to decide which is better from a UX point of view: rejecting with an error message, or simply removing any existing files in `upload_url` before returning the url. Either way, this case shouldn't happen unless someone is messing with the html elements and specifically tries to submit multiple files. Left as a rejection with error message.

  • Need to add a note to the UI next to the file upload input for students to know whether multiple files are allowed or not. possibly ok

*Reviewers*

  • [x] @pomegranited

  • [ ] edX reviewer[s] TBD

Won't Do

Assignee

Jansen Kantor

Reporter

Open Source Pull Request Bot

Contributor Name

Samuel Walladge

Repo

edx/edx-ora2

Customer

Epic Link

None

OSCM Assignee

None

Platform Map Area (Levels 1 & 2)

None

Platform Map Area (Levels 3 & 4)

None

Blended Hour Utilization Percentage

None

edX Theme

None

edX Squad

None

Github Lines Added

294

Github Lines Deleted

9

Priority

Unset