Skip to content

Commit

Permalink
don't count broken attempts when deciding if can start a new attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
christianp committed Dec 7, 2020
1 parent c5dc8da commit 996fc31
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion numbas_lti/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ def can_start_new_attempt(self,user):
return False
if self.max_attempts==0:
return True
return self.attempts.filter(user=user).count()<self.max_attempts or AccessToken.objects.filter(resource=self,user=user).exists()
return self.attempts.filter(user=user).exclude(broken=True).count()<self.max_attempts or AccessToken.objects.filter(resource=self,user=user).exists()

def user_data(self,user):
return LTIUserData.objects.filter(resource=self,user=user).last()
Expand Down

0 comments on commit 996fc31

Please sign in to comment.