|
|
|
@ -7,40 +7,41 @@ if @shixun
|
|
|
|
|
json.shixun_name @shixun.name
|
|
|
|
|
# 总体评价
|
|
|
|
|
json.overall_appraisal @work.overall_appraisal
|
|
|
|
|
json.myself_experience @work.myshixun.try(:total_score)
|
|
|
|
|
json.myself_experience @work.myshixun.try(:total_score).to_i
|
|
|
|
|
json.total_experience @shixun.all_score
|
|
|
|
|
json.work_score number_with_precision @work.work_score, precision: 1
|
|
|
|
|
json.work_score number_with_precision @work.work_score.to_f.round(2), 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.eff_score number_with_precision @work.eff_score.to_f.round(2), 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
|
|
|
|
|
json.challenge_score number_with_precision @work.final_score.to_f.round(2), 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.array! @challenges do |challenge|
|
|
|
|
|
json.name challenge.subject
|
|
|
|
|
game = @games.select{|game| game.challenge_id == challenge.id}.first if @games
|
|
|
|
|
json.is_delay game ? student_work_is_delay?(@homework, game) : false
|
|
|
|
|
json.open_time myshixun_open_time game
|
|
|
|
|
json.evaluate_count game.evaluate_count
|
|
|
|
|
json.finished_time finished_time game.end_time
|
|
|
|
|
json.evaluate_count game ? game&.evaluate_count : 0
|
|
|
|
|
json.finished_time game ? 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.myself_experience game ? game&.final_score : 0
|
|
|
|
|
json.experience challenge.all_score
|
|
|
|
|
json.complete_status game ? game_status(game, @homework) : 0
|
|
|
|
|
json.challenge_id challenge.id
|
|
|
|
|
challenge_score = @homework.challenge_score challenge.id
|
|
|
|
|
json.game_score_full challenge_score
|
|
|
|
|
json.game_score @work.work_challenge_score game, challenge_score
|
|
|
|
|
challenge_comment = @work.shixun_work_comments.find_by(challenge_id: game.challenge_id)
|
|
|
|
|
json.game_score @work.work_challenge_score game, challenge_score, challenge.id
|
|
|
|
|
challenge_comment = @work.shixun_work_comments.find_by(challenge_id: challenge.id)
|
|
|
|
|
json.challenge_comment challenge_comment&.comment
|
|
|
|
|
json.challenge_comment_hidden @user_course_identity < Course::STUDENT ? challenge_comment&.hidden_comment : nil
|
|
|
|
|
json.comment_id challenge_comment&.id
|
|
|
|
|
json.view_answer game.answer_open != 0
|
|
|
|
|
json.view_answer game ? game.answer_open != 0 : 0
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
@ -52,7 +53,7 @@ if @shixun
|
|
|
|
|
json.username @user.real_name
|
|
|
|
|
json.student_id @user.student_id
|
|
|
|
|
json.image_url url_to_avatar(@user)
|
|
|
|
|
json.complete_count @work.myshixun&.passed_count
|
|
|
|
|
json.complete_count @work.myshixun&.passed_count.to_i
|
|
|
|
|
json.challenges_count @shixun.challenges_count
|
|
|
|
|
json.efficiency @homework.work_efficiency ? number_with_precision(@work.efficiency, precision: 2) : nil
|
|
|
|
|
json.max_efficiency @homework.work_efficiency ? number_with_precision(@homework.max_efficiency, precision: 2) : nil
|
|
|
|
|