Commit Graph

37 Commits

Author SHA1 Message Date
James Williams 3181ac8b11 improve cc 1.3 support
test plan:
* import the test assignment fixtures as a common cartridge file
* there should be an assignment in the course

* also test import of flat manifest xml files

closes #CNVS-5906 #CNVS-13219

Change-Id: I0b765ed0d140516f78a5f4fb5dbe9b81ac77ecd4
Reviewed-on: https://gerrit.instructure.com/35394
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2014-05-23 21:11:59 +00:00
James Williams 2ba4531f73 migration refactor: account question banks import
test plan:
* course migration regressions (canvas cc, course copy)

* in addition:
 use the content migrations api to queue a content migration
 for an account ("/accounts/:account_id/content_migrations")
 to import a qti/cc package.
* confirm that the question banks from the package
 that would have been normally imported into a course are now
 imported into the account

closes #CNVS-12529

Change-Id: I2ef306341d2f7defe03c63a981679a3987f1aaa0
Reviewed-on: https://gerrit.instructure.com/34303
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2014-05-12 16:30:10 +00:00
James Williams 6251e981fe treat "//url" as an absolute url in imported html converter
test plan:
* import that package reference in the ticket
* should not have 1000+ missing link warnings

fixes #CNVS-12911

Change-Id: Icea97472635a93b22bac0c3f571496ffe2bcf458
Reviewed-on: https://gerrit.instructure.com/34465
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2014-05-08 12:12:44 +00:00
James Williams 208cfc7664 fix migration of wiki urls with anchors
test plan:
* import the package referenced in the ticket
* the link on the wiki front page pointing to
 "Header 3 on Index page (directly)" should work

fixes #CNVS-12812

Change-Id: I2d532442d49fd62efe3a333c215a5349b1629bc7
Reviewed-on: https://gerrit.instructure.com/34192
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2014-05-06 18:45:59 +00:00
James Williams fbb05045c1 enable domain substitutions in imported urls
test plan:
* create a course with html content, with links pointing to a given
domain (e.g. "http://www.example.com/somewhere")

* in the rails console, manually configure the account settings
as follows, (replacing -COURSEID- with the id of the course):

 a = Course.find(-COURSEID-).root_account
 h1 = {"http://www.example.com" => "https://www.not-example.com"}
 h2 = {:domain_substitution_map => h1}
 a.settings[:default_migration_settings] = h2
 a.save!

* copy the course

* the links should all be translated to the new domain
 (e.g. "https://www.not-example.com")

fixes #CNVS-12325

Change-Id: I0ac2ddf628303ae760995e44c72e2c90a836f966
Reviewed-on: https://gerrit.instructure.com/33472
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-04-17 17:24:45 +00:00
Bracken Mosbacker 86a751f493 don't change anchor references to relative urls on import
Test Plan:
 * import a common cartridge package with html that has a
   <a href="#something">hey</a> in it
 * That href value should not change after imported

refs PLAT-433

Change-Id: I84229c5f587020ebc4279baf9bb7138db8c79223
Reviewed-on: https://gerrit.instructure.com/32152
Reviewed-by: Nathan Mills <nathanm@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
2014-04-04 21:20:00 +00:00
Mark Severson f1365969fb fix wiki links in course copy/migrations
test plan:
 - with draft state enabled
 * create a wiki page
   - use the sidebar to add a link to another wiki page
 * save the page
 * edit the page
   - html view should show the href as ../pages/.. not ../wiki/..
   - copy the link, changing the href to be ../wiki/..
 * save the page
 * copy the course
 * navigate to the copied wiki page
   - both links should point to the page in the new course

fixes CNVS-11443

Change-Id: Ib7f8b175ac6d894a9bfa651f8536b7cd48b60aac
Reviewed-on: https://gerrit.instructure.com/30780
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
2014-03-04 00:17:56 +00:00
Cody Cutrer 031a0341b4 avoid dynamic finders on an assocition with an include
the dynamic finder on the association causes scoping to be called
before delegating the dynamic finder to the class, which works
until the preloader tries to load the owning class, and BOOM,
tries to preload itself

fixes at least one spec for rails 3

