Samigo has a logic flaw that will make a test appear as 'Active' in the authorIndex UI even if the due date is passed and late submissions are not accepted.
Steps to reproduce:
- create a quiz with the following settings:
- a start and end date
- does not allow late submissions
- as any student user, use up all of your available submissions
- as the maintainer, go to the test's 'Scores' UI, and click the 'Submission Status' link at the top
- find the student you from the previous step that has used all of their submission attempts
- click the link to 'Allow Retake?'
- DON'T use the retake for the given student
- allow the due date to pass, or change the due date so that it has already passed
- view the authorIndex page, and notice that the 'Status' is still marked as 'Active'
The user with the available retake will not be able to use this retake, as the due date has passed and the test does not accept late submissions. The problem is a small piece of code in the AuthorActionListerner.isStillAvailable() method:
This code block does not take into account the quiz's setting for allowing submissions passed the due date, and thus will always return true (the test is active) if the following conditions are met:
- the test is passed the due date
- any user in the group/site still has available retakes
- late submissions are not accepted
To fix this, the conditional just needs a very small tweak: