Skip to content
This repository has been archived by the owner on Jul 3, 2020. It is now read-only.

Commit

Permalink
Prevent sending answers when the user has already finished the test
Browse files Browse the repository at this point in the history
  • Loading branch information
evgfilim1 committed Aug 19, 2018
1 parent ee90f4a commit e119947
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 0 additions & 4 deletions static/js/result.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
$(document).ready(function () {
uploadAllAnswers();
});

$('.answer').addClass('disabled');
$('.answered').toggleClass('btn-outline-primary btn-danger');
$('.correct').toggleClass('btn-outline-primary btn-success');
2 changes: 2 additions & 0 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ def save_answer(answer_id, user_id=None):
user = get_user(user_id)
if answer_id is None or user is None:
return False
if user.end_time is not None:
return True # just ignore
answer = Answer.query.get(answer_id)
if answer is None:
# TODO: log this, maybe it was right
Expand Down

0 comments on commit e119947

Please sign in to comment.