redirect more users to feedback page

This commit is contained in:
Sebastian Serth
2020-09-28 18:36:05 +02:00
parent 78b9b2c08c
commit 654bf2ba33

View File

@ -101,7 +101,10 @@ class Submission < ApplicationRecord
end end
def redirect_to_feedback? def redirect_to_feedback?
((user_id + exercise.created_at.to_i) % 10 == 1) && exercise.needs_more_feedback? # Redirect 10% of users to the exercise feedback page. Ensure, that always the
# same users get redirected per exercise and different users for different exercises.
# If desired, the number of feedbacks can be limited with exercise.needs_more_feedback?
(user_id + exercise.created_at.to_i) % 10 == 1
end end
def own_unsolved_rfc def own_unsolved_rfc