diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index e6769d32a..ed33dbfa6 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -310,7 +310,7 @@ class ShixunsController < ApplicationController # 之所以增加user_id是为了方便统计查询性能 challenges.each_with_index do |challenge, index| status = (index == 0 ? 0 : 3) - down_generate_identifier("game") + code = down_generate_identifier("game") game =Game.create!(:challenge_id => challenge.id, :myshixun_id => myshixun.id, :status => status, :user_id => myshixun.user_id, :open_time => Time.now, :identifier => code) # 记录刚开始时默认代开文件原始代码 # 刚开始fork的一段时间是获取不了content内容的 @@ -584,7 +584,7 @@ class ShixunsController < ApplicationController # 为了避免fork多次的问题 if gshixun.try(:name).include?("-") @g.delete_project(gshixun.id) - gshixun = @g.project(myshixun.gid) + gshixun = @g.project(myshixun.gpid) myshixun.update_column(:gpid, gshixun.id) end code = down_generate_identifier("myshixun") diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index ef702e5f3..236d7e93f 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -67,6 +67,7 @@ module ApplicationHelper # 若实训有更改,则修改已发不实训的标记为已更改 # shixun_modifies表中1表示已更改,进入myshixun需要强制重置,0表示没有修改 # type 0:表示已经是最新的了;1:表示已经有修改 + # res返回结果0表示正确,-1表示有异常 def add_shixun_modify_status shixun, type shixun_tomcat = Redmine::Configuration['shixun_tomcat'] gameInfo = shixun.gameInfo