Commit Graph

410 Commits

Author SHA1 Message Date
James Williams 940a804667 don't copy muted assignment status
test plan:
* course copies/blueprint syncs shouldn't affect
 a copied assignment's 'muted' status

closes #ADMIN-1065

Change-Id: Ibf027d0175a0c2ed1c3dbc1fe9e9d2546e968310
Reviewed-on: https://gerrit.instructure.com/151267
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Carl Kibler <ckibler@instructure.com>
QA-Review: Carl Kibler <ckibler@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2018-05-29 16:06:53 +00:00
Michael Jasper 7cbf9917eb course exports use instfs if enabled
closes RECNVS-414

test plan
- with instfs enabled
  - have a course
  - export it
  - verify that the download comes from instfs, not canvas

Change-Id: I18dec04f7c98e85163cd29afeba6b1878a0f62c6
Reviewed-on: https://gerrit.instructure.com/148704
Tested-by: Jenkins
Reviewed-by: Jonathan Featherstone <jfeatherstone@instructure.com>
QA-Review: Collin Parrish <cparrish@instructure.com>
Product-Review: Michael Jasper <mjasper@instructure.com>
2018-05-01 16:43:51 +00:00
Jeremy Stanley 19893a75fa preserve query params in links in migrations
test plan:
 - have a course with a wiki page and assignment
 - create another page that embeds the two former items
   in an iframe with "?embedded=true" in the link
   as described in the ticket
 - copy the course
 - in the copy, the "?embedded=true" links should be
   preserved

fixes ADMIN-868

Change-Id: I20c775cbd8a76eabecf49252b61a45d0a7817278
Reviewed-on: https://gerrit.instructure.com/147898
Tested-by: Jenkins
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2018-04-26 16:35:52 +00:00
Matthew Berns e4badfa7db add hide_outcome_results column to rubric association and course copy
closes OUT-2154

dev-qa
- run new migration
- ensure RubricAssociation model has hide_outcome_results column
  that defaults to false
- create a course with two assignments and attach a rubric
  to each assignment
- using rails console, manually set one of the
  RubricAssociations in that course to have hide_outcome_results as true
- copy the course using course copy on settings page
- view the new rubric associations in the rails console,
  they should accurately reflect the hide_outcome_results attribute
  of the original two

Change-Id: Iae4fbea4835f4cb4940e9d2ae2028b7f704ea42c
Reviewed-on: https://gerrit.instructure.com/147536
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
QA-Review: Augusto Callejas <acallejas@instructure.com>
Product-Review: Michael Brewer-Davis <mbd@instructure.com>
2018-04-19 23:32:08 +00:00
Matthew Berns c8d466fbae add hide_points column to rubric association and course copy
closes OUT-1844

dev-qa
- run new migration
- ensure RubricAssociation model has hide_points column
  that defaults to false
- create a course with two assignments and attach a rubric
  to each assignment
- using rails console, manually set one of the
  RubricAssociations in that course to have hide_points as true
- copy the course using course copy on settings page
- view the new rubric associations in the rails console,
  they should accurately reflect the hide_points attribute
  of the original two

Change-Id: I42cbf003499e054202322a5d56ae0d46c92a56b0
Reviewed-on: https://gerrit.instructure.com/146162
Reviewed-by: Rob Orton <rob@instructure.com>
Reviewed-by: Michael Brewer-Davis <mbd@instructure.com>
Reviewed-by: Augusto Callejas <acallejas@instructure.com>
QA-Review: Augusto Callejas <acallejas@instructure.com>
Product-Review: Sidharth Oberoi <soberoi@instructure.com>
Tested-by: Jenkins
2018-04-17 21:32:43 +00:00
Jeremy Stanley af5432d11c web zip export: exclude unpublished module prerequisites
test plan:
 - have a module in a course that has an unpublished module
   as a prerequisite
 - from the modules page, select "Export Course Content"
 - download and unzip the package
 - ensure the browser renders it

fixes ADMIN-913

