|
|
@ -782,7 +782,7 @@ class CompetitionsController < ApplicationController
|
|
|
|
|
|
|
|
|
|
|
|
challenges.each do |challenge|
|
|
|
|
challenges.each do |challenge|
|
|
|
|
Game.where(:challenge_id => challenge.id, :user_id => user_ids, :status => 2).select{|game| game.open_time >= s_time && game.end_time <= e_time }.each do |game|
|
|
|
|
Game.where(:challenge_id => challenge.id, :user_id => user_ids, :status => 2).select{|game| game.open_time >= s_time && game.end_time <= e_time }.each do |game|
|
|
|
|
outputs = game.outputs.select{|output| !output.text_scor.nil? }
|
|
|
|
outputs = game.outputs.select{|output| !output.text_scor.nil? && output.created_at <= e_time }
|
|
|
|
if outputs.present?
|
|
|
|
if outputs.present?
|
|
|
|
outputs = outputs.sort { |a, b| b[:text_scor].to_f <=> a[:text_scor].to_f }
|
|
|
|
outputs = outputs.sort { |a, b| b[:text_scor].to_f <=> a[:text_scor].to_f }
|
|
|
|
myshixun_score = outputs.first.text_scor.to_f
|
|
|
|
myshixun_score = outputs.first.text_scor.to_f
|
|
|
|