<% # Copyright (C) 2011 - present Instructure, Inc. # # This file is part of Canvas. # # Canvas is free software: you can redistribute it and/or modify it under # the terms of the GNU Affero General Public License as published by the Free # Software Foundation, version 3 of the License. # # Canvas is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR # A PARTICULAR PURPOSE. See the GNU Affero General Public License for more # details. # # You should have received a copy of the GNU Affero General Public License along # with this program. If not, see . %> <% page_section_static ||= nil %> <% page_section = page_section_static || nil %>
" id="page_section_<%= idx %>"> <% if page_section %>
<% if !page_section["section_type"] || page_section["section_type"] == "rich_text" || page_section["section_type"] == "html" %> <%= raw(page_section["content"]) || t('rich_text.default_content', "Nothing Entered Yet") %> <% elsif page_section["section_type"] == "attachment" %>
<% attachment = @static_attachments.find{|a| a.id == page_section["attachment_id"]} %> <% if attachment && attachment.content_type.match(/\Aimage/) %> <%= attachment.unencoded_filename %> <% elsif attachment %> <%= t('links.download_attachment', "Click here to Download *%{attachment}*", :attachment => attachment.display_name, :wrapper => '\1') %> <% end %>
<% elsif page_section["section_type"] == "submission" %> <% submission = @submissions_hash[page_section["submission_id"]] rescue nil %> <% rendered = false %> <% if submission %>
<%= t('headers.submission', "Student Submission for %{assignment}, created %{created_date}", :assignment => submission.assignment.title, :created_date => datetime_string(submission.submitted_at || submission.graded_at || submission.created_at)) %>
<% if submission.submission_type == 'online_url' %> <%= t('links.submission_url', "View the URL submitted for this assignment") %> <% rendered = true %> <% elsif submission.submission_type = 'online_upload' %> <% rendered = true %> <% elsif submission.submission_type = 'online_text_entry' %>
<%= submission.body %>
<% rendered = true %> <% end %> <% end %> <% if !rendered %> <%= t(:not_rendered, "There used to be a submission here, but we couldn't find it or didn't support the submission type for exporting.") %> <% end %> <% end %>
<% end %>