Skip to content

Commit

Permalink
fix issue #1 in unusable peer-review view
Browse files Browse the repository at this point in the history
  • Loading branch information
khanetor committed Apr 27, 2017
1 parent edf7cb1 commit b14bf5e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
1 change: 1 addition & 0 deletions app/controllers/exercises_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def show
# Teacher's view
@groups = @exercise.groups_with_submissions.order('groups.id, submissions.created_at DESC, reviews.id')

# TODO: should we remove this?
# Koodiaapinen hack. Remove after 2016.
sort_mode = if @exercise.id == 208 || @exercise.id == 289
:name
Expand Down
17 changes: 7 additions & 10 deletions app/views/exercises/_collaborative_group.html.erb
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<div class="col-lg-3 col-sm-6 col-xs-12">
<div class="col-lg-12 col-sm-12 col-xs-12">
<div class="group well" id="group<%= collaborative_group.id %>">
<!-- Name -->
<!-- TODO: if student, print student name, if group, print member names -->
<h2>
<% if @exercise.anonymous_submissions %>
Group <%= collaborative_group.id %>
<%= collaborative_group.users.map {|u| u.name}.join(', ') %>
<% else %>
<%= collaborative_group.name %>
<%= collaborative_group.name %>
<% end %>
</h2>

Expand All @@ -31,11 +32,9 @@
<%= video_player(submission.payload, 240) %>
<% end %>

<%= link_to submission_path(submission),
type: 'button',
class: 'btn btn-sm btn-default' do %>
<span class="glyphicon glyphicon-download-alt" aria-hidden="true"></span>
<%= submission.filename %>
<%= link_to submission_path(submission), type: 'button', class: 'btn btn-sm btn-default', 'data-toggle': 'tooltip', title: submission.filename do %>
<span class="glyphicon glyphicon-download-alt" aria-hidden="true"></span>
Submission <%= index %>
<% end %>
<% if @exercise.collaborative_mode == 'review' && !submission.annotatable? %>
<%= link_to review_submission_path(submission.id),
Expand All @@ -61,7 +60,6 @@
tooltip = t('exercises.my_submissions.view_collaborative_feedback')
else
tooltip = truncate(review.preview_feedback || '', length: 256)
#.gsub('<', '&lt;').gsub('>', '&gt;').gsub("\n", "<br />").html_safe
end
%>
<% if review.status %>
Expand All @@ -80,6 +78,5 @@
</div>
<% end %>
</div>

</div>
</div>
5 changes: 3 additions & 2 deletions app/views/exercises/my_submissions.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,11 @@
</table>
<% end %>

<% if @exercise.peer_review_active? && (@own_submission_count > 0 || @exercise.id == 289 || @exercise.id == 261) %><!-- Koodiaapinen hack. Remove after 2016. -->
<!-- TODO: Should we remove this now? -->
<!-- Koodiaapinen hack. Remove after 2016. -->
<% if @exercise.peer_review_active? && (@own_submission_count > 0 || @exercise.id == 289 || @exercise.id == 261) %>
<%= button_to t('.new_peer_review'), exercise_create_peer_review_path(@exercise.id), class: 'btn btn-primary btn-large' %>
<% end %>

<% end %>


Expand Down

0 comments on commit b14bf5e

Please sign in to comment.