Change-Id: Ib329bfac9f476280ed6b47ccc342b284ef0029f6
Reviewed-on: https://gerrit.instructure.com/145740
Reviewed-by: Dan Minkevitch <dan@instructure.com>
Tested-by: Jenkins
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2018-04-04 17:13:50 +00:00
Simon Williams c0b7b9ffc3 upgrade to rubyzip 1.2.1
Even though this is a patch level version bump, it made a subtle change
that broke some workflows we had (see https://xkcd.com/1172/).

The second argument to Zip::File.open is a `create` flag, which
determines whether the zip file is created if it does not exist. Prior
to 1.2.1, the expectation was that `Zip::File::CREATE` was passed as the
argument if creation was desired. However, internally the library was
inconsistent about checking the passed flag against `Zip::File::CREATE`
vs just checking truthiness.

In practice, what this meant is that if you passed a different truthy
value, like `Zip::File.open(filename, 'w')` (like we did in several
places), the file would still be created if it did not exist, BUT,
critically, it would not be saved if nothing was put into the archive.

1.2.1 changed this flag to always check "truthiness", meaning empty zip
archives started to be saved. Unfortuantely, our mime type evalutation
rules don't correctly identify an empty zip file as a zip file, but
instead as just a binary file. These two things combined to create
problems.

see https://github.com/rubyzip/rubyzip/compare/v1.2.0...v1.2.1
and particularly fc23f68f77

closes CNVS-41711

test plan:
- test course copy and export/import workflows (both canvas and standard
common cartridge formats), especially in "sparse" cases where, for
example, no associated files would be copied.

Change-Id: If0033f6c0ede7f7a6e8c26031371ae2bd24cd1fb
Reviewed-on: https://gerrit.instructure.com/143744
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2018-03-21 17:09:44 +00:00
James Williams 27aaae31ea master courses: copy module prerequisites selectively
should be able to link a module to one not added
 to the export

test plan:
* have a blueprint course with two modules
* sync to an associated course
* add the first module as a prerequisite to the
 second
* re-sync
* the prerequisite should have been added in the
 associated course

closes #ADMIN-810

Change-Id: I52b6b43a50b2cb8030bd2baa5ba8d1ec06d04b07
Reviewed-on: https://gerrit.instructure.com/142685
Reviewed-by: Mysti Sadler <mysti@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Tested-by: Jenkins
Product-Review: James Williams  <jamesw@instructure.com>
2018-03-12 20:11:52 +00:00
James Williams fabc0839fb add optional common cartridge html file to page converter
test plan:
* as a site admin, enable the hidden root account
 feature flag "Common Cartridge HTML File
 to Page Conversion"
* import the "Home-Term" package referenced in the ticket
* it should try to bring over the html files
 in the package as pages (e.g. "Overview")

closes #CNVS-41424

Change-Id: If808cd126a8eab1211f8b3f2a4a288d2785ec3ec
Reviewed-on: https://gerrit.instructure.com/142021
Tested-by: Jenkins
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Reviewed-by: Mysti Sadler <mysti@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2018-03-09 21:29:33 +00:00
James Williams c186393f10 don't include quizzes locked by date in epub export
test plan:
* have a quiz set to be locked until a future date
* a student should not be able to see the quiz
 content in a epub export

closes #ADMIN-842

Change-Id: I323bc3df36b8078e88331a08a85abb7914c92efb
Reviewed-on: https://gerrit.instructure.com/142958
Tested-by: Jenkins
Reviewed-by: Mysti Sadler <mysti@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2018-03-09 17:11:48 +00:00
James Williams 5c4fa22735 fix contextless file link translation some more
test plan:
* make sure that links like
 "https://example.com/files" are preserved on copy
 but links to "/courses/:course_id/files" are
 translated to the new course

closes #ADMIN-805

Change-Id: Ia7cd5ba5ea61fa05c8edb0cfc4d413b667aae5fd
Reviewed-on: https://gerrit.instructure.com/141728
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2018-03-01 01:39:38 +00:00
Dan Minkevitch 277720c2a3 Add "Closed for comments" setting to topic migration
Closes ADMIN-703

Test Plan:
* Create an course with and an announcement, lock
  the announcement after posting.
* Go to Course Settings > Copy Course start new course Copy
* Navigate to course announcemtns in new course, notice migrated
  announcement is closed for comments.

Change-Id: I25856f0a44b2c70a9cac54673bac8cab55fde50e
Reviewed-on: https://gerrit.instructure.com/140713
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Dan Minkevitch <dan@instructure.com>
2018-02-13 21:07:43 +00:00
wdransfield 55baba98b9 Set Tool Setting assignment relationship on import/export
Fixes PLAT-2998

Test Plan:
- Create three assignments. Two should be associated with
  plagiarism detection tools (installed in the root account)
  and the third should just be a standard file upload assignment.
- For both assignments that use a plagiarism tool do:
      Create a tool setting that takes the following
      shape:
      {
	resource_link_id: <lti_context_id of the
	assignment>,
	tool_proxy: <The tool associated with the
	assignment>,
	context: <The course of the assignment>,
	custom: <A hash with strings as keys>,
	custom_params: <A hash with strings as keys>
      }
  Note that the `custom` and `custom_params` hashes
  should be different for the two tool settings.

- Verify that both tool settings are able to be fetched using
  this endpoint: "tool_proxy/:tool_proxy_guid/courses/:course_id
    /resource_link_id/<lti_context_id of the assignment>/tool_setting"
  This endpoint will require a JWT access token.
- Do a course copy
- Verify that two new tool setting were created.
- Verify the resource link ids match the corresponding
  copies of the assignments.
- Verify the `custom` and `custom_parameters` hashes
  were copied to the correct new tool settings.
- Verify the tool proxy of the new tool settings point
  to the original tool.
- Verify the the context of the new tool settings is
  the new course.
- Verify that both _new_ tool settings are able to be fetched using
  this endpoint: "tool_proxy/:tool_proxy_guid/courses/:course_id
    /resource_link_id/<lti_context_id of the new assignment>/tool_setting"
- Verify the copying the plain file upload assignment also succeeded as
  normal.
- Edit the new assignments and verify the correct tool launches.

Change-Id: Iaf92fc23c0373585039cc2debf9657d10989c4ec
Reviewed-on: https://gerrit.instructure.com/138218
Reviewed-by: Andrew Butterfield <abutterfield@instructure.com>
Tested-by: Jenkins
QA-Review: August Thornton <august@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2018-01-19 21:05:21 +00:00
James Williams 0db73148fa translate contextless file links in course copies
if we run into a link directly to "/files/X" we
 should try to pass it through to the other course
 instead of leaving it alone

Change-Id: Ie67add5553ec9fbb2a7e2acaf0274cf798eb6b4f
Reviewed-on: https://gerrit.instructure.com/135074
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2017-12-18 13:43:32 +00:00
Mysti Sadler fd125d9750 Exclude alignments for other courses on account outcomes
refs ADMIN-350

Test plan
- Have at least one account level outcome
- Have at least 2 courses
- Link the account level outcome in both courses
  Using a question bank to do this is pretty simple
- Export one of the courses
- Check the export package's course_settings/learning_outcomes.xml
  file and ensure that the alignments for the second course have
  not been exported

Change-Id: I9ff0c260aa21a4d58ef96f1ec5dc608cebdf5f8a
Reviewed-on: https://gerrit.instructure.com/134993
Tested-by: Jenkins
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Dan Sasaki <dsasaki@instructure.com>
Product-Review: Mysti Sadler <mysti@instructure.com>
2017-12-08 22:18:59 +00:00
Jeremy Stanley 51f7ebe9b7 escape title / meta text in HtmlContentExporter
test plan:
 - have assignments and wiki pages with unclosed html tags in their names
   (e.g., <style> and no corresponding </style>)
 - these items should copy correctly via course copy
   or export/import. in particular, check:
   1. the HTML tags appear literally in the names
      (they are not filtered out)
   2. all items are copied
   3. item body text is also copied

fixes ADMIN-583

Change-Id: Ic1fc006fca0c1e0af0dec05ebf7cff2041c179f3
Reviewed-on: https://gerrit.instructure.com/134720
Tested-by: Jenkins
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2017-12-08 17:15:16 +00:00
Andrew Butterfield b032951ae4 Make ampersand regex less greedy
fixes PLAT-2019

Test plan:
* Using the redirect tool attempt to install using the problematic url
* Ensure that tool installs and that the redirect works

Change-Id: I7f409c764faea90389e5172df6e988f5a6808468
Reviewed-on: https://gerrit.instructure.com/133364
Tested-by: Jenkins
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Andrew Butterfield <abutterfield@instructure.com>
2017-11-21 17:30:48 +00:00
Jeremy Stanley 312466f7e4 remove @unzipped_file_path from Migrator
it is no longer necessary to use this directly;
use methods on @package_root instead

test plan: ensure each of the following types of migration succeed:
 - course copy
 - Canvas cartridge
 - QTI import
 - Blackboard
 - Angel
 - D2L
 - Moodle

closes ADMIN-528

Change-Id: I3b1ce55e94d4cd98f262b653844fdc8ec64d299a
Reviewed-on: https://gerrit.instructure.com/132934
Reviewed-by: James Williams  <jamesw@instructure.com>
Tested-by: Jenkins
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2017-11-16 22:12:40 +00:00
wdransfield 5ad754bd8f Tool settings import/export
Closes PLAT-2886

Test Plan:
- Install a plagiarism detection tool in a course.
_ Create an assignment associated with the tool.
- Create a tool setting associated with the tool
  proxy that contains custom data/params.
- Export the course
- In a blank course install the same plagiarism
  tool.
- Import the the coures export package into the
  blank course.
- Verify the tool proxy in the previously blank course
  now has a tool setting.
- Verify the resource_link_id of the tool setting is
  set to the lti_context_id of the assignment it is
  associated with.
- Verify the custom params/data was copied to the new
  tool setting.

Change-Id: I757c4057618442b5b6714a1073fe66ee2487eb25
Reviewed-on: https://gerrit.instructure.com/131525
Reviewed-by: Andrew Butterfield <abutterfield@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Tested-by: Jenkins
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2017-11-15 19:22:17 +00:00
Jeremy Stanley ad18235015 refactor package content management
extract PackageRoot to handle common tasks on extracted packages,
such as translating between absolute and package-relative paths,
and enumerating contents

test plan:
 - ensure the package attached to the ticket is handled correctly
 - regression test course copies and Canvas cartridge imports

refs ADMIN-528

Change-Id: I76b67076a48c8acedcde523d46aac8e2ccef76d0
Reviewed-on: https://gerrit.instructure.com/132389
Tested-by: Jenkins
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2017-11-15 18:03:18 +00:00
Matt Taylor eba07fd3fe fix common cartridge validation errors on course export
closes CNVS-38795

Test Plan
  1. Create a course with all of the following
     - weighted assignment groups
     - quizzes (with at least one question)
     - outcome with at least one aligned item
     - module with at least one assignment
     - one or more rubrics
     - no media tracks
  2. Export the course to a common cartridge (CC) file
  3. Download and unzip the CC
  4. Validate all XML files from the CC vs. cccv1p0.xsd
     (with the exception of imsmanifest.xml and
      assessment_qti.xml since these use IMS's schemata
      and not our own; see the 2-Nov-17 comment on the
      ticket for details)
  5. Add a media track to the course and repeat (1-4)
  6. Import the CC from (5) into a new course

Change-Id: Ib2ef70737189d0107159bf0a93a7cd86d2dfd1c0
Reviewed-on: https://gerrit.instructure.com/127393
Reviewed-by: James Williams  <jamesw@instructure.com>
Tested-by: Jenkins
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2017-11-02 19:15:01 +00:00
James Williams 4513d99929 import cc syllabus intendeduse resources
closes #gh-1142 #ADMIN-332

Change-Id: I54c7f90581269d40e50d473bda16271f5911278e
Reviewed-on: https://gerrit.instructure.com/131291
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2017-11-01 20:04:14 +00:00
James Williams 874c443d5f add post_to_sis to assignment copy
test plan:
* enable the "Post Grades to SIS" or
 "Allow Bulk Grade Export to SIS" feature on an
 account/course
* have an assignment in a course with
 "Sync to SIS" enabled
* copy the assignment into a new course
* should preserve the setting

closes #ADMIN-304

Change-Id: I9fcc10366fed6270073239591f73dd4069ab6b67
Reviewed-on: https://gerrit.instructure.com/130112
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2017-10-31 16:58:31 +00:00
Nathan Mills 06d54522b2 import assignment configuration tool lookups
fixes: PLAT-2844

test plan:
export a assignment with an originality report placment
import the assignment into another course
the originality report placement should be associated with the correct
tool

Change-Id: I2c38adcdf56bf21f3e8b56973aa4c5baf3d782d8
Reviewed-on: https://gerrit.instructure.com/129424
Tested-by: Jenkins
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Nathan Mills <nathanm@instructure.com>
2017-10-19 17:37:55 +00:00
wdransfield b5889a957c Include similarity detection tool associations in export
Closes PLAT-2843

Test Plan:
- Create an assignment associated with a plagiarism
  detection tool.
- Export the assignment and verify the assignment
  resource xml contains the product code, vendor
  code, and resource type code of the associated
  assignment.
- Verify exporting assignments with no plagiarism tools
  continues to function as before.

Change-Id: Idc6e9e2863baa083ec6d7c4c058719cf632ecc22
Reviewed-on: https://gerrit.instructure.com/128742
Tested-by: Jenkins
Reviewed-by: Nathan Mills <nathanm@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2017-10-06 19:33:29 +00:00
Mark Valentine b3035f1e0a add description to rubric ratings
Fixes PFS-8549

Test Plan:
Verify that a description is now able to be added for
rubric ratings.  Description should adhere to requirements
outlined in JIRA.

Specifically:
1.  Add a rating description, and save the rubric.  Verify
    that description is still present after saving.  Reload
    page.  Verify description is still present.
2.  Verify rating description is displayed on the following
    pages:
    a) Assignment submission view.
    b) SpeedGrader / PeerReview view.
    c) Student Grades view.
    d) Account/Course rubric view.
    e) Assignment rubric view.
