'Is the student still allowed to submit answers?'

def closed(self):

    if ((self.max_attempts is not None) and (self.attempts >= self.max_attempts)):
        return True
    if self.is_past_due():
        return True
    return False
