dev_local
daiao 6 years ago
parent 8983bf0557
commit 91f21434fb

@ -509,6 +509,7 @@ class MyshixunsController < ApplicationController
game.update_column(:picture_path, pics) game.update_column(:picture_path, pics)
end end
logger.info("training_task_status start#2**#{game_id}**** #{Time.now.strftime("%Y-%m-%d %H:%M:%S.%L")}") logger.info("training_task_status start#2**#{game_id}**** #{Time.now.strftime("%Y-%m-%d %H:%M:%S.%L")}")
test_set_score = 0
unless jenkins_testsets.blank? unless jenkins_testsets.blank?
jenkins_testsets.each_with_index do |j_test_set, i| jenkins_testsets.each_with_index do |j_test_set, i|
logger.info("j_test_set: ############## #{j_test_set}") logger.info("j_test_set: ############## #{j_test_set}")
@ -518,6 +519,10 @@ class MyshixunsController < ApplicationController
Output.create!(:code => status, :game_id => game_id, :out_put => outPut, :test_set_position => j_test_set['caseId'], Output.create!(:code => status, :game_id => game_id, :out_put => outPut, :test_set_position => j_test_set['caseId'],
:actual_output => actual_output, :result => j_test_set['passed'].to_i, :query_index => game.query_index, :actual_output => actual_output, :result => j_test_set['passed'].to_i, :query_index => game.query_index,
:compile_success => compile_success.to_i) :compile_success => compile_success.to_i)
# 如果设置了按测试集给分,则需要统计测试集的分值
if challenge.test_set_score && j_test_set['passed'].to_i == 1
test_set_score += challenge.test_sets.where(:position => j_test_set['caseId']).pluck(:score).first
end
end end
end end
logger.info("#############status: #{status}") logger.info("#############status: #{status}")

Loading…
Cancel
Save