|
|
@ -1187,7 +1187,9 @@ module ApplicationHelper
|
|
|
|
end
|
|
|
|
end
|
|
|
|
res
|
|
|
|
res
|
|
|
|
rescue Exception => e
|
|
|
|
rescue Exception => e
|
|
|
|
Rails.logger.error("post failed! #{e}")
|
|
|
|
Rails.logger.error("post failed! #{e.message}")
|
|
|
|
|
|
|
|
# 增加错误栈信息
|
|
|
|
|
|
|
|
e.backtrace.each { |msg| Rails.logger.error("post_backtrace: #{msg}") }
|
|
|
|
raise("实训云平台繁忙(繁忙等级:#{status})")
|
|
|
|
raise("实训云平台繁忙(繁忙等级:#{status})")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
@ -1198,7 +1200,7 @@ module ApplicationHelper
|
|
|
|
res = Net::HTTP.get_response(uri).body
|
|
|
|
res = Net::HTTP.get_response(uri).body
|
|
|
|
res = JSON.parse(res)
|
|
|
|
res = JSON.parse(res)
|
|
|
|
rescue => e
|
|
|
|
rescue => e
|
|
|
|
logger.error("get response failed ! #{e}")
|
|
|
|
logger.error("get response failed ! #{e.message}")
|
|
|
|
raise("实训云平台繁忙(繁忙等级:84)")
|
|
|
|
raise("实训云平台繁忙(繁忙等级:84)")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
@ -6578,7 +6580,7 @@ def update_shixun_work_status homework
|
|
|
|
myshixuns = Myshixun.where(:shixun_id => shixun.id, :user_id => student_works.map(&:user_id))
|
|
|
|
myshixuns = Myshixun.where(:shixun_id => shixun.id, :user_id => student_works.map(&:user_id))
|
|
|
|
myshixuns.each do |myshixun|
|
|
|
|
myshixuns.each do |myshixun|
|
|
|
|
work = student_works.where(:user_id => myshixun.user_id).first
|
|
|
|
work = student_works.where(:user_id => myshixun.user_id).first
|
|
|
|
member = homework.course.members.find_by(:user_id => work.user_id)
|
|
|
|
member = homework.course.members.find_by_user_id(work.user_id)
|
|
|
|
setting_time = homework_group_setting homework, member.try(:course_group_id)
|
|
|
|
setting_time = homework_group_setting homework, member.try(:course_group_id)
|
|
|
|
games = myshixun.games.where(:challenge_id => challeng_ids)
|
|
|
|
games = myshixun.games.where(:challenge_id => challeng_ids)
|
|
|
|
myshixun_endtime = games.select{|game| game.status == 2}.size == games.size ? games.map(&:end_time).max : nil
|
|
|
|
myshixun_endtime = games.select{|game| game.status == 2}.size == games.size ? games.map(&:end_time).max : nil
|
|
|
|