Skip to content

Commit

Permalink
Merge pull request #5269 from dodona-edu/fix/broken-navigation
Browse files Browse the repository at this point in the history
Always show navigation on submission pages
  • Loading branch information
jorg-vr authored Jan 10, 2024
2 parents 0b6619a + 40a974e commit 024de48
Show file tree
Hide file tree
Showing 11 changed files with 90 additions and 118 deletions.
2 changes: 1 addition & 1 deletion app/assets/stylesheets/components/card.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

.card-outlined {
box-shadow: none;
border: 1px solid var(--d-outline);
border: 1px solid var(--d-divider);
}

.card-media {
Expand Down
9 changes: 5 additions & 4 deletions app/assets/stylesheets/models/submissions.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -510,10 +510,6 @@ iframe.file {
}
}

.score-details {
padding-bottom: 10px;
}

.submission-history {
display: flex;
max-height: 75px;
Expand All @@ -539,3 +535,8 @@ iframe.file {
margin-right: 6px;
}
}

.scores.card .card-title.card-title-colored-container .btn {
margin-top: -12px;
margin-bottom: -12px;
}
4 changes: 2 additions & 2 deletions app/views/evaluations/overview.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<thead>
<tr>
<th><%= t '.exercise' %></th>
<th><%= t '.feedback' %></th>
<th></th>
<th><%= t '.grade' if graded %></th>
<th class="actions"></th>
</tr>
Expand All @@ -33,7 +33,7 @@
<% if graded %>
<strong>
<% if fb.maximum_score %>
<%= t "feedbacks.score_table.total_score" %>
<%= t "feedbacks.score_card.total_score" %>
<% else %>
<%= t ".no_grading" %>
<% end %>
Expand Down
49 changes: 49 additions & 0 deletions app/views/feedbacks/_score_card.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<% total = policy(feedback.evaluation_exercise).show_total? %>
<% scores = policy_scope(feedback.scores) %>


<% if total || feedback.score_items.present? %>
<div class="card-outlined card scores">
<div class="card-title card-title-colored-container">
<span><%= t(".evaluation")%></span>
<%# Link to edit screen if needed %>
<% if policy(feedback).show? %>
<%= link_to feedback_path(feedback), class: "edit-score btn btn-text with-icon float-end", title: t(".view_feedback") do %>
<i class="mdi mdi-pencil"></i>
<%= t "score_items.table.edit" %>
<% end %>
<% end %>
</div>
<div class="card-supporting-text" id="<%= "score-details-#{feedback.id}" %>">
<div class="mb-2">
<%= t ".info_html", url: overview_evaluation_path(feedback.evaluation_exercise.evaluation) %>
</div>
<table class="table table-sm">
<% if total %>
<tr class="text-muted">
<td>
<%= t ".total_score" %>
<% unless feedback.evaluation_exercise.visible_score? %>
<i class="mdi mdi-school mdi-18 colored-secondary" title="<%= t "score_items.table.visible-no" %>"></i>
<% end %>
</td>
<td class="text-end"><%= format_score feedback.score %> / <%= format_score feedback.maximum_score %></td>
</tr>
<% end %>
<% scores.each do |score| %>
<tr>
<td>
<%= score.score_item.name %>
<% unless score.score_item.visible %>
<i class="mdi mdi-school mdi-18 colored-secondary" title="<%= t "score_items.table.visible-no" %>"></i>
<% end %>
<br>
<span class="text-muted small"><%= score.score_item.description %></span>
</td>
<td class="text-end"><%= format_score score.score %> / <%= format_score score.score_item.maximum %></td>
</tr>
<% end %>
</table>
</div>
</div>
<% end %>
30 changes: 0 additions & 30 deletions app/views/feedbacks/_score_link.html.erb

This file was deleted.

30 changes: 0 additions & 30 deletions app/views/feedbacks/_score_table.html.erb

This file was deleted.

