- added abc group separator class to split users into different groups for testing proxy exercises and interventions

- shows 2 interventions per user and exercise max now
- only show break or rfc intervention to user
This commit is contained in:
Thomas Hille
2017-03-23 18:52:46 +01:00
parent 420d8b3844
commit 4798ffcfcf
4 changed files with 98 additions and 62 deletions

View File

@ -21,7 +21,7 @@ class ExercisesController < ApplicationController
private :authorize!
def max_intervention_count
3
2
end
@ -168,7 +168,18 @@ class ExercisesController < ApplicationController
user_got_enough_interventions = UserExerciseIntervention.where(exercise: @exercise, user: current_user).count >= max_intervention_count
is_java_course = @course_token && @course_token.eql?(java_course_token)
@show_interventions = (!is_java_course || user_got_enough_interventions) ? "false" : "true"
user_intervention_group = UserGroupSeparator.getInterventionGroup(current_user)
case user_intervention_group
when :no_intervention
puts "non"
when :break_intervention
puts "break"
@show_break_interventions = (!is_java_course || user_got_enough_interventions) ? "false" : "true"
when :rfc_intervention
puts "rfc"
@show_rfc_interventions = (!is_java_course || user_got_enough_interventions) ? "false" : "true"
end
@search = Search.new
@search.exercise = @exercise