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

competitions
hjm 5 years ago
commit 7cb7bbf2e5

@ -881,7 +881,7 @@ class GamesController < ApplicationController
end end
# actual_output为空表示暂时没有评测答题不允许查看 # actual_output为空表示暂时没有评测答题不允许查看
actual_output = output.try(:actual_output).try(:strip) actual_output = output.try(:actual_output).try(:strip)
#has_answer << choose.answer if choose.answer.present? has_answer << choose.answer if choose.answer.present?
# 标准答案处理,错误的不让用户查看,用-1替代 # 标准答案处理,错误的不让用户查看,用-1替代
standard_answer = (actual_output.blank? || !output.try(:result)) ? -1 : choose.standard_answer standard_answer = (actual_output.blank? || !output.try(:result)) ? -1 : choose.standard_answer
result = output.try(:result) result = output.try(:result)
@ -892,7 +892,7 @@ class GamesController < ApplicationController
@chooses << sin_choose @chooses << sin_choose
test_sets << sin_test_set test_sets << sin_test_set
end end
@has_answer = true # 选择题永远都有答案 @has_answer = has_answer.presence
@choose_test_cases = {:had_submmit => had_submmit, :challenge_chooses_count => challenge_chooses_count, @choose_test_cases = {:had_submmit => had_submmit, :challenge_chooses_count => challenge_chooses_count,
:choose_correct_num => choose_correct_num, :test_sets => test_sets} :choose_correct_num => choose_correct_num, :test_sets => test_sets}
end end

Loading…
Cancel
Save