自动评测不记录

dev_trainings
jingquan huang 6 years ago
parent b920395ede
commit ae07c1b6df

@ -536,6 +536,7 @@ class MyshixunsController < ApplicationController
end end
logger.info("#############status: #{status}") logger.info("#############status: #{status}")
logger.info("#############resubmit: #{resubmit}") logger.info("#############resubmit: #{resubmit}")
logger.info("sec_key is#############resubmit: #{sec_key}")
record = EvaluateRecord.where(:identifier => sec_key).first record = EvaluateRecord.where(:identifier => sec_key).first
logger.info("training_task_status start#3**#{game_id}**** #{Time.now.strftime("%Y-%m-%d %H:%M:%S.%L")}") logger.info("training_task_status start#3**#{game_id}**** #{Time.now.strftime("%Y-%m-%d %H:%M:%S.%L")}")

@ -347,10 +347,11 @@ class GamesService
rev = params[:rev] ? params[:rev] : "master" rev = params[:rev] ? params[:rev] : "master"
content_modified = 0 content_modified = 0
ActiveRecord::Base.transaction do ActiveRecord::Base.transaction do
sec_key = generates_identifier(EvaluateRecord, 10)
# params[:evaluate] 实训评测时更新必须给的参数,需要依据该参数做性能统计,其它类型的更新可以跳过 # params[:evaluate] 实训评测时更新必须给的参数,需要依据该参数做性能统计,其它类型的更新可以跳过
# 自动保存的时候evaluate为0点评测的时候为1 # 自动保存的时候evaluate为0点评测的时候为1
if params[:evaluate] == 1 if params[:evaluate] == 1
sec_key = generates_identifier(EvaluateRecord, 10)
record = EvaluateRecord.create!(:user_id => current_user.id, :shixun_id => @myshixun.shixun.id, record = EvaluateRecord.create!(:user_id => current_user.id, :shixun_id => @myshixun.shixun.id,
:game_id => @game.id, :identifier => sec_key) :game_id => @game.id, :identifier => sec_key)
Rails.logger.warn("##game is is #{@game.id}, record id is #{record.id}, time is**** #{Time.now.strftime("%Y-%m-%d %H:%M:%S.%L")}") Rails.logger.warn("##game is is #{@game.id}, record id is #{record.id}, time is**** #{Time.now.strftime("%Y-%m-%d %H:%M:%S.%L")}")

Loading…
Cancel
Save