json.homework_common_id @homework.id
json.category @homework.category_info
json.course_name @course.name
json.work_id @work.id
if @shixun
  json.shixun_name @shixun.name
# 总体评价
  json.overall_appraisal @work.overall_appraisal
  json.myself_experience @work.myshixun.try(:total_score)
  json.total_experience @shixun.all_score
  json.work_score number_with_precision @work.work_score, precision: 1
  json.all_work_score number_with_precision 100, precision: 1
  json.time_consuming @work.myshixun_consume
  json.evaluate_count @user_evaluate_count.to_i
  if @homework.work_efficiency
    json.eff_score_full number_with_precision @homework.eff_score, precision: 1
    json.eff_score number_with_precision @work.eff_score, precision: 1
    json.challenge_score_full number_with_precision (100 - @homework.eff_score), precision: 1
    json.challenge_score number_with_precision @work.final_score, precision: 1
  end

# 阶段成绩
  json.stage_list do
    json.array! @games do |game|
      json.name game.challenge.subject
      json.is_delay student_work_is_delay?(@homework, game)
      json.open_time myshixun_open_time game
      json.evaluate_count game.evaluate_count
      json.finished_time finished_time game.end_time
      json.time_consuming time_consuming game
      json.myself_experience game.final_score
      json.experience game.challenge.all_score
      json.complete_status game_status(game, @homework)
      json.challenge_id game.challenge_id
      challenge_score = @homework.challenge_score game.challenge_id
      json.game_score_full challenge_score
      json.game_score @work.work_challenge_score game, challenge_score
    end
  end

# 个人总结
  json.work_description @work.description

# 用户信息
  json.user_id @user.id
  json.username @user.real_name
  json.student_id @user.student_id

# 图形统计
# 1： 效率
  json.echart_data @echart_data

# 实训详情
  json.shixun_detail do
    json.array! @games do |game|
      json.game_identifier game.identifier
      json.st game.challenge.st
      json.position game.challenge.position
      json.path game.challenge.path
      json.subject game.challenge.subject
      json.outputs game.distinct_query_index do |output|
        json.position output.query_index
        json.output_detail output_detail game, output
      end
      json.passed_code game.try(:lastest_code)
    end
  end
end


