diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 209fa7269..e885a780a 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -396,6 +396,7 @@ class StudentWorkController < ApplicationController if student_work_test.result == 0 student_score_count += 1 end + student_work_test.error_msg = params[:compile_error_msg] student_work_test.save! end end diff --git a/app/models/student_work_test.rb b/app/models/student_work_test.rb index 2e6efdf0a..413528b82 100644 --- a/app/models/student_work_test.rb +++ b/app/models/student_work_test.rb @@ -1,6 +1,6 @@ # encoding: utf-8 class StudentWorkTest < ActiveRecord::Base - attr_accessible :student_work_id, :homework_test_id, :result + attr_accessible :student_work_id, :homework_test_id, :result, :error_msg belongs_to :homework_test belongs_to :student_work diff --git a/db/migrate/20150722015428_add_errormsg_to_studen_work_test.rb b/db/migrate/20150722015428_add_errormsg_to_studen_work_test.rb new file mode 100644 index 000000000..e3f0611db --- /dev/null +++ b/db/migrate/20150722015428_add_errormsg_to_studen_work_test.rb @@ -0,0 +1,9 @@ +class AddErrormsgToStudenWorkTest < ActiveRecord::Migration + def up + add_column :student_work_tests,:error_msg,:text + end + + def down + remove_column :student_work_tests,:error_msg, + end +end