|
|
@ -77,7 +77,7 @@ class GamesController < ApplicationController
|
|
|
|
|
|
|
|
|
|
|
|
# 区分选择题和编程题,st:0编程题;
|
|
|
|
# 区分选择题和编程题,st:0编程题;
|
|
|
|
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
|
|
|
|