diff --git a/app/controllers/exercises_controller.rb b/app/controllers/exercises_controller.rb index 2e33d11a..dc854fe9 100644 --- a/app/controllers/exercises_controller.rb +++ b/app/controllers/exercises_controller.rb @@ -381,11 +381,11 @@ class ExercisesController < ApplicationController # if user is external and has an own rfc, redirect to it and message him to clean up and accept the answer. (we need to check that the user is external, # otherwise an internal user could be shown a false rfc here, since current_user.id is polymorphic, but only makes sense for external users when used with rfcs.) # redirect 10 percent pseudorandomly to the feedback page - if ((current_user.id + @submission.exercise.created_at.to_i) % 10 == 1) - redirect_to_user_feedback - return - elsif current_user.respond_to? :external_id - if rfc = RequestForComment.unsolved.where(exercise_id: @submission.exercise, user_id: current_user.id).first + if current_user.respond_to? :external_id + if ((current_user.id + @submission.exercise.created_at.to_i) % 10 == 1) + redirect_to_user_feedback + return + elsif rfc = RequestForComment.unsolved.where(exercise_id: @submission.exercise, user_id: current_user.id).first # set a message that informs the user that his own RFC should be closed. flash[:notice] = I18n.t('exercises.submit.full_score_redirect_to_own_rfc') flash.keep(:notice)