|
|
|
@ -451,15 +451,12 @@ class MyshixunsController < ApplicationController
|
|
|
|
|
# 只有评测中的game才会创建和更新代码评测中的信息
|
|
|
|
|
logger.info("##################game: #{game.status}")
|
|
|
|
|
logger.info("##################retry_status: #{game.retry_status}")
|
|
|
|
|
if game.status == 1 || game.status == 2 && game.retry_status == 1
|
|
|
|
|
if game.status == 1 || game.status == 2
|
|
|
|
|
if msg.blank?
|
|
|
|
|
RunCodeMessage.create!(:game_id => game_id, :status => 1, :message => message)
|
|
|
|
|
else
|
|
|
|
|
msg.update_attributes(:status => (msg.status + 1), :message => message)
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
# 评测完成,初始化评测信息的状态
|
|
|
|
|
msg.update_attributes(:status => 0, :message => nil) if msg.present?
|
|
|
|
|
end
|
|
|
|
|
render :json => {:data => "success"}
|
|
|
|
|
end
|
|
|
|
|