3.  Verify that course copy will also copy rating descriptions
    from rubrics.

Change-Id: I544a0564fd3df6b8928a44d13464693621f96533
Reviewed-on: https://gerrit.instructure.com/126139
QA-Review: Aiona Hernandez <ahernandez@instructure.com>
Tested-by: Jenkins
QA-Review: Andrew Porter <hporter-c@instructure.com>
Reviewed-by: Matt Berns <mberns@instructure.com>
Product-Review: Sidharth Oberoi <soberoi@instructure.com>
2017-10-05 15:46:10 +00:00
James Williams 4e012aa54e copy student view restriction settings
test plan:
* create a course with one or more of the
"Restrict students from viewing ___" settings checked
* the setting should carry over when copied to a new course

(also should work on blueprint course when
 settings are included)

closes #CNVS-39459

Change-Id: I6ceca2e61744770236471b15041bcbf39d29def5
Reviewed-on: https://gerrit.instructure.com/127258
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2017-09-28 15:28:43 +00:00
James Williams 001ecd52e1 copy nil values for quiz hide_results
test plan:
* have a quiz in a course with "Let Students See their
 quiz responses" checked
* copy it into another course
* uncheck the setting in the original quiz
* re-copy the quiz into the same course
* it should uncheck the setting in the copied quiz

