From 03d3a54e62f49cef64e5eed7aa34bfeec18db0bd Mon Sep 17 00:00:00 2001 From: Damian Ho Date: Sun, 21 May 2023 14:28:58 +0800 Subject: [PATCH] Correctly display PDF annotations on viewFeedback page (#1901) Special handling for pdf annotations --- app/views/assessments/_remarks_panel.html.erb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/views/assessments/_remarks_panel.html.erb b/app/views/assessments/_remarks_panel.html.erb index cab80b513..224ea6eb1 100644 --- a/app/views/assessments/_remarks_panel.html.erb +++ b/app/views/assessments/_remarks_panel.html.erb @@ -33,10 +33,13 @@ <%= annotation.value? ? sprintf("(%+.2f)", annotation.value.round(2)) : "" %> <% if annotation.global_comment? %> - <%= link_to "Global Annotation", [:view, @course, @assessment, @submission] %> + <%= link_to "Global Annotation", view_course_assessment_submission_path(@course, @assessment, @submission) %> + <% elsif annotation.coordinate.present? %> + <%# note: does not have a line number %> + <%= link_to filename.to_s, view_course_assessment_submission_path(@course, @assessment, @submission, header_position: annotation.position) %> <% else %> <%# line + 1 because line numbers start from 1 %> - <%= link_to filename.to_s + ":" + (annotation.line + 1).to_s, [:view, @course, @assessment, @submission, header_position: annotation.position] %> + <%= link_to filename.to_s + ":" + (annotation.line + 1).to_s, view_course_assessment_submission_path(@course, @assessment, @submission, header_position: annotation.position) %> <% end %>