Skip to content

Commit a8fbaa7

Browse files
authored
Merge pull request #957 from alphagov/quick-metrics-fix
[CHAT-417] Quick fixes for question show page in the Admin UI
2 parents 096b4d1 + 79014a8 commit a8fbaa7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

app/views/admin/questions/_generic_auto_evaluation_runs.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<%
22
runs_with_scores = runs.reject(&:error?)
3-
mean_score = runs_with_scores.map(&:score).sum / runs_with_scores.count
3+
mean_score = runs_with_scores.any? ? runs_with_scores.map(&:score).sum / runs_with_scores.count : nil
44
items = [
55
{
66
field: "Mean score",
@@ -83,7 +83,7 @@
8383
heading_level: 2,
8484
} %>
8585

86-
<% run.metrics.sort.each do |namespace, metrics| %>
86+
<% (run.metrics || {}).sort.each do |namespace, metrics| %>
8787
<%= render "govuk_publishing_components/components/summary_list", {
8888
title: namespace.capitalize,
8989
items: metrics.map do |metric, value|

0 commit comments

Comments
 (0)