Files weren't being replaced if they had a filename different
from their display_name.
The content_tags for modules are cleared before they are
imported so that only the items aren't duplicated.
Test Plan:
* Import a package twice
* The modules should be correct and not have 2 items for each item
* The files should also not be duplicated
closes#10405
Change-Id: I3cb15c2530734185675a2b8bb9017bdf6ac35202
Reviewed-on: https://gerrit.instructure.com/13695
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
no user visible behavior change
test plan:
* make sure existing wiki contents haven't disappeared
* make sure a new course gets a wiki that functions correctly
* make sure wiki rss feeds are still functional
* try to access the wiki from a new course from multiple requests
simultaneously; it should get a single wiki that's not conflated
Change-Id: I339b56c39d7868dbdec3df4007291a429272b1cf
Reviewed-on: https://gerrit.instructure.com/12432
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
closes#8769
An item can be added to multiple modules, or even the same module more
than once. This is especially useful for attachment items, but is also
useful for allowing multiple paths through a course, with say an
assignment in two different modules and the user only has to complete
one of the two modules.
test plan:
For an item in only one module, verify that the module navigation still
appears if you go straight to that item's page, without going through
the modules page.
Add an item to more than one module. If you visit that item from the
modules page, you'll see the right nav depending on which instance of
the item you clicked on. If you visit the item directly without going
through the modules page, you'll see no nav.
Lock one instance of the item by adding a prerequisite, but leave the
other unlocked. You can still see the item as a student.
Lock all instances of the item with prerequisites. The item will now be
locked and you can't see it as a student.
Add completion requirements to the item, such as a minimum score on a
quiz. Make the requirements different -- 3 points in one instance and 5
in the other, for instance. Verify that if you get 3 points on the quiz,
one item is marked as completed but the other isn't, as expected.
Rename the item. Verify that all instances of it in modules get renamed.
Change-Id: I4f1b2f6f033062ec47ac34fe5eb973a950c17b0c
Reviewed-on: https://gerrit.instructure.com/11671
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
fixes#8648
test plan:
* create a course with an external tool link in a module
that is set to open in a new tab;
* create a second course, and copy the first course's content
into it;
* verify that the link is copied and that it is properly set
to open in a new tab.
Change-Id: Ib12cf67405393dfbeea416cbe056152daec805de
Reviewed-on: https://gerrit.instructure.com/10778
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
If you copied content into your course, then deleted an item
and copied it again it wouldn't be active. It is now.
Test Plan:
* Create an assignment
* Copy the course and delete the assignment in the new course
* Copy the original course into the new one again
* The assignment should be active
closes#8298
Change-Id: Ief8476d2befff999ed85a35039604d34253bfa1f
Reviewed-on: https://gerrit.instructure.com/10487
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
The selective imports mostly worked before, but if a
given section was completely unchecked the previous
code would import it anyway. This fixes that and makes all
the decision code in one place and easy to test.
Test Plan:
* Import a content package and only choose certain items
* Only the items you chose should be imported
closes#5528
Change-Id: Ia6c0c1f5f9a44497053733101140cc74d6239129
Reviewed-on: https://gerrit.instructure.com/9799
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
It's possible to have two external tools with all the
same configuration except for custom fields. In this case,
inserting two links, one to each tool configuration, would
have resulted in two launches of the same tool because
Canvas was only searching for the first match. This
commit adds an additional "preference" for the specified
tool, so Canvas doesn't just pick the first one, it tries
to pick the preferred one if there's nothing else
trumping that tool in precedence.
This does not fix the problem with having a tool's custom fields
overridden by a different tool that has higher precedence.
fixes#6797
test plan:
- add two external tools to a course with the same configuration
but different custom fields
- add a link to each tool in the course modules
- make sure the two links send over the correct custom fields,
those matching the tool that was picked when inserting the link
Change-Id: I8b037f169cfcfbfd9f9082a9dbec6fcee442edaa
Reviewed-on: https://gerrit.instructure.com/9025
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Test Plan:
* Create a discussion assignment worth 10 points
* Make a module item that is locked until that item has at least 5 points
* As a student make a comment on the discussion
* As the teacher give the student > 5 points.
* When reloading the modules page for the student the module item should be completed
closes#7170
Change-Id: Ie1eed0dc80cae85427f1a02fc833e33d7864ed49
Reviewed-on: https://gerrit.instructure.com/9040
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
the urls for content tags didn't use to be validated so there
can be invalid urls in olds data. If you try to copy one of
those courses it fails. It also failed for importing content
packages.
This commit makes it so that importing will skip those items
and add an item about it to the migration warning. For course
copy it attempts to escape the url and continue copying.
Test Plan:
* try to import a course from a package that has an invalid url
* try to copy a course that has an invalid url. (You'll have to manually set the invalid url on the ContentTag)
closes#7262
Change-Id: I008b786919bb2b66e0ff546667e7c0832b52e192
Reviewed-on: https://gerrit.instructure.com/8710
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
The importer was incorrectly using the external tool's
migration id as the content tags migration id. This made
it so that links to the same tool just updated the first
tag instead of creating a new one.
Test Plan:
* Create an external tool
* Link two module items to it on the modules page
* Export that course and import it into a different course
* The imported module should have both items and not just the second one
refs #7017
Change-Id: Iba377b9085607e3503f7f0113a4b9720bf8f0305
Reviewed-on: https://gerrit.instructure.com/8290
Reviewed-by: Brian Whitmer <brian@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
Renaming a content tag would also rename the file display name.
This was usually unexpected but it also caused relative linking
problems for html files
Test Plan:
* Add an attachment
* Add a link to that attachment in a module and give it a different title
* Check that the display name of the attachment didn't change
* Export that course as a canvas export
* Import it into a different course and make sure titles are still okay
closes#6408
Change-Id: I5735089ef9e2b7942b10689ca1beb1c57c073508
Reviewed-on: https://gerrit.instructure.com/7231
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
We are getting requests from some vendors to have some way to
load tools in a new tab. The preferred behavior is still to load
tools in the current window, but if a new tab is absolutely
necessary then there is the option now.
We can't reliably open links in a new tab without user intervention,
so we provide a button that users can click to load the tool
themselves in a new tab. That means we also need to add some
timeout functionality in case they take more than a few minutes
to load the tool, since BLTI links expire over time.
fixes#5814
Change-Id: I126f1aaa9cdcfe49b8f2b8ef8b7fbbaf8c56fe67
Reviewed-on: https://gerrit.instructure.com/5957
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
This also fixed some problems with the web content
part of the importer and made the spec run the full
migration from a cc package
refs #4153
Change-Id: I1700043b578fe79586104cf13b260c78c3166194
Reviewed-on: https://gerrit.instructure.com/5702
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
update_all's update hash doesn't have any magic performed on bare Time
objects; it assumes any Time object it's given is already in UTC. using
a TimeWithZone object (regardless of timezone), which Fixnum#ago and
friends happen to return, is still fine.
Change-Id: I297b2a3211b896b5225ebcfaaee3c1eb56e55fb6
Reviewed-on: https://gerrit.instructure.com/5351
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
This was already a small issue if the job queue was on a different
database driver than the main database, and it'll become more important
as more AR connections are introduced.
Change-Id: I204becadd32bb935df096e8c937a04bb6962f0b2
Reviewed-on: https://gerrit.instructure.com/4601
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
Basically, don't call a bazillion procs everytime you check_policy;
just the "given" statement. Everything else is evaluated just once,
and cached on the class. This does lose functionality (the ability
to access the instance inside of set_policy, and set methods), but
none of it was currently in use.
Change-Id: I736879d98beb4115a2e8c492931c755076291d08
Reviewed-on: https://gerrit.instructure.com/4665
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: JT Olds <jt@instructure.com>
for a course with > 500 module items, this brings initial render time
down from > 14 seconds to 3 seconds
* preload associations (appropriately)
* make sure to use those preloaded associations
* capture is slow when called a lot
* remove dead code
Change-Id: I8147c144db14329aa6e30e7922e8769b5b1a1b84
Reviewed-on: https://gerrit.instructure.com/4598
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
if sequential progress was enabled for a module, we were ignoring the
progression.locked? response and just looking at the current position in
the progression -- bypassing all previous module requirements.
fixes#4990
Change-Id: Ibe56e0a960f27e34db6f73c3e3fc791d9f51355c
Reviewed-on: https://gerrit.instructure.com/4542
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Before if any single item had an error the whole import
errored out. This lets items fail and the rest continue to
import. The single item failures are logged as warnings in
the ContentMigration and this allows the user to know what
failed.
All the warnings/failures are also shown on the migration
list page to help admins diagnose problems.
refs #4903
Change-Id: I66b81ce1c243258dfc8c1d7d1381b2ea8daa3e72
Reviewed-on: https://gerrit.instructure.com/4268
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
in production mode we now cast to the appropriate type and issue a warning
if it can't be cleanly cast (e.g. '' -> 0). if all arguments are nil (or
empty arrays, e.g. find_by_id([])) and we aren't in a scope, issue a
warning (sometimes we really do want nil when we're in a scope, e.g. line
216 of app/models/folder/rb).
in development/test mode, we now raise errors in the two warning scenarios
above (though that is configurable).
fixed several places in the code where specs failed due to the change, or
where inputs to dynamic finders looked problematic
Change-Id: Ifea851cb14d3e89b6df08ade8e83934579678f8b
Reviewed-on: https://gerrit.instructure.com/3434
Reviewed-by: Zach Wily <zach@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
module content tags will rename a file if there is a
title set
closes#4343
Change-Id: I4e90921b8dab62b452f599135d683515bd342ba1
Reviewed-on: https://gerrit.instructure.com/3260
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
This imports the syllabus, rubrics, and modules
refs #3396
Change-Id: Ie7802aa5a064f8cee471af9bfe0a23bf224831a6
Reviewed-on: https://gerrit.instructure.com/3064
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
- external tools can be added on the course/account
settings page
- external tools can be linked to from within modules
- clicking a tool in a module will load a new page
with the tool embedded in an iframe
- see context_external_tools for standard procedures
on retrieving settings for a specific link
fixes#4013
Change-Id: I8aa1934f8deac9af26d74036162b34fd1c4242e1
Reviewed-on: https://gerrit.instructure.com/2601
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>