(also applies to blueprint courses)

closes #CNVS-39464

Change-Id: I36ae2dd514b466404efede9714770c07041ca75c
Reviewed-on: https://gerrit.instructure.com/127345
Tested-by: Jenkins
Reviewed-by: Dan Minkevitch <dan@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2017-09-27 19:03:56 +00:00
Mark Valentine fd2ed0a2bd add rubric range logic
- feature flag for rubric range

Fixes:  PFS-8283

test plan:

Enable feature: Rubric Criterion Range
Access rubric in account, course, and assignment.

1. Verify that 'range' option is available when editing
   a non-outcome criterion.
2. Verify range option is not available for imported
   outcomes.
3. Verify range option is not available when using
   custom comments (assignment rubrics only)

For range enabled criterions:
1. Verify that increasing the total points assigned
   to a criterion will appropriately scale all
   range values.
2. Verify that increasing the max of highest score
   cell increases total points available for
   criterion.
3. Verify that increasing the max of a middle-cell
   will increase the min of cell to left.
4. Verify that min of cell farthest to right is locked
   at 0.
5. Verify that adjusting the min of a middle-cell
   will adjust the max of cell to the right.

In Speedgrader:
1. Verify that selecting values anywhere within a rating
   range will highlight the whole rating cell in green.

Feature Flag:
1. Verify that when feature flag is disabled app functions
   as if range has been disabled for all criteria. (Leave
   a criterion using range, and verify that is no longer
   uses range when the feature is disabled).

