Commit Graph

33 Commits

Author SHA1 Message Date
John Corrigan 33c1f48e77 ePub export progress bar shows real progress
fixes CNVS-25978

test plan:
- Generate an ePub export.
- Observe that the progress bar shows greater variation than it used to.
- Generate a normal content export without an ePub export.
- Observe that it generates as usual.

Change-Id: I46debe8280e8a227fde1933334923ed011b624fa
Reviewed-on: https://gerrit.instructure.com/69085
Tested-by: Jenkins
Reviewed-by: Matt Berns <mberns@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: John Corrigan <jcorrigan@instructure.com>
2016-01-06 21:21:57 +00:00
Matthew Berns 66a2e7d37d fix ePub export failing if two files have identical names
fixes CNVS-26035

test plan:
- upload a file to the course
- upload the same file to the course in a subfolder
- generate an ePub export

Change-Id: Ia3bc4c21ab11a2a49896c206dc3f5863ee142125
Reviewed-on: https://gerrit.instructure.com/69288
Reviewed-by: Benjamin Porter <bporter@instructure.com>
Tested-by: Jenkins
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Matt Berns <mberns@instructure.com>
2016-01-05 17:09:18 +00:00
John Corrigan 79fe35a084 handle missing media_id for flvs in epub export
fixes CNVS-25933

test plan:
- Add an flv to a course and include is as downloadable content for a
  module that is accessible to the user.
- Add a media comment to the body of an assignment (or any content
  type).
- Export the course (module sorting), logged in as a user that has
  rights to see the module & the content featuring the media comment.
- Observe that the ePub export is successful.
- Observe that the flv is included in the associated files zip file.
- Observe that the media comment is visible inline in the exported
  ePub.


Change-Id: I796a20da4380ee759ffb1e4cde194ba65a7e599f
Reviewed-on: https://gerrit.instructure.com/69021
Reviewed-by: Matt Berns <mberns@instructure.com>
Tested-by: Jenkins
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: John Corrigan <jcorrigan@instructure.com>
2015-12-16 22:19:27 +00:00
John Corrigan f78d944573 try again to protect against missing submission types
fixes CNVS-25459 (again)

test plan:
- Test in beta; not reproducable elsewhere so far.

Change-Id: Iaeb379b7d5f87a721922e8881a8de22ef8579ae7
Reviewed-on: https://gerrit.instructure.com/68231
Tested-by: Jenkins
Reviewed-by: Matt Berns <mberns@instructure.com>
Product-Review: John Corrigan <jcorrigan@instructure.com>
QA-Review: John Corrigan <jcorrigan@instructure.com>
2015-12-09 16:46:29 +00:00
John Corrigan 550e5f4505 enable module-linking; remove links to missing content
fixes CNVS-25487
fixes CNVS-25513

- Updates module conversion to use string `identifier` instead of
  `migration_id` (for sake of consistency with other content types).
- If <a> cannot be resolved, replace with a span and include text
  explaining that the content was a link, but could not be resolved.

