In this update, the file upload functionality of the application was modified to handle two different types of exam sheets: the standard Scantron 95945 sheets and custom exam sheets. Specifically, changes were made to:
The file upload logic in the backend server (AppServer.py) to distinguish between these two sheet types based on user input.
The frontend component to prompt the user to select the sheet type before uploading.
The test suite (test_app.py) was updated to include new test cases that ensure both Scantron and custom sheet uploads are handled correctly.
Additionally, I added logic to return a "Not yet supported" message for custom sheets while successfully processing Scantron sheets, and also wrote unit tests for these changes.
Why was it changed?
This change addresses the need to support multiple sheet types in the application, specifically the standard Scantron and custom exam sheets. The approach I took was letting the user specify the type of sheet they are uploading.
By prompting the user to select the sheet type, the backend can more easily determine if the file should be processed or if a "Custom sheets are not yet supported" message should be returned.
How was it changed?
Backend (AppServer.py):
The file_upload function was modified to accept a sheetType form field, which allows the user to specify whether they are uploading a Scantron or custom sheet.
Based on the value of sheetType, the backend either processes the sheet (if it's a Scantron) or returns a message stating that custom sheets are not yet supported.
Frontend (FileUploadComponent.tsx):
A dropdown menu was added to the file upload form, allowing users to select whether they are uploading a Scantron or a custom sheet.
The selection is sent along with the file upload request to the backend.
Testing (test_app.py):
New test cases were added to verify the behavior for both Scantron and custom sheets.
The test for custom sheets checks that the response contains the "Custom sheets are not yet supported" message, ensuring the backend behaves correctly.
Fixes #97
What was changed?
In this update, the file upload functionality of the application was modified to handle two different types of exam sheets: the standard Scantron 95945 sheets and custom exam sheets. Specifically, changes were made to:
Additionally, I added logic to return a "Not yet supported" message for custom sheets while successfully processing Scantron sheets, and also wrote unit tests for these changes.
Why was it changed?
This change addresses the need to support multiple sheet types in the application, specifically the standard Scantron and custom exam sheets. The approach I took was letting the user specify the type of sheet they are uploading.
By prompting the user to select the sheet type, the backend can more easily determine if the file should be processed or if a "Custom sheets are not yet supported" message should be returned.
How was it changed?
Backend (AppServer.py):
Frontend (FileUploadComponent.tsx):
Testing (test_app.py):