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

Drag or paste of files to upload in Student / Staff views doesn't work or is dangerous #149

Open
alexmcarthur opened this issue May 17, 2016 · 0 comments

Comments

@alexmcarthur
Copy link

alexmcarthur commented May 17, 2016

In the Student view, pasting a file results in 'Upload undefined' showing on the upload button, and if you hit the button you see 'File uploaded blob' (if you attempt to download the app crashes). Dragging a file to upload works.

past

In the Staff view, the behaviour is similar but even worse it uploads for all entries in the table, potentially overwriting previous uploads. A dangerous scenario (which has happened more than once in our edX instance) is where you've copied a file and hit paste in the 'Enter Grade' dialog - either by mistake or thinking that the paste buffer has something that you want to paste - the file is then uploaded to all table rows as if you pasted into the Staff dialog beneath.

A suggested fix is to disable paste of files for both the Student and Staff views and only enable drop for the Student view:

            // Set up file upload
            var fileUpload = $(content).find('.fileupload').fileupload({
                url: uploadUrl,
                pasteZone: null,

```...
        // Set up annotated file upload
        $(element).find('#grade-info .fileupload').each(function() {
            var row = $(this).parents("tr");
            var url = staffUploadUrl + "?module_id=" + row.data("module_id");
            var fileUpload = $(this).fileupload({
                url: url,
                pasteZone: null,
                dropZone: null,

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

1 participant