选择题答案查看问题

dev_course
daiao 5 years ago
parent 63c2dc69d2
commit 0980153856

@ -903,7 +903,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)
@ -914,7 +914,7 @@ class GamesController < ApplicationController
@chooses << sin_choose @chooses << sin_choose
test_sets << sin_test_set test_sets << sin_test_set
end end
@has_answer = has_answer.present? @has_answer = true # 选择题永远都有答案
@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