test plan:
- Have a course with modules.
- Update a piece of content to include a link to a module.
- Export the ePub; observe that the link to the module works (assuming
  that the module is present as part of the export.

- Also follow repro steps found at CVNS-25513 to make sure that
  exception is no longer thrown.

Change-Id: Iebfae343aebbe2054f79eeaa0fe21892f91f5fe6
Reviewed-on: https://gerrit.instructure.com/68215
Reviewed-by: Matt Berns <mberns@instructure.com>
Tested-by: Jenkins
QA-Review: Michael Hargiss <mhargiss@instructure.com>
Product-Review: Matt Berns <mberns@instructure.com>
2015-12-04 20:49:45 +00:00
Matthew Berns 118051efa6 properly scale video sizes in Azardi
fixes CNVS-25554

test plan:
- export an ePub that has a large windowed video inline
- observe that the video fits the page in Azardi in stead of
  expanding across pages and text

Change-Id: Ide04a8ebec3c17f2f6d5edcbf0c12b6e768f9edc
Reviewed-on: https://gerrit.instructure.com/68229
Reviewed-by: John Corrigan <jcorrigan@instructure.com>
Tested-by: Jenkins
QA-Review: Rajkumar Kethavath <rkethavath@instructure.com>
Product-Review: John Corrigan <jcorrigan@instructure.com>
2015-12-04 19:37:10 +00:00
Matthew Berns 9820fe664f fix unsupported .txt files showing in the ePub
fixes CNVS-25501

test plan:
- upload a pair of .txt files
- one should use an underscore for spacing
- one should use a space for spacing
- both should be replaced in the ePub with the unsupported message

Change-Id: I5b0d6b8550a40e934f2a0973154e8a968b664e2c
Reviewed-on: https://gerrit.instructure.com/68223
Reviewed-by: John Corrigan <jcorrigan@instructure.com>
Tested-by: Jenkins
QA-Review: Rajkumar Kethavath <rkethavath@instructure.com>
Product-Review: John Corrigan <jcorrigan@instructure.com>
2015-12-04 18:03:46 +00:00
John Corrigan c5ffbfd458 ePub: don't always expect submissions types from content export
fixes CNVS-25459

test plan:
- ePub export regression tests

Change-Id: I20c47e086c8141ba5165e32bfd4bdfec113f629c
Reviewed-on: https://gerrit.instructure.com/68026
Reviewed-by: Matt Berns <mberns@instructure.com>
Tested-by: Jenkins
Product-Review: John Corrigan <jcorrigan@instructure.com>
QA-Review: John Corrigan <jcorrigan@instructure.com>
2015-12-02 21:14:35 +00:00
John Corrigan 3a2774cfd8 ePub: don't read file that doesn't exist
fixes CNVS-25458

test plan:
- ePub export regression tests

Change-Id: I87937e47a93e08fbbfd4c23b667ab9384bf63f67
Reviewed-on: https://gerrit.instructure.com/68025
Reviewed-by: Matt Berns <mberns@instructure.com>
Tested-by: Jenkins
Product-Review: John Corrigan <jcorrigan@instructure.com>
QA-Review: John Corrigan <jcorrigan@instructure.com>
2015-12-02 19:12:47 +00:00
Matthew Berns 85af1f321d prevent gray details box from appearing if not needed
closes CNVS-24957

test plan:
- create an assignment, discussion, and quiz with none of the following:
  -Due Date
  -Lock Date
  -Unlock Date
  -Grading Type
  -Points Possible
  -Submission Type
- the gray details box should not appear in the ePub for these items

Change-Id: I26bf7e889ae54fae62653d9c10de6f435e2577be
Reviewed-on: https://gerrit.instructure.com/66926
Tested-by: Jenkins
Reviewed-by: John Corrigan <jcorrigan@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Cosme Salazar <cosme@instructure.com>
2015-11-20 18:39:59 +00:00
Matthew Berns 047609a62c adjust filename for ePub to be more user friendly
closes CNVS-25065

test plan:
- export an ePub that has unsupported media types
- the ePub filename should reflect courseName-Timestamp
- the zip filename should reflect the local timestamp
- timestamp pattern should be 2015-Nov-16_18-22-40
- a course name over 200 chars in length should be truncated to the 200th
  char

Change-Id: I39829d1df050b30544381c7ef20deba5c8c414d1
Reviewed-on: https://gerrit.instructure.com/67205
Reviewed-by: John Corrigan <jcorrigan@instructure.com>
Tested-by: Jenkins
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Cosme Salazar <cosme@instructure.com>
2015-11-18 19:31:15 +00:00
Matthew Berns 4eb43afc2f remove unpublished items; apply rules for locked modules
closes CNVS-24830
closes CNVS-24776

- Adds `module_locked` field to export data for assignments, discussion
  topics, quizzes & wiki pages.
- epub converters updated to exclude module locked content.
- wiki page epub converter updated to exclude unpublished pages (woops).
- module epub converter updated to exclude unpublished modules.

test plan:
- have a course with some unpublished items and locked modules
- for full testing, make 5 locked modules, 2 time locked, 2 prerequisite
  locked, and one locked by both
- have one of the time locked modules have an unlock date that has
  already passed, have the student fulfill the requirement for one of the
  prerequisite locked modules
- export one ePub as a student and one as a teacher
- unpublished items should not appear in either ePub
- modules should all appear as unlocked for the teacher
- modules should be locked as appropriate for the student
- items that should be in the syllabus but in a locked module should still
  be in the syllabus, but not linked to
- items that are in locked modules should have their titles listed in the
  modules content, but the items themselves should not be in the ePub
  and the titles should be plain text instead of hyperlinks
- update settings so that content sorting is enabled.
- export one ePub as a student.
- content part of a locked module should not be present in the ePub.

- have a course with unpublished modules.
- export course with module-sorting enabled (the default).
- observe that unpublished modules are not present.

test plan for changes to content exporter:
- using the same course as above, export the course as a course
  cartridge.
- start a new course and import the above course into it.
- observe that all modules are present as expected.

Change-Id: I99394ae4bca251875c7a0cb614c3b1530e1c0f9b
Reviewed-on: https://gerrit.instructure.com/66600
Tested-by: Jenkins
QA-Review: Michael Hargiss <mhargiss@instructure.com>
Reviewed-by: Matt Berns <mberns@instructure.com>
Product-Review: Cosme Salazar <cosme@instructure.com>
Reviewed-by: John Corrigan <jcorrigan@instructure.com>
2015-11-18 14:51:51 +00:00
Matthew Berns a8b3fe9df6 add syllabus and announcements to ePub TOC
closes CNVS-25017

test plan:
- export an ePub
- the TOC should contain links to announcements and the syllabus
- the syllabus page should have a link back to the TOC
- the index page of announcements should have a link back to the TOC
- individual announcements should have a link back to the announcements
  index and the TOC
- the TOC should state either "Course Modules" or "Course Content"
  depending on sorting style following the Syllabus and Announcements links

Change-Id: I81c1aa891aabf2fb1d1e486e14c5a3db1cba4e06
Reviewed-on: https://gerrit.instructure.com/67057
Tested-by: Jenkins
Reviewed-by: John Corrigan <jcorrigan@instructure.com>
QA-Review: Landon Holmstead <lholmstead@instructure.com>
Product-Review: Cosme Salazar <cosme@instructure.com>
2015-11-16 21:45:10 +00:00
Matthew Berns 0759e795cb provide explicit max sizes to ePub images
closes CNVS-24952

test plan:
- export an ePub in a course that has a large sized image embedded in
  an item that will appear in the ePub content
- the image should not flow off the page in Azardi or any other reader
- the image should maintain its aspect ratio and not become stretched/distorted

Change-Id: I329022de13334947a071a1938ad26f7577320c36
Reviewed-on: https://gerrit.instructure.com/66905
Tested-by: Jenkins
Reviewed-by: John Corrigan <jcorrigan@instructure.com>
QA-Review: Landon Holmstead <lholmstead@instructure.com>
Product-Review: Matt Berns <mberns@instructure.com>
2015-11-11 21:47:56 +00:00
Matthew Berns c0a8ec08de add styling to ePub
closes CNVS-23953

(note: styling is not consistent, iBooks for example overrides several
elements with its own styling set in the user's preferences. For that
reason it's probably better to test this in Calibre)

test plan:
- export an ePub
- all text should be sans-serif
- main headers ("Table of Contents", "Syllabus", etc.) should be white
  text with a blue background
- subheaders should be in a font larger than standard text
- syllabus should be organized by date with bold text
- hyperlinks should be in the same shade of green as canvas links
- assignment/quiz details (due date, points, etc) should be contained
  inside a light gray box with slightly darker border

Change-Id: I3b2c4254385a916e78f337790ac5dbbb3110a6d7
Reviewed-on: https://gerrit.instructure.com/66723
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Tested-by: Jenkins
Reviewed-by: John Corrigan <jcorrigan@instructure.com>
Product-Review: Cosme Salazar <cosme@instructure.com>
2015-11-10 17:33:16 +00:00
Matthew Berns 19d5f54938 add main navigation table of contents to ePub
refs CNVS-21803

test plan:
- generate an ePub from a course
- the ePub should have a main navigation TOC
- TOC sections should mirror the TOC found in the spine of the ePub
- TOC section headers should link to their respecive section
- TOC sections should contain links to their respective items
- items in TOC sections should link to their respective locations
- TOC should only include items in modules for module sorting
- chapters in ePub should contain link back to TOC
- items in ePub should contain link back to their respective section,
  as well as a link back to main TOC

Change-Id: I5770485a574d8967f2218643421918219c091709
Reviewed-on: https://gerrit.instructure.com/64821
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Reviewed-by: John Corrigan <jcorrigan@instructure.com>
Tested-by: Jenkins
Product-Review: John Corrigan <jcorrigan@instructure.com>
2015-11-06 21:20:56 +00:00
John Corrigan d5797f967b handle files added directly to the item list of a module
fixes CNVS-23798

test plan:
- Have a course with content separated into modules, including specific
  files.
- Confirm that course is configured to sort by module (default
  behavior).
- Export course as an ePub at `/epub_exports`.
- Observe that file names are included as part of the module list.
- Click the link to get to the file template.
- Observe that the file can be viewed by clicking on the tile name.

Change-Id: I28c6afeba668714ed284cc5437fb06d522b4f855
Reviewed-on: https://gerrit.instructure.com/65988
Tested-by: Jenkins
Reviewed-by: Matt Berns <mberns@instructure.com>
Product-Review: John Corrigan <jcorrigan@instructure.com>
QA-Review: John Corrigan <jcorrigan@instructure.com>
2015-11-06 16:03:38 +00:00
Matthew Berns 6ef7507513 separate announcements from discussion in ePub
closes CNVS-24761

test plan:
- create an ePub from a course that has announcements
- there should be an announcements section following the syllabus
- this section should exist regardless of sorting method
- if no announcements exist, the announcements section should state
  there are none for the course

Change-Id: Id146eca5b4f62c914375beb845cd3d2e173ede22
Reviewed-on: https://gerrit.instructure.com/66396
Reviewed-by: John Corrigan <jcorrigan@instructure.com>
Tested-by: Jenkins
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Cosme Salazar <cosme@instructure.com>
2015-11-05 19:49:21 +00:00
John Corrigan 0c55c060f0 enable inter-document ePub linking for canvas objects
closes CNVS-21803

- Adds CC::Exporter::Epub::Converters::ObjectPathConverter module.
- Adds #convert_placeholder_paths_from_string!, a convenience method
  that converts canvas object links & media links.

test plan:
- Have a course that has canvas object links from one type of canvas
  object to another. For example, assignments, discussion topics &
  quizzes with links to wiki pages (or each other).
- Generate an ePub for this course.
- Observe that links to other types of canvas objects work within the
  generated ePub.

Change-Id: Ia25c57a95d9383ab0cacbad9fea5439195472425
Reviewed-on: https://gerrit.instructure.com/63810
Tested-by: Jenkins
Reviewed-by: Matt Berns <mberns@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Cosme Salazar <cosme@instructure.com>
2015-11-04 21:33:34 +00:00
John Corrigan 124d764c21 don't try to include files that don't exist
fixes CNVS-24662

This should be an edge case, but we should not try to add files that do
not exist to either the ePub book or the unsupported files directory.

test plan:
- Have a course with assignments (or another canvas object) that
  reference files that do not exist as part of the course.
- Export the course as an ePub.
- Observe that the ePub export completes.
- Observe that the messaging in the ePub is similar to when the file is
  not supported.

Change-Id: Ic24e91e99fe53ddcf8389ba0d58243aad1ef7dea
Reviewed-on: https://gerrit.instructure.com/66233
Tested-by: Jenkins
Reviewed-by: Matt Berns <mberns@instructure.com>
QA-Review: Michael Hargiss <mhargiss@instructure.com>
Product-Review: John Corrigan <jcorrigan@instructure.com>
2015-11-02 20:03:13 +00:00
Matthew Berns c17e8d7131 add quizzes to ePub syllabus
refs CNVS-21803

test plan:
- generate an ePub using module type sorting and content type sorting
- all quizzes should show up in the syllabus for content type sorting
- only quizzes for their respective modules should show up on module sorting

Change-Id: I359594b1ce3c565741acde9bbd2b1e87c2ee74b0
Reviewed-on: https://gerrit.instructure.com/66209
Reviewed-by: John Corrigan <jcorrigan@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Tested-by: Jenkins
Product-Review: Matt Berns <mberns@instructure.com>
2015-10-30 23:16:20 +00:00
Matthew Berns a9819c1fbb remove resource_type from converted resources for ePub
refs CNVS-23798

test plan:
- ensure that links still work properly for module and content sorting
- there should be no other visual changes for end users

Change-Id: I7400fff729aecf3739d073544c66c090b7120dd9
Reviewed-on: https://gerrit.instructure.com/66121
Reviewed-by: John Corrigan <jcorrigan@instructure.com>
Tested-by: Jenkins
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Matt Berns <mberns@instructure.com>
2015-10-30 17:37:07 +00:00
John Corrigan 8d4d967341 add zip_attachment to EpubExport
fixes CNVS-24178

- Updates FilesConverter so that it returns both files that will be
  displayed in the ePub and the files that are unsupported.
- Adds CC::Exporters::Epub::FilesDirectory class, which accepts a
  collection of file objects and adds them to a zip file.
- Updates UI so that a separate download link is present for the zip of
  unsupported files.
- Adds support to MIME::Types library to be able identify ePubs.
- Updates EpubExport to have many attachments; one epub & one zip.
- Updates process of creating attachments related to EpubExports so that
  the content_type value is properly set.

test plan:
- Have a course that contains files that are not supported by ePub, such
  as pdf, doc or xls.
- Navigate to `/epub_exports`.
- Click the button to generate an ePub for the given course.
- Observe that, after the successful generation of the course, two
  download links appear: one for the ePub, one for additional files.

Change-Id: I2f321362bc5ed23f8b28334395f8969c9d90a5de
Reviewed-on: https://gerrit.instructure.com/65753
Tested-by: Jenkins
Reviewed-by: Matt Berns <mberns@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Cosme Salazar <cosme@instructure.com>
2015-10-29 20:23:00 +00:00
Matthew Berns 5510947248 separate module ePub generation into separate xhtml files
refs CNVS-21803

this is primarily an organization change on the back end, there is
very little change to how it should look/work for end users.

test plan:
- generate an ePub using content type sorting and module sorting
  to ensure no regressions
- content type sorting should look exactly the same
- for module sorting, instead of having a "Course Modules" page at the
  beginning with links to the modules, the titles of the modules
  should just be on the spine/navigation of the ePub

Change-Id: I177691f3435440e9d2b5f8ef3185af941059b809
Reviewed-on: https://gerrit.instructure.com/65650
Tested-by: Jenkins
Reviewed-by: John Corrigan <jcorrigan@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Matt Berns <mberns@instructure.com>
2015-10-28 17:39:21 +00:00
Matthew Berns 024e4ab472 add syllabus to ePub
closes CNVS-23623

- adds a syllabus to the beginning of the ePub

test plan:
- generate two ePubs for a course that has items in modules, one using the
  default module sorting, the other using content type sorting
- the syllabus should contain the title and due date of graded assignments
  and quizzes in chronological order
- items with no due dates should appear last
- when sorting by module, only graded assignments and quizzes that are in
  modules should show up
- syllabus entries should link to their respective assignment or quiz

Change-Id: I9f9fb97f03e9bcaaa874681ab289ba9c70a1f4ac
Reviewed-on: https://gerrit.instructure.com/64552
Reviewed-by: John Corrigan <jcorrigan@instructure.com>
Tested-by: Jenkins
QA-Review: Landon Holmstead <lholmstead@instructure.com>
Product-Review: Cosme Salazar <cosme@instructure.com>
2015-10-28 17:39:12 +00:00
John Corrigan c3e48f62e1 display inline flv media in ePubs
refs CNVS-21799

- Fetch transcoded mp4 in place of exported flvs.
- Reference mp4s in place of flvs in generated xhtml.
- Do not include in files array files that should not be uploaded to the
  ePub.
- Remove from xhtml references to files that are not included in the
  ePub.

test plan:
- Have a course with an assignment description, quiz description,
  discussion topic description, or wiki page body that contains a
  recorded video comment.
- Export course as an ePub.
- Observe that the video displays inline.

- Have a course with unsupported media (the official _supported_ list
  is: 'jpg', 'gif', 'png', 'mp4', 'm4v', 'flv', 'mp3').
- Export an ePub.
- Observe that the unsupported file is not part of the package (using
  something like Calibre's book editor).
- Observe that the reference to the media has been replaced with an
  explanation of its absence.

Change-Id: I9f5eab8fa1c86e719d69e4ae42451e795ee4b471
Reviewed-on: https://gerrit.instructure.com/64365
Reviewed-by: Matt Berns <mberns@instructure.com>
Tested-by: Jenkins
QA-Review: Landon Holmstead <lholmstead@instructure.com>
Product-Review: Cosme Salazar <cosme@instructure.com>
2015-10-27 15:36:06 +00:00
Matthew Berns fcb2506d39 sort by content if no course modules exist
closes CNVS-23800

test plan
- export a course with no modules
- create an ePub, which would normally result in module sorting by default
- the generated ePub should be sorted by content

Change-Id: I2e49b7cffd4c3f4bef12357c24814a0c0f837c9d
Reviewed-on: https://gerrit.instructure.com/64665
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Cosme Salazar <cosme@instructure.com>
Tested-by: Jenkins
Reviewed-by: John Corrigan <jcorrigan@instructure.com>
2015-10-21 15:49:31 +00:00
John Corrigan adad2fc64f exportable considers sort setting; EpubExport hooked up to Exportable
refs CNVS-21794
closes CNVS-21802

- Adds CC::Exporter::Epub::Exportable#sort_by_content_type?, which can
  be overridden by classes that `include` the module to point to where
  the setting can be found.
- Update CC::Exporter::Epub::Exportable#convert_to_epub to pass
  `sort_by_content_type?` to CC::Exporter::Epub::Exporter.new.
- Update EpubExport to include CC::Exporter::Epub::Exportable, and
  override / add to instance methods.

test plan:
- Navigate to `/epub_exports`.
- Observe a list of courses that are active & user is enrolled in.
- Click on the Generate button.
- Observe that info about the state of the export and the timestamp are
  added to the middle of the row.
- Observe that a progress bar is displayed while the export is in
  progress.
- Observe that upon completion, the progress bar is replaced by two
  button / links: Download & Regenerate.
- Click on the download link.
- Observe that an epub file is downloaded and can be opened in an
  eReader.
- Observe that the Regenerate button triggers the process all over
  again.

Change-Id: Ib42c2d2623c3ccd394105cdf0e3809b96c8a2e60
Reviewed-on: https://gerrit.instructure.com/63469
Reviewed-by: Matt Berns <mberns@instructure.com>
Tested-by: Jenkins
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Cosme Salazar <cosme@instructure.com>
2015-10-13 16:52:38 +00:00
John Corrigan 1bcc778573 changes based on epubcheck and iTMSTransporter validators
refs CNVS-20157

- Explicitly add media type when adding media to the ePub (gepub only
  tries to figure it out itself for images).
- Remove empty <a> ids added by tinymce.
- Add fallback text for <audio> & <video> tags for readers that don’t
  support media playback.
- Be more explicit about escaping / unescaping file paths.
- Use identifiers for url anchors. 

test plan:
- Test that epub generation works, nothing explicit beyond that.

Change-Id: I646866030420f570f7edbe7dd2ea87737e7129f6
Reviewed-on: https://gerrit.instructure.com/64039
Reviewed-by: Matt Berns <mberns@instructure.com>
Tested-by: Jenkins
Product-Review: John Corrigan <jcorrigan@instructure.com>
QA-Review: John Corrigan <jcorrigan@instructure.com>
2015-10-09 19:48:06 +00:00
John Corrigan 3889ab2b67 render inline media in player
refs CNVS-21798

Audio & video content that is uploaded and displayed as part of the body
of an assignment, discussion topic, wiki page or quiz description is now
viewable in an ePub.

test plan:
- For an existing course, uploaded and display inline audio or video
  content (mp3 or mp4) in assignment descriptions, discussion topic
  descriptions, wiki page bodies, and quiz descriptions.
- Export the content as an epub.
- Observe that inline audio & video is playable in the epub.

Change-Id: Ia5e1a892615152205dfebf1a7a397e602cfab9d5
Reviewed-on: https://gerrit.instructure.com/64234
Reviewed-by: Cameron Sutter <csutter@instructure.com>
Tested-by: Jenkins
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Cosme Salazar <cosme@instructure.com>
2015-10-08 22:34:32 +00:00
John Corrigan c825ffc544 render images, audio and video in epubs
fixes CNVS-21798

Summary of changes:
- Add files to epub as it's being built.
- Update links to image files to be path specific to epub.
- Update links to audio files to be epub-compatible `<audio>` tags.
- Update links to video files to be epub-compatible `<video>` tags.

test plan (requires console access):
- Prereq: have a course with uploaded images, audio and video files, and
  reference that media in assignment bodies.
- Make sure you have at least one completed content export in the db
  (can be triggered via console or via the content export UI).
- open rails console
- run the following commands:
- - `ContentExport.include(CC::Exporter::Epub::Exportable)`
- - `ContentExport.last.convert_to_epub`
- This will output a path to the generated epub, something like:
"/var/folders/7g/w8y0n7_j18v65h93xhmm9z4hxzj3r2/T/2052fbd0-860d-4114-9969-0adc7f5ecb79.Name
of Course.epub"
- Open up the folder of the file (assuming you're on Mac OSX) like so:
`open -a finder /var/folders/7g/w8y0n7_j18v65h93xhmm9z4hxzj3r2/T`.
- Find the file in that directory (in this case the file name is
  2052fbd0-860d-4114-9969-0adc7f5ecb79.Name of Course.epub
- Observe that images displayed inline work.
- Observe that links to images work.
- Observe that links to audio have been converted to audio players, and
  that the controls work.
- Observe that links to video have been converted to video players, and
  that the controls work.
- Repeat steps for discussion topics, wiki pages & quiz descriptions.

Change-Id: I5a48c3300ccffc00230d94137a93731394ef0ebb
Reviewed-on: https://gerrit.instructure.com/62842
Tested-by: Jenkins
Reviewed-by: Matt Berns <mberns@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Cosme Salazar <cosme@instructure.com>
2015-10-07 17:20:28 +00:00
Matthew Berns bb7d6557eb add module sorting to epub
closes CNVS-21801

this adds module sorting functionality to ePub generation

to generate via console
- already have an .imscc file from an exported course
- in rails console
  ContentExport.include(CC::Exporter::Epub::Exportable)
  ContentExport.last.convert_to_epub  (for module sorting)
  ContentExport.last.convert_to_epub({sort_by_content: true}) (for content sorting)

Change-Id: Ie82db12a551ff338d616162211fa7bafcd9f29fe
Reviewed-on: https://gerrit.instructure.com/62681
Tested-by: Jenkins
Reviewed-by: John Corrigan <jcorrigan@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Cosme Salazar <cosme@instructure.com>
2015-10-01 19:59:17 +00:00
Matthew Berns ccb23e8534 adds basic epub generation backend
closes CNVS-22222
closes CNVS-21796
refs CNVS-21800
refs CNVS-21803

test plan (requires console access):
- Make sure you have at least one completed content export in the db
  (can be triggered via console or via the content export UI).
- open rails console
- run the following commands:
- - `ContentExport.include(CC::Exporter::Epub::Exportable)`
- - `ContentExport.first.convert_to_epub`
- This will output a path to the generated epub, something like:
"/var/folders/7g/w8y0n7_j18v65h93xhmm9z4hxzj3r2/T/2052fbd0-860d-4114-9969-0adc7f5ecb79.Name
of Course.epub"
- Open up the folder of the file (assuming you're on Mac OSX) like so:
`open -a finder /var/folders/7g/w8y0n7_j18v65h93xhmm9z4hxzj3r2/T`.
- Find the file in that directory (in this case the file name is
  2052fbd0-860d-4114-9969-0adc7f5ecb79.Name of Course.epub

Change-Id: I37b73fac329bc0fbd5e85a9427e9cce58d05d6db
Reviewed-on: https://gerrit.instructure.com/60702
Reviewed-by: Cameron Sutter <csutter@instructure.com>
Tested-by: Jenkins
QA-Review: Matt Berns <mberns@instructure.com>
Tested-by: Matt Berns <mberns@instructure.com>
Product-Review: Matt Berns <mberns@instructure.com>
2015-09-11 16:50:02 +00:00