Closed madebydna closed 13 years ago
I think this is fairly simple to do. Just add that check to line 22 of submission.rb. Something like:
def only_one_correct_submission_per_puzzle_per_user
if user && !user.draft_access && user.solution_for(puzzle)
errors[:base] << "You've already solved this puzzle!"
return false
end
end
Merged in Pull Request #31
Users with draft access should be able to submit correct solutions multiple times. Right now, after submitting a correct solution the button for submitting one's solution is gone.
Enabling users with draft access to submit correct solutions multiple times would come in handy during the testing phase of a new puzzle. For example, if changes are made to the original input or solution file as a result of tester feedback.