In Submission Page:
We should also check the submission show page, since Rubrics
are displayed there as well. It can be a little hard to find
since it doesn't follow typical REST patterns for some reason.
When someone submits to the assignment, the url will be the
assignment's id and the user's id.
e.g, for a user id of 9 and an assignment id of 7 on course 1,
the url would be:
/courses/1/assignments/7/submissions/9

Accessibility:
Verify the new fields are a11y compliant by testing keyboard only
and voiceover navigation, so we don't introduce any new
accessibility issues.

Internationalization:
Test range ratings with different numbering system (i.e. Polish)
Verify that rounding works correctly.

Course Copy:
Verify that course copy preserves rubric ranges.

Change-Id: Ia1e9d3cc1d544aecc21c3628bd3dbec70831da2f
Reviewed-on: https://gerrit.instructure.com/121870
Tested-by: Jenkins
Reviewed-by: Matt Berns <mberns@instructure.com>
QA-Review: Aiona Hernandez <ahernandez@instructure.com>
QA-Review: Andrew Porter <hporter-c@instructure.com>
Product-Review: Sidharth Oberoi <soberoi@instructure.com>
2017-09-12 19:58:40 +00:00
James Williams 5f8c668a6c fix wiki pages in epub exports
i'm not sure if something changed with nokogiri 1.8.0 but
when it parses ASCII text it fails silently when exporting
"output error : unknown encoding ASCII-8BIT"

