My teaching experience is limited, but for teaching compsci I've had good results with programmatically graded assignments, where the students get unlimited submissions but also machine-enforced deadlines. (I liked this when I was a student, and I've liked structuring my own class this way too.) One of the big benefits is that you can be maximally clear about what the problem set is asking the students to do, because you give them an example input and an example correct output, and for each submission you tell them what their output should have been. But each grading run uses a randomized input, so they can't just hardcode the answers.
Compsci is perfect for this, because students can fix their bug quickly and resubmit their whole assignment. For math, I guess you'd want to avoid having them repeat problems they already got correct. But for other subjects that don't really have a place for "random input", I guess this doesn't work?