From f563f5ef4c551c0c1f4cb815eb932f087055d176 Mon Sep 17 00:00:00 2001 From: Martijn Stegeman Date: Wed, 22 May 2019 16:33:19 +0200 Subject: [PATCH] submit --- app/models/submit.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/submit.rb b/app/models/submit.rb index 024fdf1c..fde3f5cc 100644 --- a/app/models/submit.rb +++ b/app/models/submit.rb @@ -80,9 +80,9 @@ def check_score return check_results[tool].count { |x| x["status"].present? } / check_results[tool].size.to_f when "check50v3" return check_results[tool]["results"].count { |x| x["passed"].present? } / check_results[tool]["results"].size.to_f - when "checkpy" && self.check_results[tool].is_a?(Array) + when "checkpy" && check_results[tool].is_a?(Array) return check_results[tool].collect { |f| f["nPassed"] }.sum - when "checkpy" && self.check_results[tool].is_a?(Hash) + when "checkpy" && check_results[tool].is_a?(Hash) return [check_results[tool]].collect { |f| f["nPassed"] }.sum end end