Change-Id: Ia22b31a013cb6ac984eb77ca29406372538ea57f
Reviewed-on: https://gerrit.instructure.com/30393
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2014-02-21 12:52:39 +00:00
Raphael Weiner 6ae716da73 extracted html text helper methods into gem
test plan:
  * run specs

Change-Id: I8bd463396aee14853bdcf552eef144a509ffb62a
Reviewed-on: https://gerrit.instructure.com/29613
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Product-Review: Zach Pendleton <zachp@instructure.com>
QA-Review: Zach Pendleton <zachp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-02-07 20:11:19 +00:00
James Williams b2831bc66d add timeout for bulk media upload on import
closes #CNVS-7659

Change-Id: Iab61b5391e6d63ee39e2aeffe333b78f770af073
Reviewed-on: https://gerrit.instructure.com/23561
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Bracken Mosbacker <bracken@instructure.com>
2013-08-23 19:11:27 +00:00
James Williams ef90ab60e2 preserve links to other content in quizzes on course copy
test plan:
* create a quiz that includes a link to other content
in the course, such as an assignment or a wiki page
* copy the course
* the links should be copied correctly

fixes #CNVS-2303

Change-Id: Ie5eb41c9193bad4d3786d2cd312b31a3be6c4ddf
Reviewed-on: https://gerrit.instructure.com/21600
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2013-06-24 18:54:31 +00:00
James Williams 8b872ff1aa fix relative urls with parameters in imported html
in particular, fixes a problem where having any parameter
in import html content would cause "/preview" to not
be appended

test plan:
 * import the package referenced in the ticket
 * the wiki page 'coverslip smears' should have
functioning images

fixes #CNVS-5230

Change-Id: Ifd45efd841fa94f54d0478d040709d32b6b5fc5e
Reviewed-on: https://gerrit.instructure.com/19741
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-04-19 21:03:58 +00:00
James Williams 21d1788f22 add migration warnings for missing references in html content
adds migration warnings when links and other references point
to missing or unknown internal content

test plan:
* upload a content migration with missing relative links
 (an example is attached in the ticket)
* import all the content
* view previous migrations for the course
 (at "/courses/:id/imports/list")
* confirm that warning messages are shown
* the ui in in progress, but the warnings should
 have links associated with them that point to the
 content with missing links. to see them, use the
 migration issues API

closes #CNVS-134

Change-Id: I1d0a9217fe0c1678968410be8b2eba5b990b8305
Reviewed-on: https://gerrit.instructure.com/19367
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-04-11 18:28:59 +00:00
Bracken Mosbacker a73818af38 don't try to convert html value attributes as urls
all value attributes were being treated as urls when importing
into canvas and were thus getting bad values. This makes
it so that only ones marked as actual urls are updated

Test Plan:
 * import package associated with this ticket
 * Look at the html of the mentioned quiz question
 * the param tags for 'controls', 'controller', etc. should not look like urls

closes #11466

Change-Id: Ic2dd5648285432c775d7b5745c02e6f2e79834ff
Reviewed-on: https://gerrit.instructure.com/14695
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
2012-11-06 19:17:28 -07:00
Bracken Mosbacker 261c37135f correctly find quiz file references in webct data
This fixes two cases that were missed before. Sometimes the
webct relative resource id starts with a '/' and sometimes
not, this accounts for that.

Also, finding a file by a relative path was trying to find it
by the URI escaped version instead of the unescaped one. And
sometimes webct data has differently-cased file paths in the
QTI, so this tries finding files in all lower case.

Test Plan:
 * Import a webct course that has files in quizzes
 * All the images should import correctly into canvas. (meaning the url should be like /courses/:id/files/:id/preview)

closes #9520

Change-Id: I110c7f1968ae5a050fbd6b4e21332e8168481a15
Reviewed-on: https://gerrit.instructure.com/12474
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-07-25 16:40:30 -06:00
Bracken Mosbacker 549e965ab1 correctly copy media urls if media id is available
Some href values are incorrect for media comments in
existing data. When those links are copied the import
code tried to find the file at the href value. Since the
file doesn't exist it strips out the media comment id even
though that is still valid. This commit will instead grab
the media id and make the link copy correctly.

Test Plan:
 * Create a media comment
 * Edit the html of the media comment and change the href in it to just "%24IMS_CC_FILEBASE%24/#"
 * Copy the course
 * In the new course the media comment should work correctly and the href should be "media_objects/#{the_id}"