test plan:
* enable epub exporting in a course with a wiki page
* generate an epub export
* it should include the wiki page content

closes #CNVS-39008

Change-Id: I3fd237d42d197404e5a6335caed8c6e1e6f1e34f
Reviewed-on: https://gerrit.instructure.com/125667
Tested-by: Jenkins
Reviewed-by: Venk Natarajan <vnatarajan@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2017-09-12 19:16:23 +00:00
Simon Williams 3f1c585a2f shorten list of tags to rewrite to api urls
there is a measurable cost associated to this step of api content
transformation, so only run it on types of url attributes that might
actually need to be rewritten (ignore mathml href's)

fixes CNVS-38442

test plan:
- create a submission with a lot of <p> tags
- request it from the API
- performance should be better
- now create a link/image to something root-relative in canvas
- request it from the api
- it should come back as absolute

Change-Id: I21fc42db25e84e70a0d19db7dc271cfd46801ecb
Reviewed-on: https://gerrit.instructure.com/122400
Tested-by: Jenkins
Reviewed-by: Keith T. Garner <kgarner@instructure.com>
QA-Review: Tucker McKnight <tmcknight@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2017-08-14 20:06:57 +00:00
James Williams b8eb9b04d2 call translated license names in a lambda
Change-Id: Ibdbca9847de64e79f472df8d3ff886e3b9c4a4ba
Reviewed-on: https://gerrit.instructure.com/122503
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2017-08-14 13:03:04 +00:00
James Williams 45147e0911 bypass the wiki model as much as possible for wiki_pages
Change-Id: I60ec3b519219fcb5256a132c05f63538600df73f
Reviewed-on: https://gerrit.instructure.com/121760
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2017-08-09 16:09:06 +00:00
Jeremy Stanley 42df451ceb fix link translation in blueprint sync
test plan:
 - create a blueprint course and associate it with one or
   more target courses
 - create links in rich text from one item to another item
   in the blueprint course
 - perform a sync
 - ensure the associated course objects have functioning links
   to the associated course's copies of the items

fixes MC-283

Change-Id: I20c8bdf658168aa5c54815c22718b34db988b05f
Reviewed-on: https://gerrit.instructure.com/117934
Tested-by: Jenkins
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: David Mirabile <dmirabile-c@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2017-07-06 19:00:56 +00:00
Andrew Butterfield 24c8c5e170 Selective Tool Profile Course Copy
fixes PLAT-2634

Test plan:
* Using a course with two lti 2 tools installed
  * Export the course
  * Then selectively import the course into a new course that doesn't
    have the LTI 2 tools installed
  * Ensure that the 2 lti tools are listed in the dialog
  * Ensure that only the tool profiles that are checked leave warnings
    during the import
* Do a selective course copy from the course that has the two lti 2
  tools installed.
  * Ensure all the same stuff as above
* Do selective course export via the api
  * Go through the export process using the following endpoint and
    options
    /api/v1/courses/:course_id/content_exports?export_type=common_cartridge&select[all_tool_profiles]=1
  * Ensure that all the tool profiles in the course are exported
  * Go through the export process using the following endpoint and
    options
    /api/v1/courses/:course_id/content_exports?export_type=common_cartridge&select[tool_profiles][]=<id for a tool profile in the course>
  * Ensure that only the selected tool profile is exported

Change-Id: Ib4cfbad35476369aafd8bf66214ef3efb51850e0
Reviewed-on: https://gerrit.instructure.com/116286
Reviewed-by: James Williams  <jamesw@instructure.com>
Reviewed-by: Nathan Mills <nathanm@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Tested-by: Jenkins
Product-Review: Karl Lloyd <karl@instructure.com>
2017-06-28 17:00:56 +00:00
Andrew Butterfield e318f907a8 Tool Profile export
fixes PLAT-2595

Test plan:
* Install an LTI 2 tool in a course
* Export the course
* Ensure that a json representation of the tool profile is in the
  resulting export file
* Repeat this process but this time add a url to the registration_url
  field that was added to the Lti::ToolProxy model in this commit
* Ensure that the resulting export includes the registration url

Change-Id: I6d0a4a1d5dce42a48e895601343070d26e9de078
Reviewed-on: https://gerrit.instructure.com/114987
QA-Review: August Thornton <august@instructure.com>
Tested-by: Jenkins
Reviewed-by: Nathan Mills <nathanm@instructure.com>
Product-Review: Andrew Butterfield <abutterfield@instructure.com>
2017-06-20 16:47:33 +00:00
Andrew Butterfield 9f028d3d6d Add ability to import tool profiles
fixes PLAT-2598

Test plan:
* Install the plagiarism detection tool in a course locally using docker
* Get a zip file from me with a bunch of exports
* In the course that has the plagiarism detection tool installed
  * Import 'import.imscc'
  * Ensure that the import completes without warnings or errors
  * Import 'different_version.imscc'
  * Ensure that the import completes with a warning about finding a
    different version of the tool
  * Import 'missing_data.imscc'
  * Ensure that the import completes with a warning that has a link to
    an error report
* In a course where the plagiarism detection tool is not installed
  * Import 'registration_url.imscc'
  * Ensure that the import completes with a warning that tells the user
    the registration url they can use to install the missing tool
  * Import 'import.imscc'
  * Ensure that the import completes with a warning that tells the user
    they need to install the tool but without a registration url

Change-Id: I3836c2caf602487de135b5a8732bba00b96b9342
Reviewed-on: https://gerrit.instructure.com/114139
Tested-by: Jenkins
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Brad Humphrey <brad@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Karl Lloyd <karl@instructure.com>
2017-06-19 19:31:52 +00:00
James Williams f48ab5e698 fix some file name issues with epubs
handle filenames that look like regex and
also just don't export files with blank names anywhere
because that's ridiculous

closes #CNVS-37616

Change-Id: I4b2a1183383beb35fa4774cbe9e06afae601bd94
Reviewed-on: https://gerrit.instructure.com/115892
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2017-06-16 17:15:53 +00:00
James Williams dc2b376f17 fix epub exports with blank dates
was exploding trying to parse blank date strings

test plan:
* have a course with an assignment with no due date
* enable epub exports for the course
* generate an epub export for the course
* should run successfully

closes #CNVS-37439

Change-Id: I67b7d49c663836f64012143085331b8990d0bcf2
Reviewed-on: https://gerrit.instructure.com/115044
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: David Tan <dtan@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2017-06-12 20:00:08 +00:00
Dan Minkevitch 1218033b3e Add new planner fields for course copy
Closes FALCOR-241

Test Plan:
* As an admin
* In a course with the "Student Planner" feature
  flag enabled
* With discussion topics and wiki pages that have
  been marked as "Add to student to-do" and have
  corresponding todo dates
* Run a course copy for the discussion topics and
  wiki pages
* The newly copied topics and pages should have
  the todo date set the same as the original

Change-Id: Ib1ceb3ed87351b2fac5b68c31b4d3d6066cf6688
Reviewed-on: https://gerrit.instructure.com/114827
Tested-by: Jenkins
Reviewed-by: Mysti Sadler <mysti@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Dan Sasaki <dsasaki@instructure.com>
Product-Review: Dan Minkevitch <dan@instructure.com>
2017-06-12 17:58:27 +00:00
Jeremy Stanley ade6449abb fix double-slashes in web_zip exports
these contained a file named "something//index.html", and
windows sees a folder with no name in the middle there

test plan:
 - enable offline content export
 - export course content from the modules page
 - ensure the downloaded archive is readable on windows 10

fixes CNVS-37267

Change-Id: Iba0fd107702b45d71db427ac30bf5b5f9707322f
Reviewed-on: https://gerrit.instructure.com/114402
Tested-by: Jenkins
Reviewed-by: Mysti Sadler <mysti@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2017-06-08 19:17:32 +00:00
James Williams 43c336b505 don't export a blank syllabus
closes #CNVS-9359

Change-Id: Ia4b6f97e1eb0315d5b40870901fb3275dc96f382
Reviewed-on: https://gerrit.instructure.com/113843
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2017-06-01 16:04:55 +00:00
Jeremy Stanley 459337cecd propagate removal of due/available dates in blueprint sync
test plan:
 - ensure that if due or availability dates are removed
   from a locked assignment, quiz, or graded discussion topic,
   dates will be removed from the associated courses'
   copies of the items after sync
 - ensure that in a normal course copy, if you copy an item
   to a new course, remove dates from the source item, and
   re-copy, the dates are _not_ removed from the target
   course's copy of the items

fixes MC-214

Change-Id: I98440491127c404e898bcff3970dedebc8939014
Reviewed-on: https://gerrit.instructure.com/112157
Tested-by: Jenkins
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Heath Hales <hhales@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2017-05-23 15:34:53 +00:00
Jeremy Stanley 7923c62f67 fix exporting closed-for-comments discussions in concluded courses
test plan:
 - have a closed-for-comments discussion topic in a concluded course
 - ensure a course copy as a non-account-admin teacher in the course
   exports the discussion topic

fixes CNVS-36880

Change-Id: If17ead0d8eafb25e1ea36b6bf1e6d403a0aa138a
Reviewed-on: https://gerrit.instructure.com/111787
Tested-by: Jenkins
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: David Tan <dtan@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2017-05-16 15:28:48 +00:00
Mysti Sadler baa0a8bbd7 Fix errors with external tool items and index links
fixes OFFW-213

Test plan
- Set up an external tool that you can use as a module item
- (I used Feed the Me from EduAppCenter.org)
- Turn off the assignments, quizzes, discussion, files or
- pages navigation tab
- Create one of the above items with a link to an index
- page in the course (ie announcements, grades, assignments
- list, etc)
- Export the offline content and ensure there are no errors

Change-Id: I231cb2e83a4cadfa784370d0c5791fba868b275b
Reviewed-on: https://gerrit.instructure.com/110917
Tested-by: Jenkins
Reviewed-by: Jon Willesen <jonw+gerrit@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Product-Review: Mysti Sadler <mysti@instructure.com>
2017-05-05 20:00:09 +00:00
Landon Wilkins f1359d33e2 da licença part 27
add consistent license headers to all source files
(ruby, coffeescript, javascript)

except for vendor files

Change-Id: I331826e3e3be8b7d73bbf4f6afe3a79ec1340f54
Reviewed-on: https://gerrit.instructure.com/110051
Tested-by: Jenkins
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2017-04-27 21:53:31 +00:00
Mysti Sadler c883eb485d Prevent export of non-linked items for disabled tabs
fixes OFFW-203

Test plan
- Turn off files, assignments, discussions, quizzes, pages
- navigation tabs in your course
- Ensure you have each of the above types linked in a
- viewable module
- Set up deep and circular links
- Ensure you have at least one of each of the above that is
- NOT linked in a module
- Export the offline content package and verify you can see
- the linked items and NOT the non-linked items
- Ensure nothing breaks on the deep and circular links
- Turn on only the assignments tab in your course
- Have a graded quiz and discussion and an ungraded quiz and
- discussion
- Export the offline content package and verify that you can
- see the graded items only

Change-Id: I3490a6a385669af7350cf0f05292d790e845d13d
Reviewed-on: https://gerrit.instructure.com/109177
Reviewed-by: Cameron Sutter <csutter@instructure.com>
Tested-by: Jenkins
QA-Review: Nathan Rogowski <nathan@instructure.com>
Product-Review: Mysti Sadler <mysti@instructure.com>
2017-04-25 22:15:20 +00:00
Jon Willesen 34614b482c add discussion availability dates to offline export
refs OFFW-206

test plan:
* create an ungraded discussion with lock and unlock dates
* check that the lockAt and unlockAt data is available in the export

Change-Id: I8de4b3adbf7aab65d590bbe6470f270fd02cbfb9
Reviewed-on: https://gerrit.instructure.com/108870
Tested-by: Jenkins
Reviewed-by: Mysti Sadler <mysti@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Product-Review: Jon Willesen <jonw+gerrit@instructure.com>
2017-04-18 23:03:41 +00:00
Mysti Sadler 4bd127724e Fix content locked by availability date in WebZip export
fixes OFFW-207

Test plan
- Set up multiple kinds of items that allow availability dates
  in a Canvas course
- Set the items to have availability dates in the past or
  future
- Put them in a module and make sure the module isn't blocking
  the export
- Export the offline content package and ensure the locked
  item content is not viewable

Change-Id: I1516a8db95b694bf53e8c1b88dfe25c42958ae5a
Reviewed-on: https://gerrit.instructure.com/108857
Tested-by: Jenkins
Reviewed-by: Jon Willesen <jonw+gerrit@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Product-Review: Mysti Sadler <mysti@instructure.com>
2017-04-18 15:25:24 +00:00
Jon Willesen 968fb2dc97 add assignmentExportId to web zip exports
refs OFFW-146

test plan:
* quizzes and graded discussions in offline content exports should have
  an assignmentExportId field in the course data.

Change-Id: Ia9ae66aae7dbd9bc47d91ee014b2bc1674ce01de
Reviewed-on: https://gerrit.instructure.com/105913
Reviewed-by: Mysti Sadler <mysti@instructure.com>
Tested-by: Jenkins
QA-Review: Nathan Rogowski <nathan@instructure.com>
Product-Review: Jon Willesen <jonw+gerrit@instructure.com>
2017-04-17 15:22:01 +00:00