You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
educoder/app/views/exercises/_shixun_details.json.jbuilder

42 lines
1.4 KiB

6 years ago
#阶段成绩
json.stage_list do
json.array! games do |game|
json.position game.challenge.position
json.name game.challenge.subject
json.evaluate_count game.evaluate_count
json.finished_time finished_time game.end_time
json.time_consuming time_consuming game
5 years ago
json.myself_experience game.final_score < 0 ? 0 : game.final_score #经验值
6 years ago
json.experience game.challenge.all_score #经验值
json.user_score user_score.round(1).to_s #用户获得的分数
json.game_score game_score.round(1).to_s #该关卡的总分数
end
end
# 实训详情
json.shixun_detail do
json.array! games do |game|
json.position game.challenge.position
json.game_identifier game.identifier
json.path game.challenge.path
json.st game.challenge.st
json.name game.challenge.subject
json.outputs game.distinct_query_index do |output|
json.position output.query_index
json.output_detail output_detail game, output
end
5 years ago
latest_code = nil
if shixun_challenge.challenge&.path.present?
if game.try(:lastest_code).blank?
cha_path = challenge_path(shixun_challenge.challenge&.path)
latest_code = git_fle_content(game.myshixun.repo_path,cha_path)
else
latest_code = game.try(:lastest_code)
end
end
5 years ago
json.passed_code latest_code
6 years ago
end
end