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

Include input file sanity checks for common file formats #51

Open
ProfMatthewHz opened this issue Dec 20, 2018 · 0 comments
Open

Include input file sanity checks for common file formats #51

ProfMatthewHz opened this issue Dec 20, 2018 · 0 comments
Assignees

Comments

@ProfMatthewHz
Copy link

Assignments usually require students submit files of a specific type and, just as often, students screw this up. This results in confusion over the output or graders having to figure out how to open a file of unknown type. This is attempting to solve this issue by operationalizing #13 in practical terms.

Simple heuristics should be able to detect most of the upload errors for the likely file types

  • PDF: Files start with the ASCII characters %PDF
  • ZIP: Files start with their local file header signature 0x04034b50 (encoded in little-endian)
  • DOCX: Since these are structured ZIP files, checking for the ZIP header should catch most issues
  • Source Code: Files will only contain printable characters & whitespace

On the Assessment Handin tab, under the file name, include a checkbox labeled Check file type on upload. Enable a drop-down box with the 4 options above when the checkbox is checked. If the box is checked, run the heuristic on each submitted file. If the file fails the check, refuse the submission and go back to the submission page (with a prominent error message) so that they can try again.

@Searay-330 Searay-330 self-assigned this Feb 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants