编程作业结果增加错误信息的存储
This commit is contained in:
parent
d9f312bbe3
commit
5bd1cdc4eb
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
Loading…
Reference in New Issue