Skip to content

Issue 6380#8003

Open
danielrafailov1 wants to merge 7 commits into
MarkUsProject:masterfrom
danielrafailov1:issue-6380
Open

Issue 6380#8003
danielrafailov1 wants to merge 7 commits into
MarkUsProject:masterfrom
danielrafailov1:issue-6380

Conversation

@danielrafailov1

@danielrafailov1 danielrafailov1 commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

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) Screenshot 2026-06-14 at 11 25 22 PM (2) Screenshot 2026-06-14 at 11 28 19 PM 2
Associated documentation repository pull request (if applicable) https://github.com/MarkUsProject/Wiki/pull/266

Type of Change

(Write an X or a brief description next to the type or types that best describe your changes.)

Type Applies?
🚨 Breaking change (fix or feature that would cause existing functionality to change)
New feature (non-breaking change that adds functionality) X
🐛 Bug fix (non-breaking change that fixes an issue)
🎨 User interface change (change to user interface; provide screenshots) X
♻️ Refactoring (internal change to codebase, without changing functionality)
🚦 Test update (change that only adds or modifies tests)
📦 Dependency update (change that updates a dependency)
🔧 Internal (change that only affects developers or continuous integration)

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:

  • I have performed a self-review of my changes.
    • Check that all changed files included in this pull request are intentional changes.
    • Check that all changes are relevant to the purpose of this pull request, as described above.
  • I have added tests for my changes, if applicable.
    • This is required for all bug fixes and new features.
  • I have updated the project documentation, if applicable.
    • This is required for new features.
  • If this is my first contribution, I have added myself to the list of contributors.

After opening your pull request:

  • I have updated the project Changelog (this is required for all changes).
  • I have verified that the pre-commit.ci checks have passed.
  • I have verified that the CI tests have passed.
  • I have reviewed the test coverage changes reported by Coveralls.
  • I have requested a review from a project maintainer.

Questions and Comments

(Include any questions or comments you have regarding your changes.)

@coveralls

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 27552751414

Coverage increased (+0.06%) to 90.271%

Details

  • Coverage increased (+0.06%) from the base build.
  • Patch coverage: 66 of 66 lines across 9 files are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 50334
Covered Lines: 46421
Line Coverage: 92.23%
Relevant Branches: 2290
Covered Branches: 1083
Branch Coverage: 47.29%
Branches in Coverage %: Yes
Coverage Strength: 126.7 hits per line

💛 - Coveralls

return
end

@past_due_date = @assignment.grouping_past_due_date?(@grouping)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 = () => {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename this function to just confirmWhenLate


showConfirmWhenLate = () => {
if (this.props.show_late_submit_confirmation) {
return confirm(I18n.t("submissions.student.upload_file_confirmation_dialog"));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. 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?"
  2. 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.

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

Successfully merging this pull request may close these issues.

(Feature request) Add fail safes to submitting during a penalty period

3 participants