diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 2537c465..a368f88b 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -113,7 +113,7 @@ class StudentWorkController < ApplicationController pass_consume_time += (game.cost_time / 60.0).to_f end all_time += (game.cost_time / 60.0).to_f - user_total_score += game.final_score.to_i < 0 ? 0 : game.challenge.score.to_i + user_total_score += game.status == 2 ? game.final_score.to_i < 0 ? 0 : game.challenge.score.to_i : 0 if myshixun.user_id == @work.user.id @game_user_query << [game.id, game.outputs.first.try(:query_index).to_i] end diff --git a/app/helpers/shixuns_helper.rb b/app/helpers/shixuns_helper.rb index 23168ccf..a42225cd 100644 --- a/app/helpers/shixuns_helper.rb +++ b/app/helpers/shixuns_helper.rb @@ -5,7 +5,7 @@ module ShixunsHelper def myshixun_exp myshixun score = 0 myshixun.games.each do |game| - score += game.final_score.to_i < 0 ? 0 : game.challenge.score.to_i + score += game.status == 2 ? game.final_score.to_i < 0 ? 0 : game.challenge.score.to_i : 0 end score end diff --git a/app/views/student_work/shixun_work_report.html.erb b/app/views/student_work/shixun_work_report.html.erb index 9577d57e..34449b17 100644 --- a/app/views/student_work/shixun_work_report.html.erb +++ b/app/views/student_work/shixun_work_report.html.erb @@ -81,7 +81,7 @@ <%= user_query.blank? ? "--" : user_query.first[1] %> <%= game.try(:end_time).nil? ? "--" : format_time(game.end_time) %> <%= game.consumes_time %> - <%= game.final_score.to_i < 0 ? 0 : game.challenge.score.to_i %> / <%= game.challenge.st == 1 ? game.challenge.choose_score : game.challenge.score %> + <%= game.status == 2 ? (game.final_score.to_i < 0 ? 0 : game.challenge.score.to_i) : 0 %> / <%= game.challenge.st == 1 ? game.challenge.choose_score : game.challenge.score %> <% end %>