Merge branch 'master' into save-run-results

This commit is contained in:
Ralf Teusner
2017-03-24 16:15:07 +01:00
8 changed files with 141 additions and 87 deletions

View File

@@ -21,7 +21,7 @@ class ExercisesController < ApplicationController
private :authorize!
def max_intervention_count
3
2
end
@@ -168,7 +168,15 @@ 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
when :break_intervention
@show_break_interventions = (!is_java_course || user_got_enough_interventions) ? "false" : "true"
when :rfc_intervention
@show_rfc_interventions = (!is_java_course || user_got_enough_interventions) ? "false" : "true"
end
@search = Search.new
@search.exercise = @exercise