Commit Graph

68 Commits

Author SHA1 Message Date
wdransfield bc20165672 Update membership expansion documentation
Refs CNVS-41279

Test Plan:
Verify the new documentation is clear that
Canvas.xuser.allRoles does not scope roles
to the launch context.

Verify that the Canvas.membership.roles
expansion now has a default name
(not required to address this issue,
just more convenient for the TP).

Change-Id: I182b2dbd51e47063b959c4568f9d1880d044d7ae
Reviewed-on: https://gerrit.instructure.com/140784
Reviewed-by: Andrew Butterfield <abutterfield@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Tested-by: Jenkins
Product-Review: Jesse Poulos <jpoulos@instructure.com>
2018-02-13 21:45:55 +00:00
wdransfield 9dfbb56af1 Add group id variable substitution
Closes PLAT-3036

Test Plan:
- Create an assignment that uses a plagiarism tool and is a group
  assignment. The tool should use both new variable expansions.
- Verify all originality report launches show the correct
  group id and name for the current user.

Change-Id: Id2908ff649e4e931f6a76992871ebebe7558d88b
Reviewed-on: https://gerrit.instructure.com/139504
Tested-by: Jenkins
Reviewed-by: Marc Alan Phillips <mphillips@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2018-02-09 20:20:24 +00:00
Rob Orton b5de0458d9 dots and new lines
test plan
 - specs should pass

Change-Id: Iafc7c9b8ca64f32568e658b600e19c2e6f9045ca
Reviewed-on: https://gerrit.instructure.com/138026
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2018-01-17 16:56:26 +00:00
Andrew Butterfield f9d1e029a0 Revert previousCourseId variable substitution change
fixes PLAT-2961

Reverts d3d4cc58e0 but also adds
functionality with new variable expansion

Test plan:
* Ensure $Canvas.course.previousContextIds works as it did before
* Ensure $Canvas.course.previousContextIds.recursive works the way the
  new changed intended

Change-Id: I737c2bdca2936e092fb6a929adb009cdc79b89d5
Reviewed-on: https://gerrit.instructure.com/136245
Tested-by: Jenkins
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: August Thornton <august@instructure.com>
Product-Review: Andrew Butterfield <abutterfield@instructure.com>
2017-12-21 17:37:05 +00:00
wdransfield a8b009c77d Remove attachment dependancy for originality reports
Closes PLAT-2953

Test Plan:
- Create an assignment associated with a plag tool
  that uses the `text entry` submission option
- As a student submit to the assignment
- With the tool attempt to request the submission
  via the LTI API and verify the submission
  is received
- With the tool attempt to create an originality report
  for the submission _without_ specifying an attachment
  id (since there is no attachment for the assignment)
- Verify the report is created and is visible in the
  following locations:
    * Speedgrader
    * gradebook
    * student grades page
  Note that for parity it does not need to be visible in the
  submission details page.
- Attempt to edit the the report via each of the 3 update endpoints
  (let me know if you don't know what 3 those are) and verify
  update works. When testing these first create other originality
  reports for other assignemnts in the course to verify the correct
  originality report is updated.
- Verify that clicking on originality reports from each part of the UI
  initiates an LTI launch to the tool
- Verify that the entire plagiarism platform flow still works for
  file upload assignments

Change-Id: I318f605dace31c92ae3954f26ec2aefa3e8ad90e
Reviewed-on: https://gerrit.instructure.com/135409
Tested-by: Jenkins
Reviewed-by: Nathan Mills <nathanm@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2017-12-19 18:06:18 +00:00
Marc Alan Phillips 08b1df3440 Enable Person.name.display as an option
Allows for lti launch where you can expand the display name of
a user in lti tools for use.

closes PLAT-2776

Test Plan:
 - Create an lti config that uses Person.name.display
 - Do an lti launch and verify that the expanded value as a param
 - For LTI 2, create a tool proxy that includes the Personl.name.display
  capability
 - Repeat step 2

Change-Id: I7f919bb9af2bb1efb42d8a3bd76cfb3b69378152
Reviewed-on: https://gerrit.instructure.com/134518
Tested-by: Jenkins
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Marc Alan Phillips <mphillips@instructure.com>
2017-12-04 21:07:03 +00:00
Andrew Gardener 7a4b4d82b8
Add term name to tools variable substitutions
test plan:
* add a new custom field, `term_name=$Canvas.term.name`, to an external tool
* open launch link to external tool
* verify that `custom_term_name` was part of the launch request and is correct
2017-11-22 13:03:32 -08:00
Ryan Shaw cc49521daa Fix link & brand-primary color HC & ie11
Closes: CNVS-38498 CORE-25 CORE-338

test plan:
* turn on high contrast
* using ie11, make sure that all the links and things that should
  be the brand-primary color look right. (Dark, not light, blue)
* make sure they also look good in edge 15 and chrome with HC on.

Change-Id: I83cb35aa40c774bcd8e4c0a1a18b8cb0875e9a0c
Reviewed-on: https://gerrit.instructure.com/129911
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
2017-11-02 17:36:22 +00:00
wdransfield c0f7738cea Add text editor contents and selection variable expansions
Closes PLAT-2792

Test Plan:
- Install a tool that uses the new
  'com.instructure.Editor.contents' and
  'com.instructure.Editor.selection' varaiable
  expansions in a content item launch.
- Navigate to a page that uses the RCE
- Enter some content in the editor and highlight
  a portion of that content.
- Do a launch and verify the complete contents of the
  editor is sent as com.instructure.Editor.contents and
  the selected content is sent as com.instructure.Editor.selection.

Change-Id: Id2b3104b6324aa62d9ae3025b593de367eb5d6a3
Reviewed-on: https://gerrit.instructure.com/129005
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-10-16 20:10:02 +00:00
Jeff Belser 9a78c89799 variable substitution for brand config JSON
refs PLAT-2840

Test plan:
  1. Install an LTI tool with the variable substitution:
     `com.instructure.brandConfigJSON`
  2. Ensure that it appears on launch as the brand config JSON
  3. Ensure it is well documented within variable expander writeup
  4. Tests pass

Change-Id: I4bfa7db8e89fa0f0ae2b0a81a610b97e556d69e9
Reviewed-on: https://gerrit.instructure.com/128374
Reviewed-by: Andrew Butterfield <abutterfield@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Tested-by: Jenkins
Product-Review: Jeff Belser <jbelser@instructure.com>
2017-10-13 22:25:55 +00:00
Andrew Butterfield d29aaaf6a1 Add Lti Link model for LTI 2 launches
refs PLAT-2724

Test plan:
* Regression test plagiarism platform

Change-Id: I98fd4efc5f259bd73747337d07a7e2ec2508dbb0
Reviewed-on: https://gerrit.instructure.com/122906
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Reviewed-by: Nathan Mills <nathanm@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Keith T. Garner <kgarner@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Andrew Butterfield <abutterfield@instructure.com>
2017-10-02 22:32:18 +00:00
Andrew Butterfield 6b3e3389a9 Add LTI variable substitutions for brand config urls
fixes PLAT-2840

Test plan:
* Install a tool with the following variable substitutions
  com.instructure.brandConfigJSON.url
  com.instructure.brandConfigJS.url
* Ensure that they are subtituted on launch
* Ensure that the variable expander documentation includes these
  substitutions

Change-Id: I0c0287b8b4bd029c9dd0619a5f08d8a3b9306c02
Reviewed-on: https://gerrit.instructure.com/126806
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Andrew Butterfield <abutterfield@instructure.com>
2017-09-27 18:04:44 +00:00
wdransfield 7464d9fb31 Handle multiple tool on the page when resizing
Closes PLAT-2738

Test Plan:
- Install two lti tools that use the new
  'com.instructure.PostMessageToken' variable expansion.
- Visit a page with two LTI tools launched (this happens when
  launching a tool in a course that has chat enabled).
- Have one tool send a resize post message and verify the correct
  tool is resized. The post message should include the token
  for the value of 'token':

  <script type="text/javascript">
   parent.postMessage({
      subject: 'lti.frameResize',
      height: 12000,
      token: '<%= @wrapper_id %>'
   }, '*');
  </script>

- Verify the proper tool is resized.

Change-Id: Ie7e976c5cd53ef5c61cd86c471ba416045a0fb68
Reviewed-on: https://gerrit.instructure.com/119858
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Andrew Butterfield <abutterfield@instructure.com>
Tested-by: Jenkins
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2017-08-18 16:30:28 +00:00
wdransfield c1e2c199b4 Add com.instructure.Assignment.lti.id variable expansion
Closes PLAT-2715

Test Plan:
- Verify the default tool consumer profile contains
  the com.instructure.Assignment.lti.id capability.
- Install a plagiarism detection tool that uses an
  LTI launch for display originality reports. The
  message in the resource handler associated with
  the originality report launch should have the
  com.instructure.Assignment.lti.id enabled. The
  message associated with the
  `Canvas.placements.similarityDetection` capability
  should also have the the new capability enabled.
- Associated the tool with an assignment. Verify that
  a parameter named com_instructure_assignment_lti_id
  is sent in the launch from the create/edit UI. Its
  value should match the ext_lti_assignment_id param.
- Create an originality report and do the associated
  tool launch.
- Verify a com_instructure_assignment_lti_id parameter
  is sent. The value should match the ext_lti_assignment_id
  sent in the assignment creattion config launch.

Change-Id: I722dd16a6cc5e62a447f76f10e9f0f582a11a33a
Reviewed-on: https://gerrit.instructure.com/119029
Reviewed-by: Nathan Mills <nathanm@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Tested-by: Jenkins
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2017-07-17 15:25:19 +00:00
wdransfield 2c0bfb9efb Add Context.title variable expansion
Closes PLAT-2699

Test Plan:
- Add an LTI2 tool that uses `Context.title` in one of its
  message's enabled_capability array.
- Launch the tool from a course and verify that the `context_title`
  param is set to the name of the course.
- Launch the tool from an account and verify that the `context_title`
  param is set to the name of the account.

Change-Id: I6e734b36022bbd3e7f4ab2dc920271ea8da6df71
Reviewed-on: https://gerrit.instructure.com/117863
Tested-by: Jenkins
Reviewed-by: Andrew Butterfield <abutterfield@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2017-07-07 21:12:50 +00:00
wdransfield 55fce28b93 Add submisson, attachment, and report id variable expansions
Closes PLAT-2688

Test Plan:
- Install an plagiarism detection tool that uses
  LTI launches for displaying originality reports.
  The message handler for these launches should have
  com.instructure.OriginalityReport.id,
  com.instructure.Submission.id,
  and com.instructure.File.id in it's enabled
  capability array.
- Create an originality report with the tool and
  launch the originality report.
- Verify that parameters for each of these three
  capabilities are send and set correctly.

Change-Id: I2cb246e3a48f5e63a60ff6a0d90a003aaf9c8d62
Reviewed-on: https://gerrit.instructure.com/116377
Reviewed-by: Andrew Butterfield <abutterfield@instructure.com>
Reviewed-by: Nathan Mills <nathanm@instructure.com>
Tested-by: Jenkins
QA-Review: August Thornton <august@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2017-07-05 18:49:40 +00:00
wdransfield 683aab7790 Varaible expansions for LTI2 service endpoints
Closes PLAT-2690

Test Plan:
- Test the following variable substitutions. Each should get set
  to their corresponding service URL (the endpoint of the each
  service can be found in the tool consumer profile or in each
  lti api controller).

Change-Id: I37f756cabd0e38e7ea850cdfff7c37e4b8886a85
Reviewed-on: https://gerrit.instructure.com/116480
Tested-by: Jenkins
Reviewed-by: Andrew Butterfield <abutterfield@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2017-06-29 13:30:27 +00:00
Nathan Mills 31acbd956a lti2 cert fixes
refs PLAT-2640

test plan:
we should be able to pass certification

Change-Id: I4508af544e1dcacec42180d96865e7ef841c8ff8
Reviewed-on: https://gerrit.instructure.com/116171
Tested-by: Jenkins
Reviewed-by: Andrew Butterfield <abutterfield@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Nathan Mills <nathanm@instructure.com>
2017-06-22 17:27:38 +00:00
wdransfield 233d53dcc0 Send all available variable substitutions in TCP
Closes PLAT-2606

Test Plan:
- Install an LTI2 tool and verify
  that the tool consumer profile now contains
  all variable expansions in the enabled capability
  section.
- Include these capabilities as parameters, do a
  launch, and verify that the applicable expansions
  are replaced.

Change-Id: Ia97f0184c94eeeb33c5851c715770f209a21c3c2
Reviewed-on: https://gerrit.instructure.com/113014
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-06-12 19:13:03 +00:00
Brad Humphrey 1339a8d126 Merge branch 'dev/platform/content-item' into HEAD
test plan:
This commit adds privacy level contro to content item selection requests
for the following fields:
  lis_person_contact_email_primary, lis_person_name_given,
  lis_person_name_full, lis_person_name_family, lis_person_sourcedid,
  lis_course_offering_sourcedid, and context_label

These fields should appear for the same privacy levels as they do for a
basic lti launch.  If the same tool is used in both a basic lti launch request
and a content item selection request, the above fields should either be
present on both launches or absent on both launches (depending on the
privacy level currently selected for the tool).

This commit also refactors how content item selection launches are
constructed, so it would be good to run a basic regression test on
content item selection launches in general.

fixes PLAT-2447

Change-Id: If55e9c84b3ddd91bdf700a8bbbb02d8f9a7e6e1f
2017-05-15 13:30:25 -06:00
wdransfield d44bc1a82d Add privacy level dependant params to content item
closes PLAT-2447

Test Plan:
Verify the following parameters are sent in all
content item selection requests when the tool is
set to the specified privacy level:

* Privacy Level: 'Name Only'
  - lis_person_name_given
  - lis_person_name_family
  - lis_person_name_full

* Privacy Level: 'Email-only'
  - lis_person_contact_email_primary'

* Privacy Level: 'Public'
  - lis_course_offering_sourcedid (must be LTI course)
  - All params in email only and name only

* Privacy Level: 'Anonymous'
 - None of the above params

Change-Id: I0794501e8a112fd910f35c1b93606e54fd0d2a19
Reviewed-on: https://gerrit.instructure.com/110966
Tested-by: Jenkins
Reviewed-by: Brad Humphrey <brad@instructure.com>
Product-Review: Brad Humphrey <brad@instructure.com>
QA-Review: Brad Humphrey <brad@instructure.com>
2017-05-12 22:12:31 +00:00
wdransfield 1c406af7b7 Send context_label in content item selection request
closes PLAT-2445

Test Plan:
Do a content item selection request and verify the 'context_label'
param is present and set the the course code.

Change-Id: I2e92aec4605c79a919b73fd164dc6ad9df14df37
Reviewed-on: https://gerrit.instructure.com/110696
Reviewed-by: August Thornton <august@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Tested-by: Jenkins
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
Product-Review: Brad Humphrey <brad@instructure.com>
Reviewed-by: Brad Humphrey <brad@instructure.com>
2017-05-12 22:11:12 +00:00
Han Yan 4479502973 add uuid as custom field as part of lti launch payload
closes QUIZ-1705

test plan:
- we should see custom_canvas_course_uuid field in lauch parameter set

Change-Id: If5385d34003f22c4b9ade63e56aa5adfaf6a93c8
Reviewed-on: https://gerrit.instructure.com/110480
Tested-by: Jenkins
Reviewed-by: John Corrigan <jcorrigan@instructure.com>
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: Michael Hargiss <mhargiss@instructure.com>
Product-Review: John Corrigan <jcorrigan@instructure.com>
2017-05-11 18:04:05 +00:00
Cody Cutrer 99f5b454ed refactor and unify User#find_pseudonym_for_account and SisPseudonym
fixes CNVS-35919

also, prefer SIS pseudonyms over non-SIS pseudonyms from any given
account

test plan:
 * have a non-SIS pseudonym and a SIS pseudonym on a user
 * do an LTI launch
 * the LTI tool should get the info from the SIS pseudonym

Change-Id: I60a3c48a32eae94db93b0e72f1f0f6c5b6a5f5c2
Reviewed-on: https://gerrit.instructure.com/107785
Reviewed-by: Nathan Mills <nathanm@instructure.com>
Reviewed-by: Tyler Pickett <tpickett@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Tested-by: Jenkins
Product-Review: Cody Cutrer <cody@instructure.com>
2017-05-02 18:50:31 +00:00
Landon Wilkins d198a52517 da licença part 31
add consistent license headers to all source files
(ruby, coffeescript, javascript)

except for vendor files

Change-Id: I7b353d1ec31c36c0b12df7feb09fff743dc8a985
Reviewed-on: https://gerrit.instructure.com/110056
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:59:58 +00:00
wdransfield 825ac340ba Update ToolProxyBinding.memberships.url docs
Closes PLAT-2419

Test Plan:
Generate documentation and verify the
ToolProxyBinding.memberships.url variable substitution
has a note about being for future use.

Change-Id: If380aa043da8249e5d5237e73c24692284d9ca21
Reviewed-on: https://gerrit.instructure.com/106668
Tested-by: Jenkins
Reviewed-by: August Thornton <august@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2017-03-29 14:45:08 +00:00
Brad Horrocks bbfe35b108 update variable expanders
Add docs on how to update them
Update everytime we run doc:api

Change-Id: I3c7aa55d051fa5474e267897138ab01c3c7c3fb8
Reviewed-on: https://gerrit.instructure.com/102177
Reviewed-by: Jesse Poulos <jpoulos@instructure.com>
Reviewed-by: Nathan Mills <nathanm@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Tested-by: Jenkins
Product-Review: Brad Horrocks <bhorrocks@instructure.com>
2017-02-27 23:15:19 +00:00
Nathan Mills 4ecc648078 add lti option to prefer sis email
fixes PLAT-2324

test plan:

output to test:
 the lti message parameters :
   `lis_person_contact_email_primary`
  variable expansions:
   `Person.email.primary`
   `vnd.Canvas.Person.email.sis`

- test that the above outputs behaviour hasn't changed
- add <lticm:property name="prefer_sis_email">true</lticm:property>
to the extension settings portion of the xml config
- make sure you don't have an sis email
- the behavior shouldn't change
- set an sis email address
- you should now get the sis email for
`lis_person_contact_email_primary`

- test that the behaviour of `vnd.Canvas.Person.email.sis` hasn't
changed

Change-Id: Iaca2e036170ed1173309fd4596a4d6e1b016b6dd
Reviewed-on: https://gerrit.instructure.com/103195
Tested-by: Jenkins
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
Reviewed-by: Matthew Wheeler <mwheeler@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Nathan Mills <nathanm@instructure.com>
2017-02-27 17:57:23 +00:00
Nathan Mills b5b157bd34 add tool_consumer_profile table
fixes PLAT-2243 PLAT-2244 PLAT-2224

test plan:

-from a rails console create a ToolConsumerProfile associated to a
developer key with custom capabilites and services
-request the TCP using the developer key
-it should include the custom capabilites and services

-request a TCP without dev credentials
- it should work as before

-install a LTI2 tool using custom services and capabilities
-it should install

-install an LTI2 tool the normal way
-it should still work

Change-Id: Icbbab37737ba1b4c621caadb15fec79ad8ac5776
Reviewed-on: https://gerrit.instructure.com/101673
Tested-by: Jenkins
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Andrew Butterfield <abutterfield@instructure.com>
Product-Review: Nathan Mills <nathanm@instructure.com>
2017-02-22 23:08:38 +00:00
Brad Humphrey 9fad40e8de add variable expansion for getting uuid on root accounts
test plan
 - add a custom variable expansion for $vnd.Canvas.root_account.global_id
  * it should be substituted for root_account.uuid in any LTI launch
 - the capability vnd.Canvas.root_account.global_id should appear in the
   tool consumer profile
 - install an LTI 2 tool that requests the capability
   vnd.Canvas.root_account.global_id
  * launches should come with
    vnd_canvas_root_account_id=<root_account.uuid>

fixes PLAT-2267

Change-Id: I23be140c22c0edd8e20460f648c51cc570a45e80
Reviewed-on: https://gerrit.instructure.com/102077
Tested-by: Jenkins
Reviewed-by: Nathan Mills <nathanm@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Brad Humphrey <brad@instructure.com>
2017-02-15 19:19:31 +00:00
wdransfield 5304c98661 LTI2 only send Context.id when requested
Fixes PLAT-2246

Test Plan:
- Install an lti2 tool without
  the 'Context.id' capability
  enabled.
- Launch the tool and verify that
  the context_id param is absent.
- Install an lti2 tool with the
  'Context.id' capability
- Launch the tool and verify that
  the context_id param is present.
- Verify the Context.id capability
  is preseint in the TCP.

Change-Id: I164f2ca675d77c9ad743d0dad0f8d4ee7364444c
Reviewed-on: https://gerrit.instructure.com/101478
Tested-by: Jenkins
Reviewed-by: Nathan Mills <nathanm@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2017-02-13 20:11:27 +00:00
wdransfield adff709f9d Add variable substitution capabilities to TCP
Fixes PLAT-2235

Test Plan:
- Get the Canvas TCP and verify it contains all
  capabilities listed in lib/lti/capabilities_helper.rb:3
  in its capability_offered section.
- Install an LTI2 tool, launch it, and verify
  none of the following parameters are sent in
  the launch:
  * launch_presentation_document_target
  * launch_presentation_locale
  * tool_consumer_instance_guid
  * lis_course_section_sourcedid
  * roles
  * lis_person_sourcedid
 - Each of the above params now have an associated
   capability offered by Canvas. If a TP wants
   one of the above parameters sent in their
   tool launch they must include the associated
   capability in their enabled_capability section
   of the tool proxy.

   Verify adding the associated capability in the
   tool profile causes the paramter to be sent
   in the tool launch. See variable_expander.rb
   docs for a mapping of capabilities to
   variable names

Change-Id: I027d079d9d3cf53715fcf8ca4d9d8759af02cb88
Reviewed-on: https://gerrit.instructure.com/101336
Reviewed-by: Nathan Mills <nathanm@instructure.com>
Tested-by: Jenkins
QA-Review: August Thornton <august@instructure.com>
Product-Review: Weston Dransfield <wdransfield@instructure.com>
2017-02-13 17:33:17 +00:00
Anti Revoluzzer 139fcc1949 Add Canvas.course.name LTI substitution
Fixes: SIS-2719

Test Plan:

1. Tests pass

2. Install a tool that has a placement in the context of a course

3. Include the following custom variable in the xml config
   course_name=$Canvas.course.name

4. Ensure that on launch the variable is properly expanded to the
   name of the course

Change-Id: I0bea24f4986aa9985f4c4f2117ca985b1ac3da15
Reviewed-on: https://gerrit.instructure.com/100812
Tested-by: Jenkins
Reviewed-by: Brad Humphrey <brad@instructure.com>
QA-Review: Mark McDermott <mmcdermott@instructure.com>
Product-Review: Brad Humphrey <brad@instructure.com>
2017-02-09 03:59:42 +00:00
Jesse Poulos f8119abfe9 add custom variable for institution assigned (i.e. sis) email
Before this fix, there was not a way to determine the launching users sis
added email address without accessing API. This causes pain for some
integrations that relied on the lis_person_sourced_id since that value can
change if the user changes their default email (i.e. stars a different email).
This update adds a way to send the users institution assigned email during an
LTI launch.

Test plan:
1) create a course
2) create a user and enroll them in the course
3) create another user via SIS and enroll them in the course
4) install a tool with the $Person.email.sis custom field
5) launch the tool as each user added in 2 and 3
6) verify that
      1) the default value of "$Person.email.sis" is passed in
      the launch parameters for the user that *was not* added via SIS and
      2) the value of the email assigned to the user that *was* added via SIS is
      passed in the launch

Fixes PLAT-2164

Change-Id: Ibbc15c8a3108d51aac680f7b4cd778e2677927b9
Reviewed-on: https://gerrit.instructure.com/99503
Reviewed-by: Nathan Mills <nathanm@instructure.com>
Tested-by: Jenkins
QA-Review: August Thornton <august@instructure.com>
Product-Review: Jesse Poulos <jpoulos@instructure.com>
2017-01-16 21:02:51 +00:00
Jesse Poulos 2ef7a5191e add custom variable for course workflow_state
Before this fix, there was not a way to determine the workflow_state of the
course without accessing API. This fix adds a way to send the course
workflow_state during an LTI launch.

Test plan:
1) create a course
2) install a tool with the $Canvas.course.workflowState custom field
3) launch the tool and verify that the course workflow_state is passed in
the launch parameters

Fixes PLAT-1956

Change-Id: I933ddcd45c689ecd054e692c7e4dc993874dc995
Reviewed-on: https://gerrit.instructure.com/94987
Tested-by: Jenkins
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
Reviewed-by: Andrew Butterfield <abutterfield@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Jesse Poulos <jpoulos@instructure.com>
2017-01-13 19:56:20 +00:00
Jesse Poulos 4ec3f40825 Updates the variable expansion documentation
The variable expansion documentation has instances of information being
outright incorrect, or just confusing. Furthermore, there are no examples
of how to invoke custom fields via variable expansion. For everything
(except the `Canvas.file` type variables), I've documented what is actually
returned as well as an example of what the data might look like. I've also
added examples of how tools can be configured to use custom fields (via
API, UI, or XML).

Test Plan:
Test plan:
1) run localhost Canvas
2) build the API docs (docker-compose run --rm web bundle exec rake
doc:api)
3) navigate to the following:
<your host url>/doc/api/file.tools_variable_substitutions.html
4) check for spelling, grammar, accuracy of information and that any links
work

Fixes PLAT-2022

Change-Id: I754bc2c5e48d4cdd4738c6d03d4d7e3c12a621b1
Reviewed-on: https://gerrit.instructure.com/96801
Tested-by: Jenkins
Reviewed-by: Andrew Butterfield <abutterfield@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Jesse Poulos <jpoulos@instructure.com>
2017-01-10 17:24:31 +00:00
Matthew Sessions cf5981fa89 Add isRootAccountAdmin variable expansion
Fixes MBL-6967

Test Plan:
 - Set up an lti tool with the custom expansion of
   Canvas.user.isRootAccountAdmin
 - On LTI launch it should be true for root account
   admins and false for non root account admins

Change-Id: I96b12a1f7eb3b7819a9040895216cf222d53c133
Reviewed-on: https://gerrit.instructure.com/95499
Reviewed-by: August Thornton <august@instructure.com>
Reviewed-by: Nathan Mills <nathanm@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Tested-by: Jenkins
Product-Review: Matthew Sessions <msessions@instructure.com>
2016-11-17 20:21:54 +00:00
Tyler Pickett 8898927e25 Establish LTI content migration plugin
This gets some of the infrastructure in place to handle this process
along with the start export method.

Change-Id: Id757a111aeb64c307021eb621e0624b0b3d8b7eb
Fixes: PLAT-1755 PLAT-1758
Reviewed-on: https://gerrit.instructure.com/93853
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Nathan Mills <nathanm@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Tyler Pickett <tpickett@instructure.com>
2016-11-08 20:18:07 +00:00
Nathan Mills 3d925feb90 fix incorrect canvas.externaltool.url substitution
Fixes #880  Github issue

fixes PLAT-1770

test plan:
add a tool installed at the account level with the
"Canvas.externalTool.url" variable expansion

the substituted value should be the tools context not the launch
context i.e. if the tool is launched from a course below the
account it is installed on it should be a url for the account.

also the returned url should be the correct api endpoint for the
tool

Change-Id: Ibb166240c96fb01b31bc2d5055b67f16e107878c
Reviewed-on: https://gerrit.instructure.com/88539
Tested-by: Jenkins
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Nathan Mills <nathanm@instructure.com>
2016-08-25 17:58:48 +00:00
Andrew Butterfield 7d94939784 Add variable substitution for collaboration members
fixes PLAT-1621

Test plan:
* Install a tool with collaboration placement and
  $Canvas.api.collaborationMembers.url custom variable
* Ensure that the variable is substituted for the collaboration update
  launch but not for collaboration create or show

Change-Id: I5826ed51d4d4a6a1099cb8077cd9748333e7417e
Reviewed-on: https://gerrit.instructure.com/83544
Tested-by: Jenkins
Reviewed-by: Nathan Mills <nathanm@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Andrew Butterfield <abutterfield@instructure.com>
2016-06-24 19:32:41 +00:00
Ryan Taylor 6b57f5e76c Add documentation to LTI Assignment workflow state variable
Refs CNVS-30048

Test Plan:
 - Pretty much good

Change-Id: Ia3b93b987b84b233c33891011db7995cae07c8b5
Reviewed-on: https://gerrit.instructure.com/83140
Tested-by: Jenkins
Reviewed-by: Brad Humphrey <brad@instructure.com>
QA-Review: Michael Hargiss <mhargiss@instructure.com>
Product-Review: Chris Wang <cwang@instructure.com>
2016-06-23 21:06:25 +00:00
Ryan Taylor b0958b2321 Add workflow_state of assignment to LTI payload var options
Aids us in Quizzes 2.0 to make it easier to show context to teachers

Closes CNVS-30048

Change-Id: I8f551c98fff3bdc3c753d4e72bf91ad5971fcc63
Reviewed-on: https://gerrit.instructure.com/82740
Tested-by: Jenkins
Reviewed-by: Chris Wang <cwang@instructure.com>
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
QA-Review: Michael Hargiss <mhargiss@instructure.com>
Product-Review: Chris Wang <cwang@instructure.com>
2016-06-20 20:34:57 +00:00
Andrew Butterfield 602d502f5d Add variable substitution for user groups
fixes PLAT-1606

Test plan:
* Create some groups in a course and add a user to them
* Install a tool that has a collaboration and course navigation
  placement
* Include the following custom variable in the xml config
  user_group_ids=$Canvas.user.courseGroupOpaqueIds
* Ensure that on launches where the context is a course the variable is
  properly expanded to include a list of context ids for the groups the
  user launching is a part of in the course
* The variable substitution for membership service changed to
  $ToolProxyBinding.memberships.url
* Ensure that the membership service variable expansion still works in
  both the group and course context

Change-Id: I31a2a56e8d3b0c528f2cebe82c63148afdc80722
Reviewed-on: https://gerrit.instructure.com/82633
Tested-by: Jenkins
Reviewed-by: Brad Humphrey <brad@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Andrew Butterfield <abutterfield@instructure.com>
2016-06-17 16:58:49 +00:00
Nathan Mills e737bd9715 only send the tc profile url for lti2
refs PLAT-1571

test plan:
lti 1 launches shouldn't include the tool_consumer_profile_url
lti 2 launches should still include it
Change-Id: I72dd2d1eff13e015510c8c20bc73ab9ab961f561
Reviewed-on: https://gerrit.instructure.com/81862
Tested-by: Jenkins
Reviewed-by: Andrew Butterfield <abutterfield@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Nathan Mills <nathanm@instructure.com>
2016-06-15 15:28:49 +00:00
Matthew Wheeler d06cf7bc69 Round pointsPossible variable substitution if a whole number
Fixes PLAT-1498

Test Plan:

With the test tool, create a new assignment with
100 points possible. The value posted to the tool 
for the points_possible variable expansion should
be "100" not "100.0". A assignment with 100.5 points
possible should post as "100.5".

Change-Id: I5eaf29817a7a71626f1407cda4c75a3853c816d3
Reviewed-on: https://gerrit.instructure.com/79297
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Brad Humphrey <brad@instructure.com>
Tested-by: Jenkins
QA-Review: August Thornton <august@instructure.com>
Product-Review: Karl Lloyd <karl@instructure.com>
2016-05-11 16:27:36 +00:00
Andrew Butterfield bee6437f5a Adjust variable substitution for membership service
fixes PLAT-1450

Test plan:
* Using the test tool https://lti-tool-provider-example.herokuapp.com/
  set up some XML for a tool that has a 'collaboration' placement and
  custom variable with the following variable substitution
    $Canvas.api.membershipServiceUrl
* Ensure that on a course collaboration launch the membership service
  url is of the following form
    /api/lti/courses/:course_id/membership_service
* Ensure that on an account group collaboration or course group
  collaboration launch the membership service url is of the following
  form
    /api/lti/groups/:group_id/membership_service

Change-Id: I38ce63ba0d95a12963e99251c2abf660573e9c7b
Reviewed-on: https://gerrit.instructure.com/78276
Reviewed-by: Nathan Mills <nathanm@instructure.com>
Tested-by: Jenkins
QA-Review: August Thornton <august@instructure.com>
Product-Review: Andrew Butterfield <abutterfield@instructure.com>
2016-05-04 18:57:04 +00:00
Brad Horrocks f51cefcc67 Better LTI Variable Substitution Docs
Generate LTI Variable Substitution Docs from the code
Uses YARD's plugin hooks to generate the markdown.

I couldn't find a good way to do this with YARDs builtin generation
stuff. So I hacked together. No pretty, but gets the job done.

You can update the generated markdown by running this
```
script/generate_lti_variable_subustition_markdown
```

Our yard templates, dont process markdown files like YARD is supposed
to.i Not sure why? 🤷

Fixes https://github.com/instructure/canvas-lms/issues/592

Change-Id: If0728d357dc745d81381e818ed62d087d76f0e66
Reviewed-on: https://gerrit.instructure.com/74312
Reviewed-by: Andrew Butterfield <abutterfield@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Tested-by: Jenkins
Product-Review: Brad Horrocks <bhorrocks@instructure.com>
2016-05-02 19:15:46 +00:00
Andrew Butterfield 754c5d58f2 Add variable substitution for membership service url
fixes PLAT-1387

Test plan:
* Using the lti test tool create a tool that can launch from an account
  context and a course context
* Add a custom param with the following key: value pair

  $Canvas.api.membershipServiceUrl

* Ensure that in the course context the variable substitution occurs but
  that in the account context it does not.

Change-Id: If2bf3b2c1b91229021b8d0f8cf3e7b83366eafcf
Reviewed-on: https://gerrit.instructure.com/75907
Reviewed-by: Nathan Mills <nathanm@instructure.com>
Tested-by: Jenkins
Reviewed-by: Matthew Wheeler <mwheeler@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Andrew Butterfield <abutterfield@instructure.com>
2016-04-01 19:17:31 +00:00
Cody Cutrer b7f00ab032 document and extend usage of integration_id for users
refs CNVS-26735

test plan:
 * create a user, pseudonym, and update a pseudonym via API
   setting integration_id
 * it should work
 * with a user with an integration id set, launch an LTI tool
   with the Canvas.user.sisIntegrationId variable being sent;
   ensure it gets sent

Change-Id: I549ba6e64e993c4867acfe33577722c1118b8988
Reviewed-on: https://gerrit.instructure.com/70874
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins
Reviewed-by: Brad Humphrey <brad@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2016-02-18 20:11:01 +00:00
Brad Horrocks cf1adc2978 LTI Reregistration
add support for reregistration launches
Allow tool providers to send updated tool proxies

Saves the payload and acknowledgment url in the update_payload field
Show an update indicator, and options to update or dismiss the update
basic UI functionality

fixes: PLAT-1247
Fixes PLAT-1276
Fixes PLAT-1248

Test Plans:

using the test tool you should be able to install it,
then from the gear context menu you should be able to do a reregistration
launch the tool and canvas only support the launch right now, and not the
rest of the process

Populate update payload on a tool proxy (LTI2 tool)
make sure a badge is displayed indicating there is an update available
make sure you the options to update or dismiss are displayed
make sure when you update it actually updates, and no longer shows an
update is available
make sure when you dismiss it no longer show an update

Change-Id: I93e2db40f81523e9518e529460ea2b16f5de103a
Reviewed-on: https://gerrit.instructure.com/68004
Reviewed-by: Brad Horrocks <bhorrocks@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Nathan Mills <nathanm@instructure.com>
Tested-by: Jenkins
Product-Review: Brad Horrocks <bhorrocks@instructure.com>
2015-12-17 23:26:05 +00:00