Skip to content

Commit 9978b3f

Browse files
author
Ben Lerner
committed
improve display when no output was received
1 parent 9cfc19b commit 9978b3f

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

app/views/grades/_show_simple_list.html.erb

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,24 @@
11
<div id="tests">
22
<% if @tests.nil? %>
3-
<pre><%= @grading_output.output %></pre>
3+
<% if @grading_output.output %>
4+
<h4>Output:</h4>
5+
<pre><%= @grading_output.output %></pre>
6+
<% end %>
7+
<% if @grading_output.errors %>
8+
<h4>Errors:</h4>
9+
<% if @grading_output.errors.is_a? String %>
10+
<pre><%= @grading_output.errors %></pre>
11+
<% else %>
12+
<ul>
13+
<% @grading_output.errors.each do |e| %>
14+
<li><pre><%= e %></pre></li>
15+
<% end %>
16+
</ul>
17+
<% end %>
18+
<% end %>
19+
<% if @grading_output.errors.blank? && @grading_output.output.blank? %>
20+
<h4>No output or errors received at all. Please contact a professor.</h4>
21+
<% end %>
422
<% else %>
523
<% @tests.each_with_index do |t, i| %>
624
<% if t[:passed]

0 commit comments

Comments
 (0)