Skip to content

Commit

Permalink
Merge pull request #697 from ProgrammingDaisukiClub/exKAZUu-patch-1
Browse files Browse the repository at this point in the history
Update contests_ranking_json.rb
  • Loading branch information
exKAZUu authored May 15, 2021
2 parents 9028ecb + 4500f58 commit ec7e803
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/controllers/concerns/api/contests_ranking_json.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,10 @@ def calculate_ranking_score(table)
problem_id = submission.problem.id
data_set_id = submission.data_set.id
user_data = table[user_id]
data = table[user_id][:problems][problem_id][:data_sets][data_set_id]
update_ranking_score(submission, user_data, data) unless data[:correct]
if table[user_id] && table[user_id][:problems] && table[user_id][:problems][problem_id] && table[user_id][:problems][problem_id][:data_sets]
data = table[user_id][:problems][problem_id][:data_sets][data_set_id]
update_ranking_score(submission, user_data, data) unless data[:correct]
end
end
end

Expand Down

0 comments on commit ec7e803

Please sign in to comment.