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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>