56 changes: 23 additions & 33 deletions app/views/submissions/_description.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -47,46 +47,36 @@
<span class="text-muted small" title="<%= l submission.created_at, format: :submission %>"><%= time_ago_in_words submission.created_at %> <%= t "submissions.show.ago" %></span>
</span>
</div>
<% if @feedbacks.blank? %>
<div class="col-md-6 submission-history">
<div class="timestamp-col">
<% @submissions_time_stamps.each do |t| %>
<span class="text-muted small submission-history-row <%= t.present? ? 'mt-1' : '' %>"><%= t %></span>
<br/>
<% end %>
</div>
<div>
<% @submissions.each_with_index do |s, i| %>
<span class="submission-history-row <%= @submissions_time_stamps[i].present? ? 'mt-1' : '' %> <%= s.id == submission.id ? 'current-submission' : '' %>">
<%= link_to "##{@submissions.length - i}", submission_path(s), class: 'submission-link' %>
<span class='status-icon' id="history-<%= s.id %>"><%= submission_status_icon(s, 12) %></span>
<span>
<%= Submission.human_enum_name(:status, s.status) %>
<% if s.summary.present? and s.summary.downcase != Submission.human_enum_name(:status, s.status).downcase %>
&middot; <span class='text-muted'><%= s.summary %></span>
<% end %>
</span>
</span>
<br/>
<% end %>
</div>
<div class="col-md-6 submission-history">
<div class="timestamp-col">
<% @submissions_time_stamps.each do |t| %>
<span class="text-muted small submission-history-row <%= t.present? ? 'mt-1' : '' %>"><%= t %></span>
<br/>
<% end %>
</div>
<% else %>
<div class="col-md-6">
<% @feedbacks.each do |feedback| %>
<span class="score">
<%= render 'feedbacks/score_link', feedback: feedback %>
<div>
<% @submissions.each_with_index do |s, i| %>
<span class="submission-history-row <%= @submissions_time_stamps[i].present? ? 'mt-1' : '' %> <%= s.id == submission.id ? 'current-submission' : '' %>">
<%= link_to "##{@submissions.length - i}", submission_path(s), class: 'submission-link' %>
<span class='status-icon' id="history-<%= s.id %>"><%= submission_status_icon(s, 12) %></span>
<span>
<%= Submission.human_enum_name(:status, s.status) %>
<% if s.summary.present? and s.summary.downcase != Submission.human_enum_name(:status, s.status).downcase %>
&middot; <span class='text-muted'><%= s.summary %></span>
<% end %>
</span>
</span>
<br/>
<% end %>
</div>
</div>
<% @feedbacks.each do |feedback| %>
<div class="col-md-12">
<%= render 'feedbacks/score_card', feedback: feedback %>
</div>
<% end %>
</div>
</div>
<% @feedbacks.each do |feedback | %>
<div class="collapse score-details" id="<%= "score-details-#{feedback.id}" %>">
<%= render 'feedbacks/score_table', feedback: feedback %>
</div>
<% end %>

<% unless submission.queued? or submission.running? %>
<%= submission.judge.renderer.new(submission, current_user).parse %>
Expand Down
4 changes: 2 additions & 2 deletions config/locales/views/evaluations/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ en:
submission_correct: "Correct submission, "
submission_wrong: "Wrong submission, "
overview:
title: Evaluation overview
explanation: A course admin has evaluated your submissions for the series "%{series}". For each exercise, your last submission before %{deadline} was automatically selected, but the course admin may have manually selected a different one. Note that this evaluation doesn't necessarily mean that feedback has been added to all of your submissions.
title: Evaluation
explanation: A teacher reviewed your work for the "%{series}" series. They automatically picked your last submission before %{deadline}, but they might have chosen a different one manually. Keep in mind, this evaluation doesn't always include feedback on all your submissions.
released: Feedback was added to your code.
exercise: Exercise
no_annotations: "# comments"
Expand Down
4 changes: 2 additions & 2 deletions config/locales/views/evaluations/nl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ nl:
submission_correct: "Juiste oplossing, "
submission_wrong: "Foute oplossing, "
overview:
title: Evaluatie-overzicht
explanation: Een cursusbeheerder evalueerde je oplossingen voor de reeks "%{series}". Voor elke oefening werd je laatst ingediende oplossing voor %{deadline} automatisch geselecteerd, maar de cursusbeheerder selecteerde mogelijks handmatig een andere oplossing. Merk op dat deze evaluatie niet noodzakelijk betekent dat er feedback werd toevoegd aan elk van je oplossingen.
title: Evaluatie
explanation: Een lesgever heeft je werk voor de reeks "%{series}" bekeken. Dodona heeft automatisch je laatste inzending voor %{deadline} geselecteerd, maar mogelijk heeft de lesgever handmatig een andere gekozen. Houd er rekening mee dat deze evaluatie niet altijd feedback op al je oplossingen omvat.
released: Er werd feedback gegeven op je code
exercise: Oefening
feedback: "Feedback"
Expand Down
10 changes: 3 additions & 7 deletions config/locales/views/feedbacks/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,8 @@ en:
submissions_table:
update-submission: "Change to this submission"
confirm: "Are you sure? All comments on the previous submission will be deleted."
score_table:
score_card:
total_score: Total grade
score_breakdown: Grade breakdown
score_link:
score: "Grade: %{score} / %{max}"
score_short: "%{score} / %{max}"
present: "There are %{count} score items"
view_breakdown: View grade breakdown
evaluation: Evaluation
view_feedback: Go to the feedback
info_html: "This solution has been manually evaluated by a teacher as part of <a href=\"%{url}\"> an evaluation</a>. Below, you can find your feedback."
10 changes: 3 additions & 7 deletions config/locales/views/feedbacks/nl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,8 @@ nl:
submissions_table:
update-submission: "Veranderen naar deze oplossing"
confirm: "Ben je zeker? Alle opmerkingen op de vorige oplossing zullen verwijderd worden."
score_table:
score_card:
total_score: Totaalscore
score_breakdown: Puntenverdeling
score_link:
score: "Score: %{score} / %{max}"
score_short: "%{score} / %{max}"
present: "Er zijn %{count} scoreonderdelen"
view_breakdown: Puntenverdeling bekijken
evaluation: Evaluatie
view_feedback: Ga naar de feedback
info_html: "Deze oplossing werd manueel nagekeken door een lesgever als deel van <a href=\"%{url}\">een evaluatie</a>. Hieronder vind je jouw feedback."

0 comments on commit 024de48

Please sign in to comment.