We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 096b4d1 + 79014a8 commit a8fbaa7Copy full SHA for a8fbaa7
1 file changed
app/views/admin/questions/_generic_auto_evaluation_runs.html.erb
@@ -1,6 +1,6 @@
1
<%
2
runs_with_scores = runs.reject(&:error?)
3
- mean_score = runs_with_scores.map(&:score).sum / runs_with_scores.count
+ mean_score = runs_with_scores.any? ? runs_with_scores.map(&:score).sum / runs_with_scores.count : nil
4
items = [
5
{
6
field: "Mean score",
@@ -83,7 +83,7 @@
83
heading_level: 2,
84
} %>
85
86
- <% run.metrics.sort.each do |namespace, metrics| %>
+ <% (run.metrics || {}).sort.each do |namespace, metrics| %>
87
<%= render "govuk_publishing_components/components/summary_list", {
88
title: namespace.capitalize,
89
items: metrics.map do |metric, value|
0 commit comments