closes #9471

Change-Id: Ieae7e65a22099afab32a3a1af91e3e227ef27250
Reviewed-on: https://gerrit.instructure.com/12360
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-07-19 13:49:18 -06:00
Zach Pendleton d397bc98bb interpolate links to module items on course copy. fixes #8754
test plan:
  * create a course with a module that has an external tool link in it;
  * link to the external tool from a wiki page (you'll need to do this
    manually by copying the link from the modules page and taking the
    path);
  * create a new course and copy the first course's content into it;
  * verify that the link exists in the wiki page and properly links to
    the external tool.

Change-Id: Ia7a3169ba1deb9e42955b658a3bf26203d311e5d
Reviewed-on: https://gerrit.instructure.com/10997
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-05-24 15:02:04 -06:00
Bracken Mosbacker ee52293fc2 don't try to fix relative urls on import step of course copy
Test Plan:
 * In a wiki page create an image link to "/images/preview.png"
 * copy the course
 * the link to that image should not be broken

closes #8503 #8493

Change-Id: Ib0ed374ac573a826d122d1d9adaa3c3dacc3fda2
Reviewed-on: https://gerrit.instructure.com/10617
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-05-09 10:31:10 -06:00
Bracken Mosbacker bdf9e32fb4 properly copy links to equation images
Test Plan:
 * Create a text area with an equation in it from the default
equation editor.
 * copy the course
 * the equation should still be there in the new course

closes #8237

Change-Id: I9238f8e0a305ee95963e0774651f45624d50e459
Reviewed-on: https://gerrit.instructure.com/10335
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-04-25 15:24:44 -06:00
Bracken Mosbacker 94cd9e34c9 copy all html properties for quizzes
Test Plan:
 * Copy quizzes that have html in the answers
 * The resultant quizzes should have the html

closes #8236

Change-Id: I18efdca6e915aeab2a8d117b49324591289ef824
Reviewed-on: https://gerrit.instructure.com/10314
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-04-25 15:23:07 -06:00
Bracken Mosbacker 3b4ad55f74 fix copying root-level course files and media object references
File in the root folder of a course we being copied into
and extra folder called "course files" in the destination
course. And media object references linking to non-existant
.flv files in the course when copied.

Test Plan:
 * Create some files in the root of a course
 * Create a media comment on a wiki page or the course syllabus
 * Copy the course
 * The files should be in the root in the new course and the media comment should work

closes #8299

Change-Id: I505007d195c962eb249975f7e6d4afc9733fb59e
Reviewed-on: https://gerrit.instructure.com/10254
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-04-24 09:35:52 -06:00
Bracken Mosbacker 628e32b18a don't flag urls starting with '/' as not relative
When importing, urls starting with '/' were flagged as not
relative. This commit changes the relative url detection
to use the URI library. There are also a lot of unit tests
added for the ImportedHtmlConverter.

Test Plan:
 * Import a package that has a relative mage url starting with '/' on a wiki page
 * The image should render when the import is complete

closes #6813

Change-Id: I008bb603b1abb53ae8753b44413cac8b9b1f4245
Reviewed-on: https://gerrit.instructure.com/8022
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2012-01-12 12:52:24 -07:00
Zach Wily b3a6deadc2 Revert "add id to wiki page urls."
We've decided to approach this another way. See redmine #2635.

This reverts commit d9d5715b2b.

Change-Id: Ib497319994294a4fc0fe0da47acbde692e00fd91
Reviewed-on: https://gerrit.instructure.com/7961
Tested-by: Zach Wily <zach@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-01-10 10:45:48 -07:00
Zach Pendleton d9d5715b2b add id to wiki page urls. fixes #2635.
prepend all wiki page urls with the object id to ensure that,
even if the title/url change, the record can still be retrieved
with the id.

test plan:
1. create a new wiki page;
2. in the body of another wiki page, link to the newly created
   wiki page;
3. change the title of the newly created wiki page;
4. verify that the link to the new wiki page still works (even
   though the title has changed).

Change-Id: I4a6ab2dea3e156abe88d022ae5f17cd7a0fb3924
Reviewed-on: https://gerrit.instructure.com/6792
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
2011-12-01 12:22:16 -07:00
Bracken Mosbacker 8668f450fe recoginize urls with a '+' for spaces on html import
this also makes it so that urls in html are exported with
'%20' instead of '+' from now on

