创建编程作业

This commit is contained in:
sw 2015-06-17 09:58:01 +08:00
parent 522fcbf755
commit 24970ce580
1 changed files with 5 additions and 2 deletions

View File

@ -73,8 +73,11 @@ class HomeworkCommonController < ApplicationController
if params[:input] && params[:output] if params[:input] && params[:output]
params[:input].each do |k,v| params[:input].each do |k,v|
if params[:output][k] if params[:output].include? k
homework_test = HomeworkTest.new
homework_test.input = v
homework_test.output = params[:output][k]
homework.homework_tests << homework_test
end end
end end
end end