Better precision in expiring quizzes
This commit is contained in:
@ -63,7 +63,7 @@ def start():
|
||||
return jsonify({'error': 'The exam code you entered is invalid.'}), 400
|
||||
if user_code and user_code not in test['time_adjustments']:
|
||||
return jsonify({'error': f'The user code you entered is not valid.'}), 400
|
||||
if test['expiry_date'] + timedelta(days=1) < datetime.utcnow():
|
||||
if test['expiry_date'] < datetime.utcnow():
|
||||
return jsonify({'error': f'The exam code you entered expired on {test["expiry_date"].strftime("%d %b %Y")} UTC.'}), 400
|
||||
if test['start_date'] > datetime.utcnow():
|
||||
return jsonify({'error': f'The exam has not yet opened. Your exam code will be valid from {test["start_date"].strftime("%d %b %Y %H:%M")} UTC.'}), 400
|
||||
|
Reference in New Issue
Block a user