实训报告的数据总表与分表的数据没有匹配

dev_haigong
cxt 6 years ago
parent fdbdb4a585
commit 2c6e1ba868

@ -113,7 +113,7 @@ class StudentWorkController < ApplicationController
pass_consume_time += (game.cost_time / 60.0).to_f pass_consume_time += (game.cost_time / 60.0).to_f
end end
all_time += (game.cost_time / 60.0).to_f 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 if myshixun.user_id == @work.user.id
@game_user_query << [game.id, game.outputs.first.try(:query_index).to_i] @game_user_query << [game.id, game.outputs.first.try(:query_index).to_i]
end end

@ -5,7 +5,7 @@ module ShixunsHelper
def myshixun_exp myshixun def myshixun_exp myshixun
score = 0 score = 0
myshixun.games.each do |game| 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 end
score score
end end

@ -81,7 +81,7 @@
<td><%= user_query.blank? ? "--" : user_query.first[1] %></td> <td><%= user_query.blank? ? "--" : user_query.first[1] %></td>
<td><%= game.try(:end_time).nil? ? "--" : format_time(game.end_time) %></td> <td><%= game.try(:end_time).nil? ? "--" : format_time(game.end_time) %></td>
<td><%= game.consumes_time %></td> <td><%= game.consumes_time %></td>
<td><%= game.final_score.to_i < 0 ? 0 : game.challenge.score.to_i %> / <%= game.challenge.st == 1 ? game.challenge.choose_score : game.challenge.score %></td> <td><%= 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 %></td>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>

Loading…
Cancel
Save