|
|
|
@ -181,7 +181,7 @@ class ChallengesController < ApplicationController
|
|
|
|
|
begin
|
|
|
|
|
ActiveRecord::Base.transaction do
|
|
|
|
|
tab = params[:tab].to_i
|
|
|
|
|
@challenge.update_attributes(challenge_params)
|
|
|
|
|
@challenge.update_attributes!(challenge_params)
|
|
|
|
|
if tab == 0 && @challenge.st == 0
|
|
|
|
|
@challenge.challenge_tags.delete_all
|
|
|
|
|
if params[:challenge_tag].present?
|
|
|
|
@ -211,7 +211,7 @@ class ChallengesController < ApplicationController
|
|
|
|
|
# last: 末尾匹配, full: 全完匹配
|
|
|
|
|
logger.info("set: #{set}; match_rule : #{set[:match_rule]}")
|
|
|
|
|
match_rule = set[:match_rule] == 'last' ? 'last' : 'full'
|
|
|
|
|
TestSet.create(:challenge_id => @challenge.id,
|
|
|
|
|
TestSet.create!(:challenge_id => @challenge.id,
|
|
|
|
|
:input => "#{set[:input]}",
|
|
|
|
|
:output => "#{set[:output]}",
|
|
|
|
|
:is_public => params_hidden[index],
|
|
|
|
|