From b14bf5ee2cfeb260218ad7b80541a2581d6a727b Mon Sep 17 00:00:00 2001 From: Nguyen Kha Date: Thu, 27 Apr 2017 17:18:18 +0300 Subject: [PATCH] fix issue #1 in unusable peer-review view --- app/controllers/exercises_controller.rb | 1 + .../exercises/_collaborative_group.html.erb | 17 +++++++---------- app/views/exercises/my_submissions.html.erb | 5 +++-- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/app/controllers/exercises_controller.rb b/app/controllers/exercises_controller.rb index 4b32e69f..15f217f9 100644 --- a/app/controllers/exercises_controller.rb +++ b/app/controllers/exercises_controller.rb @@ -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 diff --git a/app/views/exercises/_collaborative_group.html.erb b/app/views/exercises/_collaborative_group.html.erb index 57dfbfee..b67368bc 100644 --- a/app/views/exercises/_collaborative_group.html.erb +++ b/app/views/exercises/_collaborative_group.html.erb @@ -1,11 +1,12 @@ -
+
+

<% if @exercise.anonymous_submissions %> - Group <%= collaborative_group.id %> + <%= collaborative_group.users.map {|u| u.name}.join(', ') %> <% else %> - <%= collaborative_group.name %> + <%= collaborative_group.name %> <% end %>

@@ -31,11 +32,9 @@ <%= video_player(submission.payload, 240) %> <% end %> - <%= link_to submission_path(submission), - type: 'button', - class: 'btn btn-sm btn-default' do %> - - <%= submission.filename %> + <%= link_to submission_path(submission), type: 'button', class: 'btn btn-sm btn-default', 'data-toggle': 'tooltip', title: submission.filename do %> + + Submission <%= index %> <% end %> <% if @exercise.collaborative_mode == 'review' && !submission.annotatable? %> <%= link_to review_submission_path(submission.id), @@ -61,7 +60,6 @@ tooltip = t('exercises.my_submissions.view_collaborative_feedback') else tooltip = truncate(review.preview_feedback || '', length: 256) - #.gsub('<', '<').gsub('>', '>').gsub("\n", "
").html_safe end %> <% if review.status %> @@ -80,6 +78,5 @@
<% end %>
-
diff --git a/app/views/exercises/my_submissions.html.erb b/app/views/exercises/my_submissions.html.erb index 62d57f12..beb7939d 100644 --- a/app/views/exercises/my_submissions.html.erb +++ b/app/views/exercises/my_submissions.html.erb @@ -55,10 +55,11 @@ <% end %> - <% if @exercise.peer_review_active? && (@own_submission_count > 0 || @exercise.id == 289 || @exercise.id == 261) %> + + + <% 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 %>