Issue 6380#8003
Conversation
…f submission_rule
Coverage Report for CI Build 27552751414Coverage increased (+0.06%) to 90.271%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats💛 - Coveralls |
| return | ||
| end | ||
|
|
||
| @past_due_date = @assignment.grouping_past_due_date?(@grouping) |
There was a problem hiding this comment.
Hi @danielrafailov1, so overall I think this is a bit more complex than it needs to be. First, we should be showing this message for grace periods as well, as that involves the loss of grace tokens if students submit during this time period. So the implementation of penalty_for is not necessary, you can just use past_due_date && !past_collection_date. Make those two local variables, as they do not need to be passed directly to the view.
Move this code to under flash_file_manager_messages below.
| } | ||
| } | ||
|
|
||
| showConfirmWhenLate = () => { |
There was a problem hiding this comment.
Rename this function to just confirmWhenLate
|
|
||
| showConfirmWhenLate = () => { | ||
| if (this.props.show_late_submit_confirmation) { | ||
| return confirm(I18n.t("submissions.student.upload_file_confirmation_dialog")); |
There was a problem hiding this comment.
As for the message to display to the student, this should be different for the different submission rule types, so you'll need to pass in the submission rule type as a prop. Use the following language:
- For penalties: "The due date for this assignment has passed. If you submit files now, you will incur a late penalty, or your submission may not be graded, depending on when you submit. This action cannot be undone. Are you sure you would like to proceed?"
- For grace credits: "The due date for this assignment has passed. If you submit files now, you will use grace credits, or your submission may not be graded, depending on when you submit and how many grace credits you have remaining. This action cannot be undone. Are you sure you would like to proceed?"
Also, organize these under the submission_rules/en.yml file, under each of the submission rule types. This makes the messages more consistent with the existing messages.
Proposed Changes
(Describe your changes here. Also describe the motivation for your changes: what problem do they solve, or how do they improve the application or codebase? If this pull request fixes an open issue, use a keyword to link this pull request to the issue.)
The issue: A student requested a confirmation dialog to appear on late submission of an assignment that has late submission penalties. The confirmation dialog serves as an extra warning for the user, informing them that if they submit their assignment late, then they will incur a late penalty (reduction of grade).
The fix: As requested, I added a confirmation dialog that shows when a student tries to submit work for an assignment that has late penalties after the deadline has passed. This dialog will warn the user when the assignment deadline has passed and there is a late penalty associated with the assignment.
The implementation: I modified submissions_controller#file_manager to determine if we should show a confirmation dialog on submission of the assignment. To do this, we check if the assignment due date is past, if there is a late penalty associated with the assignment, and if the collection date for the assignment hasn't passed. If all three of these things agree, then we show the late submission confirmation dialog. This is done by first passing a new prop into the SubmissionFileManager constructor and then using it to determine whether or not to show the confirmation dialog.
Tests:
Rspec: Added tests to test the behaviour of the submission_rule penalty_for method for each child of submission_rule (NoLateSubmissionRule, PenaltyPeriodSubmissionRule, PenaltyDecayPeriodSubmissionRule, GracePeriodSubmissionRule). I tested what this method returns when the assignment deadline has and has not passed for each spec file associated with each child.
JavaScript: Added JEST tests to simulate clicking the submit button to bring up the submission file/url modal, filling it with the correct information, and pressing the save button to either trigger or not trigger the confirmation dialog depending on the scenario. Also ensured that a POST request to submit the file/url is only made in the cases where the confirmation dialog does not show, or the user presses the confirm button on the confirmation dialog to confirm the submission.
Documentation: Updated the relevant wiki page to mention the confirmation dialog when submitting a file/url after the assignment deadline has passed and there is a late penalty associated with the assignment
closes #6380
Screenshots of your changes (if applicable)
Associated documentation repository pull request (if applicable)
https://github.com/MarkUsProject/Wiki/pull/266Type of Change
(Write an
Xor a brief description next to the type or types that best describe your changes.)Checklist
(Complete each of the following items for your pull request. Indicate that you have completed an item by changing the
[ ]into a[x]in the raw text, or by clicking on the checkbox in the rendered description on GitHub.)Before opening your pull request:
After opening your pull request:
Questions and Comments
(Include any questions or comments you have regarding your changes.)