修改实训题未通关显示关卡内容为空

dev_forum
SylorHuang 5 years ago
parent f3d79b4693
commit 48bf9693d8

@ -640,7 +640,7 @@ class ExerciseQuestionsController < ApplicationController
if @exercise.exercise_status != 1
question_score = @exercise_question.question_score #原来的分数
update_question_score = params[:question_score].to_f.round(1) #传入的分数
choices_count = @exercise_question.exercise_choices.count #原来的选项个数
choices_count = @exercise_question.exercise_choices.size #原来的选项个数
exercise_choice_ids = @exercise_question.exercise_standard_answers.pluck(:exercise_choice_id).uniq
standard_answers_text = @exercise_question.exercise_standard_answers.pluck(:answer_text).uniq
update_choices_count = params[:question_choices].present? ? params[:question_choices].count : choices_count #传入的选项个数

@ -86,7 +86,7 @@ elsif question.question_type == 5
user_get_score = games_score[:s_score].present? ? games_score[:s_score] : 0.0
json.shixun_challenge_id s.id
if games_score[:games].count > 0
json.partial! "exercises/shixun_details",games: games_score[:games], user_score: user_get_score,game_score: games_score[:game_score]
json.partial! "exercises/shixun_details",games: games_score[:games], user_score: user_get_score,game_score: games_score[:game_score],shixun_challenge:s
else
json.partial! "exercises/shixun_undo",games: [s], user_score: user_get_score ,game_score: s.question_score
end

@ -26,6 +26,13 @@ json.shixun_detail do
json.position output.query_index
json.output_detail output_detail game, output
end
json.passed_code game.try(:lastest_code)
if game.try(:lastest_code).blank?
cha_path = challenge_path(shixun_challenge.challenge&.path)
latest_code = git_fle_content(shixun_challenge.shixun&.repo_path,cha_path)
else
latest_code = game.try(:lastest_code)
end
json.passed_code latest_code
end
end
Loading…
Cancel
Save