Added a basic variable substitution framework and implemented
a few variables as examples: $Person.name.full,
$Person.name.given, $Person.name.family
Added a concluded enrollment roles variable so that a tool
can know what a users concluded roles were. The variable is
$Canvas.membership.concludedRoles
Variable names are case sensitive.
Test Plan:
* Create an lti tool launch with a custom key like this:
* custom_my_var=$Person.name.full
* With a concluded user do a tool launch that has the
$Canvas.membership.concludedRoles variable
* it should list the concluded roles
* Configure tools through an XML file with a custom param
and make sure it works
Change-Id: Iefb85c441680c7ab3623ce85e405e1c48cda837c
Reviewed-on: https://gerrit.instructure.com/21193
QA-Review: Clare Strong <clare@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brad Humphrey <brad@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
test plan:
- Create a tool (http://lti-tool-provider.herokuapp.com/)
- Create a user with a pseydonym that doesn't have an sis id
- Launch the tool as the new user
- The launch should contain custom_canvas_user_login_id and should not contain lis_person_sourcedid
Change-Id: I3aa8618ac656eb475e8e2d26924634ff07943860
Reviewed-on: https://gerrit.instructure.com/20958
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Severson <markse@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
fixes PS-271
test plan
-create custom admin role
-launch lti tool, admin role is avail.
Change-Id: I4f93eee990e8b89cf6265a3fee19bafdb7ef62a4
Reviewed-on: https://gerrit.instructure.com/20017
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
this commit is to help make canvas extensions more robust by
allowing tool level defaults and allowing both tool domains and launch
urls. Also added some helper methods for getting the correct properties,
and refactored to use the new helper methods.
Test Plan:
- Add a tool with both a domain and an launch url
- It should not give an error
- Add a tool configured with defaults for for canvas extensions
(such as icon_url, url, selection_height, selection_width, etc)
- Add a canvas launch (resource_selection, editor_button, course_navigation, etc)
with minimal configuration
- The canvas launch should inherit the properties from the extensions default
- Add an launch that has its own properties
- The launch should prefer its properties over the defaults
* should test that all launch types are accepting defaults
closes #CNVS-4498
Change-Id: I0dd4e78efb54db9c0cd1204383934db50f402674
Reviewed-on: https://gerrit.instructure.com/17715
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
adds a new LTI extension, "content", that
defines the interaction for sending content from
a tool provider to the tool consumer. This extension
will replace the "embed_content" and '"select_link"
selection_directives, as well as adding allowing
am external tool to submit content for a homework
submission.
also starts sending intended_use, return_types, return_url
and file_extensions as part of the LTI launch with the new
extension.
test plan:
- make sure the "more" tab only shows up when there are valid tools
- install at least one valid tool
(make a homework_submission tool by taking the xml for
a resource_selection tool and replace "resource_selection"
with "homework_submission")
- click "more"
- make sure you can't submit the assignment when no
resource has been selected
- set an assignment that only allows file uploads
- try selecting a url from the tool
- make sure it errors out
- set an assignment that only allows file uploads
- limit the file types
- try selecting a file with a non-supported file extension
- make sure it errors out
- set an assignment that only allows file uploads
- try selecting an invalid file from the tool
- try submitting the homework
- make sure it errors out gracefully
- set an assignment that only allows file uploads
- try selecting a file from the tool
- make sure the submission works correctly
- set an assignment that only allows urls
- try selecting a file from the tool
- make sure it errors out
- set an assignment that only allows urls
- try selecting a url from the tool
- make sure the submission works correctly
Change-Id: I8df682bc73087681159110ab02f77f0e5a2b3911
Reviewed-on: https://gerrit.instructure.com/13419
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Product-Review: Brad Humphrey <brad@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
test plan:
- launch an lti tool as a TA
- the tool should receive 'urn:lti:role:ims/lis/TeachingAssistant' in the role param
closes #CNVS-4499
Change-Id: Id3a528ef937cd5a7817ae36fa5fcd45910f1e75a
Reviewed-on: https://gerrit.instructure.com/18844
Reviewed-by: James Williams <jamesw@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
the guid will come from the external tool's root account if it is launched from a user context
test plan:
- install a tool that can launch from the account, course, and user navigation
- launch the tool from each location
- they should all have the same guid in the launch params
Change-Id: I8760e0e316a32c04930fff4fd28cd4d18fd4c109
Reviewed-on: https://gerrit.instructure.com/18542
QA-Review: Adam Phillipps <adam@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
adds a parameter to indicate the enrollment state for a course
in the lti launch parameters
test plan:
* create an external tool module item for a course
* check the "open in new tab" option
* click on the module item link
* inspect the source page elements and look for an "input"
tag with "custom_canvas_enrollment_state", that will either
show "active" or "inactive" based on the current user's
enrollment state
fixes #CNVS-4264
Change-Id: I2cff488ef178a87f5aacaadbeeb47338ca41b424
Reviewed-on: https://gerrit.instructure.com/18499
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
This allows us to make changes with how we generate that
id without breaking tool providers who depend on the old
way
This also sets the lti_quid to the value it was before the
1c6ae6979e change
Test Plan:
* Exiting root accounts lti_guid attribute should have the domain name in it
* New accounts will use the accounts UUID and thus have no domain name
refs CNVS-3829
Change-Id: Ib5b10cb097d3f0e5c562d1af70f5770217418e63
Reviewed-on: https://gerrit.instructure.com/18481
Reviewed-by: Zach Wily <zach@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Tested-by: Bryan Madsen <bryan@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
switch it so it isn't dependent on domain or shard
fixes #CNVS-3829
Change-Id: I29f168b2ee345874437cbf2e1d759e55aebe63d6
Reviewed-on: https://gerrit.instructure.com/17655
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Bracken Mosbacker <bracken@instructure.com>
test plan:
1. run the specs
Change-Id: Ie2ca5ba3c12eac62818570f19ba82825a2cadfd1
Reviewed-on: https://gerrit.instructure.com/15893
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Joe Tanner <joe@instructure.com>
QA-Review: Ryan Florence <ryanf@instructure.com>
The assignment title and points possible in canvas are now
sent.
Test Plan:
* Create an external tool assignment
* Launch the tool in a new tab so that you can inspect the form
* Inspec the form and notice that the assignment title/points_possible are there
closes#10385
Change-Id: Ib9a3490d78ff6ff5ee2aa2ae49e3ce2faaf081ff
Reviewed-on: https://gerrit.instructure.com/13454
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Whitmer <brian@instructure.com>
This creates an LTI extension to pass text or urls along
with the score when doing an LTI 1.1 outcome request.
Test Plan:
* use a tool that supports this extension on an assignment
* After doing the tool activity the submission should have the expected value
refs #mebipenny
Change-Id: I296df1e7c7d99af61724a904511f9bf63d5d2613
Reviewed-on: https://gerrit.instructure.com/12878
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Test Plan:
* Configure a tool on an account/course/user profile
* When the tool launches verify the appropriate lis_*_sourcedid and canvas_*_sis parameters are present
closes#7740
Change-Id: Ie2f61678e03507e5364542e7ad4d7eea0504da59
Reviewed-on: https://gerrit.instructure.com/11720
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
fixes#9080
if I18n.localizer has been set it, call it during BasicLTI
generation instead of waiting for the first call to translate.
this ensures that the locale is set in time for it to be
populated in the launch_presentation_locale param.
test plan:
* enroll a user in two courses that are offered in two different
languages (e.g. an english course and a spanish course);
* open each course in separate window, and create an external tool
assignment that opens in a new tab in one of the courses;
* load the external tool page, and verify that the value of the
#launch_presentation_locale form element is correct;
* in the second course, load a page;
* reload the external tool page and verify that the
#launch_presentation_locale value is still correct and not the
language of the second course.
* repeat these same steps using different users for each course
* and
verify that the locale is still properly set in the external
tool field.
Change-Id: If4b996317be23a17c824b8000026ac9b7549e0a4
Reviewed-on: https://gerrit.instructure.com/11675
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
These fields are required for LTI compliance
Test Plan:
* Launch a tool, it should work and send the 'tool_consumer_info_product_family_code' and 'tool_consumer_info_version' parameters
Change-Id: I2e4bb546bfc63a4f1fdd8b1be2792f72aeac05ca
Reviewed-on: https://gerrit.instructure.com/10799
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Configured external tools can show up as buttons in the
rich editor. If you click the button then it'll pop up
a dialog that uses basic lti to load a page for the
external tool. The user can pick a resource in that
tool and the tool will then redirect back to a Canvas
url that will fire a callback and embed the content
into the editor.
See spec/selenium/external_tool_buttons_sel.rb for an
example of how to manually configure one of these tools.
Adding configuration to the UI will come in another
commit.
testing notes:
to configure an external tool to show up in the editor:
tool.settings = {
:editor_button => {
:url => "http://<canvas_domain>/selection_test",
:text => <button_label>,
:selection_width => <width_of_iframe>,
:selection_height => <height_of_iframe>,
:icon_url => <url_of_button_icon>
}
}
test plan:
- configure an external tool in the course with an editor button
- check to see if the button shows up in the rich editor in that course
- configure an external tool in the account with an editor button
- check to see if the button shows up for courses in that account
- configure more than 3 external tools
- check to see if the "more tools" dropdown works correctly
Change-Id: I681db0af578df6a9c7a2c840d293703937d81c46
Reviewed-on: https://gerrit.instructure.com/5429
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
In current BLTI there are two options for adding links:
- know the URL beforehand
- know a "naked" URL that can be associated with a resource
but not until after embed
Neither of these are great for the end-user. This commit
adds a third option, as discussed with some other users of
BLTI, where instead the user can click a link in the UI
to load an iframe where they can then find the specific
resource they want to embed. They never need to know
any URLs to make this happen.
to configure an external tool:
tool.settings = {
:resource_selection => {
:url => "http://<canvas_domain>/selection_test",
:text => <label>,
:selection_width => <iframe_width>,
:selection_height => <iframe_height>
}
}
test plan:
- configure an external tool on the course
- click to add an item to a course module
- select "external tools"
- pick the tool from the list
- select a link from the dialog
- make sure the link was inserted correctly
- try clicking the first "bad" link in the tool and confirm error is caught
- try clicking the second "bad" link in the tool and confirm error is caught
- try clicking the this "bad" link in the tool and confirm no errors occur
- make sure an account-level tool also appears
Change-Id: I47fd8461f1050c332e5cae32d9a3141a8de5b38d
Reviewed-on: https://gerrit.instructure.com/6326
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Whitmer <brian@instructure.com>
This older specification has the same semantics as the new official LTI
v1.1 outcome service specification, but there are a lot of differences
in request/response formatting.
Change-Id: I7cc4ce1e5888573fc6b2706356982926b84bed0f
Reviewed-on: https://gerrit.instructure.com/6749
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Whitmer <brian@instructure.com>
refs #5892
according to the spec, this url shouldn't change for each
user/assignment, so we've refactored so that only the tool id is in the
url.
This involved some refactoring to include the user, course and
assignment in the sourcedid, rather than just the signature of those
values, and using those values to look up the objects.
As a consequence we now return "unsupported" rather than a 401 error if
the sourcedid is incorrect, which I think is more correct according to
the spec anyway.
Change-Id: I612d48cbd63b527d9f9209b858ebeca28ebe9202
Reviewed-on: https://gerrit.instructure.com/6699
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Whitmer <brian@instructure.com>
By properly configuring external tools (see
/spec/models/course_spec/rb:898 for examples) they can
be added as left-side navigation links to a course,
an account, or to the user profile section of Canvas.
testing notes:
- you have to manually set options on the external tool:
- for user navigation the tool needs to be created on the root account
with the following settings:
{:user_navigation => {:url => <url>, :text => <tab label>} }
(there are also some optional language options you can set using
the :labels attribute)
- for account navigation it's the same
- for course navigation it's the same, except with :course_navigation
there's also some additional options:
:visibility => <value> // public, members, admins
:default => <value> // disabled, enabled
test plan:
- configure a user navigation tool at the root account level,
make sure it shows up in the user's profile section
- configure a course navigation tool at the account level,
make sure it shows up in the course's navigation
- configure a course navigation tool at the course level,
make sure it shows up in the course's navigation
- make sure :default => 'disabled' course navigation tools don't
appear by default in the navigation, but can be enabled on
the course settings page
- make sure :visibility => 'members' only shows up for course members
- make sure :visibility => 'admins' only shows up for course admins
- configure an account navigation tool at the account level,
make sure it shows up in the account's navigation, and
any sub-account's navigation
Change-Id: I977da3c6b89a9e32b4cff4c2b6b221f8162782ff
Reviewed-on: https://gerrit.instructure.com/5427
Reviewed-by: Brian Whitmer <brian@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
There isn't current any way to create this assignment type in the UI.
This just gets us far enough that we can test out the API functionality
against the IMS tests and some other tools that use grade passback.
refs #5892
Change-Id: I6f806a53bca0708702ff9e64e8e520be26234430
Reviewed-on: https://gerrit.instructure.com/6661
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Whitmer <brian@instructure.com>
The endpoint is
/api/lti/tools/:tool_id/courses/:course_id/assignments/:assignment_id/submissions/:user_id
This shouldn't ever be hit manually, the URI is passed to the LTI assignment
tool in the lis_outcome_service_url param. The shared secret and the
lis_result_sourcedid parameter will prevent abuse.
Currently the endpoint doesn't support any queries, it responds
unsupported to all valid signed xml requests. Next step is to actually
implement viewing and changing the grade for the course/assignment/user
combination.
testplan: hit the url with a valid signed oauth request with xml body,
get back an "unsupported" api response
Change-Id: I2f938f3d45ec71488dd81ac74131acfe13b6d8cb
Reviewed-on: https://gerrit.instructure.com/6623
Reviewed-by: Brian Whitmer <brian@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
This gem update required updating our twitter, linkedin, and gdocs
integrations to correctly provide the redirect uri and use the oauth
verifier on return, which we weren't doing before.
As a consequence, google no longer displays a big scary warning about
Canvas not being secure in its oauth usage.
Facebook uses oauth 2.0, so no changes were needed there.
refs #5892
refs #6127 (this stuff needs refactoring)
Change-Id: I04289638915b84dbe439bd57b36da90151c662b9
Reviewed-on: https://gerrit.instructure.com/6585
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
* expose sortable name directly to the user
* don't downcase it
* use a LOWER(sortable_name) index for postgres
* set sortable name as "last_name, first_name" explicitly for SIS imports
* populate sortable name intelligently in the UI
Change-Id: I476641f4817e27a11b573d91f102c5a74d3eba26
Reviewed-on: https://gerrit.instructure.com/6512
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
Thanks to Gabe O'Brien for the initial patch
Change-Id: I0b589e9cceb531607b8609d71f6da3687829a116
Reviewed-on: https://gerrit.instructure.com/5883
Reviewed-by: Zach Wily <zach@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
External tools were not working if there were query parameters
in the URL (http://dr-chuck.com/ims/php-simple/tool.php?a=1&b=2).
This should now work correctly.
Change-Id: Ibc0b0d61deed508058cadd07bbc2387194926f9e
Reviewed-on: https://gerrit.instructure.com/4936
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@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>