Merge branch 'dev_aliyun' of http://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_course
cxt 5 years ago
commit 904f2ce49c

@ -77,7 +77,7 @@ class GamesController < ApplicationController
# 区分选择题和编程题st0编程题 # 区分选择题和编程题st0编程题
if @st == 0 if @st == 0
has_answer = game_challenge.challenge_answers.size == 0 ? false : true has_answer = game_challenge.challenge_answers.size != 0
game_challenge.answer = nil game_challenge.answer = nil
mirror_name = @shixun.mirror_name mirror_name = @shixun.mirror_name
@ -87,7 +87,7 @@ class GamesController < ApplicationController
rescue rescue
uid_logger("实训平台繁忙繁忙等级81") uid_logger("实训平台繁忙繁忙等级81")
end end
tpm_cases_modified = (game_challenge.modify_time != @game.modify_time ? true : false) # modify_time 决定TPM测试集是否有更新 tpm_cases_modified = (game_challenge.modify_time != @game.modify_time) # modify_time 决定TPM测试集是否有更新
@task_result = {tpm_modified: tpm_modified, tpm_cases_modified: tpm_cases_modified, mirror_name: mirror_name, has_answer: has_answer} @task_result = {tpm_modified: tpm_modified, tpm_cases_modified: tpm_cases_modified, mirror_name: mirror_name, has_answer: has_answer}
@ -629,7 +629,7 @@ class GamesController < ApplicationController
# user_answer虽然是传的数组,但是可能存在多选择提的情况. # user_answer虽然是传的数组,但是可能存在多选择提的情况.
user_answer_tran = user_answer[index].size > 1 ? user_answer[index].split("").sort.join("") : user_answer[index] user_answer_tran = user_answer[index].size > 1 ? user_answer[index].split("").sort.join("") : user_answer[index]
standard_answer_tran = choose.standard_answer.size > 1 ? choose.standard_answer.split("").sort.join("") : choose.standard_answer standard_answer_tran = choose.standard_answer.size > 1 ? choose.standard_answer.split("").sort.join("") : choose.standard_answer
correct = (user_answer_tran == standard_answer_tran) ? true : false correct = (user_answer_tran == standard_answer_tran)
if str.present? if str.present?
str += "," str += ","
end end

@ -278,7 +278,6 @@ class MyshixunsController < ApplicationController
end end
end end
if game.status == 2 if game.status == 2
@resubmit = Time.now.to_i @resubmit = Time.now.to_i
end end

@ -0,0 +1,5 @@
class AddIndexForRunCodeMessage < ActiveRecord::Migration[5.2]
def change
add_index :run_code_messages, :game_id
end
end
Loading…
Cancel
Save