Skip to content

Commit

Permalink
Merge pull request #3012 from dodona-edu/feature/student-labels-evalu…
Browse files Browse the repository at this point in the history
…ation-interface

Add student label to evaluation interface
  • Loading branch information
bmesuere authored Aug 30, 2021
2 parents fef39e7 + 176fe53 commit bf7db6e
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 18 deletions.
60 changes: 44 additions & 16 deletions app/assets/stylesheets/components/evaluations.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,52 @@
}
}

.feedback-metadata .complete-feedback {
display: flex;
justify-content: center;
align-items: center;
line-height: normal;
width: 100%;
}
.feedback-metadata .uncomplete-feedback {
display: flex;
}
.feedback-metadata {
.complete-feedback {
display: flex;
justify-content: center;
align-items: center;
line-height: normal;
width: 100%;
}

.feedback-metadata .form-row {
display: flex;
align-items: center;
padding-bottom: 5px;
}
.uncomplete-feedback {
display: flex;
}

.form-row {
display: flex;
align-items: center;
padding-bottom: 5px;
}

.username-row {
display: flex;
align-items: center;
white-space: nowrap;
padding-bottom: 5px;

.name {
flex-shrink: 0;
}
}

.token {
display: inline-block;
margin-left: 6px;
padding-top: 6px;
overflow: hidden;
text-overflow: ellipsis;
}

.labels-row {
display: flex;
white-space: nowrap;
margin-top: -6px;
margin-bottom: 12px;
margin-left: -6px;
}

.feedback-metadata {
.form-group.input {
width: 100%;
margin-bottom: 0;
Expand Down
7 changes: 7 additions & 0 deletions app/controllers/feedbacks_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ def show
]
@title = I18n.t('feedbacks.show.feedback')

@user_labels = @feedback.evaluation
.series
.course
.course_memberships
.find_by(user_id: @feedback.user)
.course_labels

@score_map = @feedback.scores.index_by(&:score_item_id)
# If we refresh all scores because of a conflict, we want to make
# sure the user is aware the update was not successful. By setting
Expand Down
15 changes: 13 additions & 2 deletions app/views/feedbacks/_feedback_actions.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,19 @@
<div class="progress-row">
<%= render partial: 'feedbacks/progress_row', locals: { metadata: @feedback.evaluation_exercise.metadata } %>
</div>

<h4 class="ellipsis-overflow" title="<%= @feedback.user.full_name %>"><%= @feedback.user.full_name %></h4>
<div class="username-row">
<h4 class="ellipsis-overflow name" title="<%= @feedback.user.full_name %>"><%= @feedback.user.full_name %></h4>
<% if @user_labels.present? %>
<span class="token accent-orange" title="<%= @user_labels.first.name %>"><%= @user_labels.first.name %></span>
<% end %>
</div>
<% if @user_labels.present? && @user_labels.length > 1 %>
<div class="labels-row">
<% @user_labels[1..].each do |label| %>
<span class="token accent-orange" title="<%= label.name %>"><%= label.name %></span>
<% end %>
</div>
<% end %>
<div class="user-feedback-row">
<%= render partial: 'feedbacks/user_feedback_row', locals: { current_feedback: @feedback } %>
</div>
Expand Down

0 comments on commit bf7db6e

Please sign in to comment.