diff --git a/app/controllers/challenges_controller.rb b/app/controllers/challenges_controller.rb index 25b259bcb..20811cab7 100644 --- a/app/controllers/challenges_controller.rb +++ b/app/controllers/challenges_controller.rb @@ -124,10 +124,6 @@ class ChallengesController < ApplicationController end def update - if params[:tab] == "6" - @shixun.update_attribute("propaedeutics", params[:shixun][:propaedeutics]) - redirect_to edit_shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => params[:tab]) - else ActiveRecord::Base.transaction do @challenge.update_attributes(params[:challenge]) if (params[:tab] == "1" || params[:tab].nil?) && @challenge.st != 0 @@ -147,38 +143,6 @@ class ChallengesController < ApplicationController redirect_to edit_shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => params[:tab]) end end - end -=begin - respond_to do |format| - ActiveRecord::Base.transaction do - @challenge.update_attributes(params[:challenge]) - begin - @test_sets.delete_all unless @test_sets.blank? - @challenge_tags.delete_all unless @challenge_tags.blank? - if params[:test_set][:hidden].length > 0 - params[:test_set][:input].each_with_index do |input, index| - unless (input[index] == params[:test_set][:output][index] && input[index].nil?) - params[:test_set][:hidden][index].to_i == 0 ? open = 1 : open = 0 - TestSet.create(:challenge_id => @challenge.id, :input => input, :output => params[:test_set][:output][index], :is_public => open, :position => (index + 1)) - end - end - end - unless params[:knowledge].blank? - params[:knowledge][:input].each do |input| - ChallengeTag.create(:name => input, :challenge_id => @challenge.id) - end - end - # 向jenkins端发送请求,构建公共测试用例 - add_shixun_modify_status(@shixun, 1) - format.html {redirect_to shixun_challenge_path(@challenge, :shixun_id => @shixun), notice: '更新成功!'} - rescue Exception => e - flash[:error] = "#{e.message}" - format.html{redirect_to edit_shixun_challenge_path(@challenge, :shixun_id => @shixun)} - raise ActiveRecord::Rollback - end - end - end -=end end def update_evaluation diff --git a/app/views/challenges/_edit_answer.html.erb b/app/views/challenges/_edit_answer.html.erb index 4dc249b46..1fd0f9522 100644 --- a/app/views/challenges/_edit_answer.html.erb +++ b/app/views/challenges/_edit_answer.html.erb @@ -3,7 +3,7 @@
- <% if @shixun.status == 0 && User.current.manager_of_shixun?(@shixun) %> + <% if User.current.manager_of_shixun?(@shixun) %> 编辑 <% end %>
diff --git a/app/views/challenges/_edit_propaedeutics.html.erb b/app/views/challenges/_edit_propaedeutics.html.erb index 26fc4bbc7..d3a5af201 100644 --- a/app/views/challenges/_edit_propaedeutics.html.erb +++ b/app/views/challenges/_edit_propaedeutics.html.erb @@ -1,9 +1,9 @@- <% if @shixun.status == 0 && User.current.manager_of_shixun?(@shixun) %> + <% if User.current.manager_of_shixun?(@shixun) %> 编辑 <% end %>
@@ -12,7 +12,7 @@