diff --git a/app/controllers/problems_controller.rb b/app/controllers/problems_controller.rb --- a/app/controllers/problems_controller.rb +++ b/app/controllers/problems_controller.rb @@ -127,6 +127,14 @@ end end + def toggle_test + @problem = Problem.find(params[:id]) + @problem.update_attributes(test_allowed: !(@problem.test_allowed?) ) + respond_to do |format| + format.js { } + end + end + def turn_all_off Problem.find(:all, :conditions => "available = 1").each do |problem|