diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index d4a5cab24..bfac1432f 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -73,8 +73,11 @@ class HomeworkCommonController < ApplicationController if params[:input] && params[:output] 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