diff --git a/app/controllers/hack_user_lastest_codes_controller.rb b/app/controllers/hack_user_lastest_codes_controller.rb index d5405fd71..caee23936 100644 --- a/app/controllers/hack_user_lastest_codes_controller.rb +++ b/app/controllers/hack_user_lastest_codes_controller.rb @@ -96,7 +96,8 @@ class HackUserLastestCodesController < ApplicationController if ojEvaResult['execMode'] == "debug" save_debug_data ds_params elsif ojEvaResult['execMode'] == "submit" - save_submit_data ds_params.merge(expected_output: testCase['expectedOutput']) + save_submit_data ds_params.merge(expected_output: testCase['expectedOutput'], + error_test_set_id: ojEvaResult['failCaseNum']) end # 评测完成后,还原评测中的状态 @my_hack.update_attribute(:submit_status, 0) diff --git a/db/migrate/20191227061507_add_error_test_set_id_for_hack_user_lastest.rb b/db/migrate/20191227061507_add_error_test_set_id_for_hack_user_lastest.rb new file mode 100644 index 000000000..946d4bf59 --- /dev/null +++ b/db/migrate/20191227061507_add_error_test_set_id_for_hack_user_lastest.rb @@ -0,0 +1,5 @@ +class AddErrorTestSetIdForHackUserLastest < ActiveRecord::Migration[5.2] + def change + add_column :hack_user_codes, :error_test_set_id, :integer + end +end