dev_course
SylorHuang 5 years ago
parent b43c58a39a
commit 418077c59a

@ -82,15 +82,16 @@ elsif question.question_type == 5
json.shixun_details do json.shixun_details do
json.array! shixun_challenges do |s| json.array! shixun_challenges do |s|
#
exercise_cha_score = nil # exercise_cha_score = nil
game = Game.user_games(ex_answerer.id,s.challenge_id).first # game = Game.user_games(ex_answerer.id,s.challenge_id).first
if game.present? # if game.present?
if game.status == 2 && game.final_score >= 0 # if game.status == 2 && game.final_score >= 0
exercise_cha_score = s.question_score #每一关卡的得分 # exercise_cha_score = s.question_score #每一关卡的得分
end # end
end # end
json.exercise_cha_socre exercise_cha_score user_shixun_score = s.exercise_shixun_answers.where(user_id:ex_answerer.id,exercise_question_id:question.id)
json.exercise_cha_socre user_shixun_score.present? ? user_shixun_score.first.score : -1
games_score = shixun_game_scores(s,ex_answerer,shixun_type,question.id) games_score = shixun_game_scores(s,ex_answerer,shixun_type,question.id)
user_get_score = games_score[:s_score].present? ? games_score[:s_score] : 0.0 user_get_score = games_score[:s_score].present? ? games_score[:s_score] : 0.0

Loading…
Cancel
Save