From 2c6e1ba86821a1062c9beddf7867d1fd9a090b43 Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 18 Mar 2019 14:11:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E6=8A=A5=E5=91=8A=E7=9A=84?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=80=BB=E8=A1=A8=E4=B8=8E=E5=88=86=E8=A1=A8?= =?UTF-8?q?=E7=9A=84=E6=95=B0=E6=8D=AE=E6=B2=A1=E6=9C=89=E5=8C=B9=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 2 +- app/helpers/shixuns_helper.rb | 2 +- app/views/student_work/shixun_work_report.html.erb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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 %>