|
|
|
@ -200,7 +200,7 @@ class ChallengesController < ApplicationController
|
|
|
|
|
test_set.delete_all unless test_set.blank?
|
|
|
|
|
params[:test_set].each_with_index do |set, index|
|
|
|
|
|
# last: 末尾匹配, full: 全完匹配
|
|
|
|
|
match_rule = params[:match_rule] == 'last' ? 'last' : 'full'
|
|
|
|
|
match_rule = set[:match_rule] == 'last' ? 'last' : 'full'
|
|
|
|
|
TestSet.create(:challenge_id => @challenge.id,
|
|
|
|
|
:input => "#{set[:input]}",
|
|
|
|
|
:output => "#{set[:output]}",
|
|
|
|
|