refs #4903

Change-Id: I8982b7e38a151101e33a7ea33301bff64f56079d
Reviewed-on: https://gerrit.instructure.com/4710
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-07-18 10:55:13 -06:00
Bracken Mosbacker e7ed1c366b replace relative paths in qti from other systems
This fixes another relative url format for another system
where the migration_id of the file is referenced instead
of a relative path to the file

closes #4605

Change-Id: I08852c2bb207a7065c854e1a120fb9ba52c7c7c8
Reviewed-on: https://gerrit.instructure.com/3867
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2011-06-01 09:24:03 -06:00
Brian Palmer 276a906ee2 handle bulk media upload failures on import more gracefully, refs #4395
Change-Id: I0e5723879bcda114f6ad7cc34ee4ca1104136b97
Reviewed-on: https://gerrit.instructure.com/3333
Reviewed-by: Zach Wily <zach@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-04-29 09:31:36 -06:00
Cody Cutrer 98e68f9e4b export/import modules links. closes #4313
Change-Id: Ib4d789cf69a8492de958e2e2b68a3c85bf2fe8b5
Reviewed-on: https://gerrit.instructure.com/3254
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-04-25 16:21:47 -06:00
Brian Palmer d104ac86fa fix import filenames that have been escaped going through nokogiri, refs #4321
Change-Id: I9468482db75d628e9b3e75cbd307d83f990adcfb
Reviewed-on: https://gerrit.instructure.com/3250
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-04-25 15:50:31 -06:00
Brian Palmer f5c9ce98eb preserve extra file url params across import/export, closes #4321
Change-Id: Iab044664bc62a60dea26f7e65328e744e63e57a8
Reviewed-on: https://gerrit.instructure.com/3247
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
2011-04-25 12:50:21 -06:00
Brian Palmer 516d3a4495 export/import kaltura media content with cc exports/imports, closes #4256
Change-Id: I4d92cdedd2e304709886713977d91e33b162d232
Reviewed-on: https://gerrit.instructure.com/3232
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-04-23 23:51:01 -06:00
Zach Wily 359613861d look up the entire filename when converting URLs on import
Before we were stopping at ['"], but that was unecessary (and wrong) because
what we have is the actual, parsed attribute value. This also means we didn't
get a full filename if it had a quote in it.

Change-Id: Ib4b44a2bdf3f7dc0d2f216415c1fcbfd9ac3e126
Reviewed-on: https://gerrit.instructure.com/3178
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-04-21 14:33:51 -06:00
Jon Jensen 8c2d97f436 allow html answers for multiple-choice/multiple-answers, closes #4206
Change-Id: I49626c4d2f24ac73336dba006f01fdc83792eda2
Reviewed-on: https://gerrit.instructure.com/3155
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Reviewed-by: Brian Whitmer <brian@instructure.com>
2011-04-21 13:23:23 -06:00
Bracken Mosbacker 9a93fd4f21 try to find attachment id for relative urls on import
closes #4281

Change-Id: If0a6fb5dc2cd55e103e3b9897c82eb42ea01e43e
Reviewed-on: https://gerrit.instructure.com/3142
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-04-19 08:10:47 -06:00
Bracken Mosbacker bb8bc24cd7 start canvas cartridge importing
started the framework for importing the canvas flavored
common cartridge packages. There is also some minor
refactoring of the export step to allow for easy testing
of both exporting and importing

course settings, assignment groups, and external tools
are imported and tested with this commit

refs #3396

Change-Id: I4e8a2ebfc9df7e31f8859b189fea23f9584d7ef4
Reviewed-on: https://gerrit.instructure.com/3042
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-04-18 08:09:16 -06:00
Bracken Mosbacker 9168dfbdec urls from external migrations are already escaped
The text helper was double escaping urls from external migrations

refs #3667

Change-Id: Ica89af6fffab47ec1fee82167acc1d34551e63e4
Reviewed-on: https://gerrit.instructure.com/2232
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Whitmer <brian@instructure.com>
2011-02-11 10:28:51 -07:00
Brian Whitmer 8b8173dcc9 Initial commit.
closes #6988138
2011-01-31 18:57:29 -07:00