From 5e885d9417dcc39f64599ce0f082fb165981c1f3 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 30 Jul 2015 17:38:01 +0800 Subject: [PATCH] =?UTF-8?q?=E8=80=81=E5=B8=88=E5=B8=83=E7=BD=AE=E7=BC=96?= =?UTF-8?q?=E7=A8=8B=E4=BD=9C=E4=B8=9A=E7=95=8C=E9=9D=A2=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=EF=BC=8C=E4=BB=A5=E5=8F=8A=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E7=BB=93=E6=9E=9C=E7=9A=84=E5=AD=98=E5=82=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../_homework_detail_programing_form.html.erb | 2 ++ db/migrate/20150730093403_add_result_to_test.rb | 9 +++++++++ db/schema.rb | 17 ++++------------- public/javascripts/course.js | 1 + 4 files changed, 16 insertions(+), 13 deletions(-) create mode 100644 db/migrate/20150730093403_add_result_to_test.rb diff --git a/app/views/homework_common/_homework_detail_programing_form.html.erb b/app/views/homework_common/_homework_detail_programing_form.html.erb index 3063b3af5..43bfc2254 100644 --- a/app/views/homework_common/_homework_detail_programing_form.html.erb +++ b/app/views/homework_common/_homework_detail_programing_form.html.erb @@ -97,6 +97,7 @@ 测试 +
@@ -115,6 +116,7 @@ 测试 +
diff --git a/db/migrate/20150730093403_add_result_to_test.rb b/db/migrate/20150730093403_add_result_to_test.rb new file mode 100644 index 000000000..8494fbbf5 --- /dev/null +++ b/db/migrate/20150730093403_add_result_to_test.rb @@ -0,0 +1,9 @@ +class AddResultToTest < ActiveRecord::Migration + def up + add_column :homework_tests, :result, :integer,default: 0 + end + + def down + remove_column :homework_tests,:result + end +end diff --git a/db/schema.rb b/db/schema.rb index 0e8cde619..3791eb248 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20150722015428) do +ActiveRecord::Schema.define(:version => 20150730093403) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -632,8 +632,9 @@ ActiveRecord::Schema.define(:version => 20150722015428) do t.text "input" t.text "output" t.integer "homework_common_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "result", :default => 0 end create_table "homework_users", :force => true do |t| @@ -744,16 +745,6 @@ ActiveRecord::Schema.define(:version => 20150722015428) do add_index "journal_details", ["journal_id"], :name => "journal_details_journal_id" - create_table "journal_details_copy", :force => true do |t| - t.integer "journal_id", :default => 0, :null => false - t.string "property", :limit => 30, :default => "", :null => false - t.string "prop_key", :limit => 30, :default => "", :null => false - t.text "old_value" - t.text "value" - end - - add_index "journal_details_copy", ["journal_id"], :name => "journal_details_journal_id" - create_table "journal_replies", :id => false, :force => true do |t| t.integer "journal_id" t.integer "user_id" diff --git a/public/javascripts/course.js b/public/javascripts/course.js index 8c6991a3a..b6ecc9f52 100644 --- a/public/javascripts/course.js +++ b/public/javascripts/course.js @@ -551,6 +551,7 @@ function add_programing_test(obj) { "
  • " + "" + "测试" + + "" + "
  • "); } //删除测试结果