|
|
@ -85,8 +85,9 @@ class StudentWorkController < ApplicationController
|
|
|
|
@user_name = @work.user.show_real_name
|
|
|
|
@user_name = @work.user.show_real_name
|
|
|
|
@student_id = @work.user.user_extensions.try(:student_id).nil? ? '--' : @work.user.user_extensions.try(:student_id)
|
|
|
|
@student_id = @work.user.user_extensions.try(:student_id).nil? ? '--' : @work.user.user_extensions.try(:student_id)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
unless params[:pdf]
|
|
|
|
student_works_user_id = StudentWork.where(:homework_common_id => @homework.id).pluck(:user_id)
|
|
|
|
student_works_user_id = StudentWork.where(:homework_common_id => @homework.id).pluck(:user_id)
|
|
|
|
myshixuns = @shixun.myshixuns.where(:user_id => student_works_user_id).includes(games: [:outputs])
|
|
|
|
myshixuns = @shixun.myshixuns.where(:user_id => student_works_user_id).includes(:games)
|
|
|
|
|
|
|
|
|
|
|
|
# 课堂实训中,评测次数最大值
|
|
|
|
# 课堂实训中,评测次数最大值
|
|
|
|
@total_evaluate_max = 0
|
|
|
|
@total_evaluate_max = 0
|
|
|
@ -106,7 +107,7 @@ class StudentWorkController < ApplicationController
|
|
|
|
eff_score = 0
|
|
|
|
eff_score = 0
|
|
|
|
|
|
|
|
|
|
|
|
myshixun.games.each do |game|
|
|
|
|
myshixun.games.each do |game|
|
|
|
|
evaluate_count += game.outputs.first.try(:query_index).to_i # 评测次数
|
|
|
|
evaluate_count += game.evaluate_count.to_i # 评测次数
|
|
|
|
# y_score = (evaluate_count == 0 ? 0 : (user_total_score / evaluate_count.to_f))
|
|
|
|
# y_score = (evaluate_count == 0 ? 0 : (user_total_score / evaluate_count.to_f))
|
|
|
|
# eff_score = format("%.2f", y_score).to_f
|
|
|
|
# eff_score = format("%.2f", y_score).to_f
|
|
|
|
if game.status == 2
|
|
|
|
if game.status == 2
|
|
|
@ -115,7 +116,7 @@ class StudentWorkController < ApplicationController
|
|
|
|
all_time += (game.cost_time / 60.0).to_f
|
|
|
|
all_time += (game.cost_time / 60.0).to_f
|
|
|
|
user_total_score += game.status == 2 ? game.final_score.to_i < 0 ? 0 : game.challenge.score.to_i : 0
|
|
|
|
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.evaluate_count.to_i]
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
@ -163,6 +164,7 @@ class StudentWorkController < ApplicationController
|
|
|
|
result_list.sort{|x, y| x[:consume_time] <=> y[:consume_time]}.each do |result|
|
|
|
|
result_list.sort{|x, y| x[:consume_time] <=> y[:consume_time]}.each do |result|
|
|
|
|
@power << [result[:consume_time], result[:eff_score], result[:round_size], result[:user_id]]
|
|
|
|
@power << [result[:consume_time], result[:eff_score], result[:round_size], result[:user_id]]
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# @power = []
|
|
|
|
# @power = []
|
|
|
|