创建编程作业
This commit is contained in:
parent
522fcbf755
commit
24970ce580
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue