Unless you set up a late submission penalty, a student's submissions before or after the due date are treated equally.
If that penalty worked as a reasonable person (I) would expect, what you'd want is to set a late penalty of 100%, so that any submissions after the due date would be ignored.
However, Instructure has decided that a late penalty should be applied to all submissions (in Classic Quiz with multiple attempts), not just the late ones (see the second to last bullet point in the link I shared).
So if you set up a 100% late penalty, a student gets 80/100 on Jan 7, and then tries again on Jan 10 and gets 100/100 (or 20/100, doesn't matter), the late penalty will apply, meaning the student will have 0/100 in the end.
If you check the last bullet point, Instructure very wisely avoided this issue in New Quizzes by disallowing multiple attempts when there's a late penalty.
So to keep allowing multiple attempts and not giving 0 to students who tried both before and after the solutions are posted, here are a couple of suggestions, assuming you are using Classic Quizzes:
- Set up an available until date that is equal to the due date, which will stop students from being able to submit an assignment after the due date
The main issue here is that students will not be able to submit practice attempts after the due date, which may be fine for students who already submitted it earlier, but it means that students will not be able to see the quiz if they didn't do it before. I solve that problem by having a 100% late penalty and changing the available until dates (but not due date) for the students that don't have a submission (I use the API to do that more or less automatically)
- Manually check the student's submissions to assign them a 0 if they are after the due date (or use the API and a script to make those changes)
Note also that the available until date should automatically submit any open quizzes at that date, but if a student closed their browser, it may only apply after they open Canvas again (marking it as late, even if they didn't really do anything on the quiz).