fixes: PLAT-1836
test plan:
1. Install this tool into a Canvas course:
https://lti-tool-provider.herokuapp.com
2. Create and publish an assignment that uses the external tool from #1
3. Enroll and masquerade as a student and access the assignment
4. Submit either text or url (or a valid LTI launch URL)
5. view the submission details (grades --> click the assignment), notice
your submission is previewable
6. view the submissions API and notice the submission_type is
"online_upload"
7. return to the assignment and give yourself a grade
8. make sure that the assignment is still previewable and that the
submission_type didn't change
Change-Id: Ibdd2fbafb54f80d20dff447ec7f2b776eee419bb
Reviewed-on: https://gerrit.instructure.com/91100
Tested-by: Jenkins
Reviewed-by: Matthew Wheeler <mwheeler@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Nathan Mills <nathanm@instructure.com>
fixes PLAT-1767, PLAT-1773, PLAT-1774, PLAT-1775, PLAT-1776, PLAT-1777
Test plan:
* Regression test basic outcomes service
* Ensure that in each <imsx_POXBody> there is a corresponding
<replaceResultResponse/>
<deleteResultResponse/>
<readResultResponse>
<result>
<resultScore>
<language>en</language>
<textString>0.91</textString>
</resultScore>
</result>
</readResultResponse>
depending on the kind of request being made
Change-Id: If049bd5380b60ab4fc7b309cffd14d4a78595090
Reviewed-on: https://gerrit.instructure.com/88811
Tested-by: Jenkins
Reviewed-by: Nathan Mills <nathanm@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Andrew Butterfield <abutterfield@instructure.com>
Closes CNVS-29144
Test Plan:
- Add an external tool assignment
- Passback a URL type score which matches the launch URL of the tool
- Confirm that speedgrading that page launches into the tool
Change-Id: Iff3e00ece10c6b4ff891e4af90053c88a677db6a
Reviewed-on: https://gerrit.instructure.com/79526
Reviewed-by: Davis McClellan <dmcclellan@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
Tested-by: Jenkins
Reviewed-by: Nathan Mills <nathanm@instructure.com>
QA-Review: Michael Hargiss <mhargiss@instructure.com>
Product-Review: Jason Sparks <jsparks@instructure.com>
used to turn 1.0.to_s to "1"
closes #CNVS-28310
Change-Id: I79106a4c0b42fe9b6d96097aaf9dd28a43024373
Reviewed-on: https://gerrit.instructure.com/75194
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins
QA-Review: KC Naegle <knaegle@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
if there is already a submission for grade passback
then keep the original submission_type
fixes PLAT-1313
test plan:
setup the turnitin lti tool and submit an assignmnet
wait until you get an originality score back
edit the db to change the status of the result to error
resubmit the assignment in speed grader
you should get the score again, and the status in the db should change
then go into turnitin as a teacher and submit a grade for the submission
check the database the submission_type should still be 'online_upload'
Change-Id: I2bc609bc5559e80f678cf00370f6a04af4d3b6aa
Reviewed-on: https://gerrit.instructure.com/71118
Reviewed-by: Brad Horrocks <bhorrocks@instructure.com>
Reviewed-by: Andrew Butterfield <abutterfield@instructure.com>
Tested-by: Jenkins
Reviewed-by: Ryan Taylor <rtaylor@instructure.com>
Reviewed-by: John Corrigan <jcorrigan@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Nathan Mills <nathanm@instructure.com>
This adds oauth info to captured error exceptions
Fixes PLAT-1256
Test Plan:
The error report should include all of the OAuth1 header information
If the Authorization Header is not OAuth1 it should not include it
The error report should also include the signature canvas generates
The error report should include where the authorization failed. i.e.
signature, nonce, expiration
The best way to test this is run the test :D
The best way to manually test this:
- Setup an LTI Tool (I used the example tool with all the checkboxes
checked)
- Use post man stand alone
- create a new request to "/api/lti/v1/tools/<tool_id>/grade_passback"
- Use post man's Authorization tab to setup OAuth1
- Use the tools key and secret
- tweak settings for different failure tests
- select add params to header
- click update request
- send the request
You will need to manually change the auth header to get to some
failures. Let me know if you need help
Change-Id: If09882017eaae0ddff96d39b7f33c2da9c1a7fc8
Reviewed-on: https://gerrit.instructure.com/65944
Tested-by: Jenkins
Reviewed-by: Nathan Mills <nathanm@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Brad Horrocks <bhorrocks@instructure.com>
when an assignment is worth 0 points. A score of 1.0 will be marked
as complete and anything less than 1.0 will be marked incomplete
Fixes PLAT-1095
Test Plan:
You'll need an LTI tool that uses grade passback
Use the external tool on an assignment with complete/incomplete as
the grading type.
Set the total points for the assignment to 0.
Make sure you can get a grade of "complete" after taking the assignment.
Change-Id: I911d22ec93ed223b79855ffe2c69fc0c94fa56f9
Reviewed-on: https://gerrit.instructure.com/59268
Tested-by: Jenkins
Reviewed-by: Nathan Mills <nathanm@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Brad Horrocks <bhorrocks@instructure.com>
PLAT-818
test-plan:
install multiple tools with the same launch urls.
create assignments for each tool
attempt to do grade passback with the tools
they all should pass back a grade
Change-Id: I4a01b45eb2f1f1b0ed25ecc397ec4e978abc4a4e
Reviewed-on: https://gerrit.instructure.com/48913
Tested-by: Jenkins
Reviewed-by: Brad Humphrey <brad@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Nathan Mills <nathanm@instructure.com>
fixes PLAT-845
test-plan:
try and send grades back multiple times for an assignment with no points possible. It shouldn't blow up
Change-Id: Id001a1d218931f127fd350a34f608ac4b246221f
Reviewed-on: https://gerrit.instructure.com/47955
Tested-by: Jenkins
Reviewed-by: Brad Humphrey <brad@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Nathan Mills <nathanm@instructure.com>
test plan
- Install an LTI tool with grade passback
- Setup an assignment in a course for LTI grading
- Delete the user enrollment and execute outcomes API call
* It should say 'User is no longer in course'
- Delete the assignment and execute outcomes API call
* It should say 'Assignment is invalid'
- Delete the tool and execute outcomes API call
* It should say 'Assignment is no longer associated with this tool'
- Delete the course and execute outcomes API call
* It should say 'Course is invalid'
fixes PLAT-821
Change-Id: Ia058a14854bd107eeea6a28b77258ab197980e25
Reviewed-on: https://gerrit.instructure.com/46891
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: August Thornton <august@instructure.com>
fixes CNVS-15647
test plan:
* ensure that all of the following still work -
* replying to an e-mail notification
* displaying avatars
* changing your avatar
* uploading a file that's exempt from quota checks (i.e.
submitting an assignment)
* grade passback via LTI
* add an object embed to a wiki page
* rotate your encryption key -
* in security.yml, move encryption_key to previous_encryption_keys,
and put something else in encryption_key
* repeat step 1, as much as possible using the original verifier
from that step (i.e. reply to the original e-mail, refresh just
the object embedded in the wiki page)
Change-Id: Id36bbb1711f8b6c6f960cc1e898b75e335bfac81
Reviewed-on: https://gerrit.instructure.com/41368
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
also, refactor lti outbound adapter parameters and
convert integration tests to use lit outbound adapter
test plan
- Ensure that LTI launch parameters are the same before and after this change.
- Test all of the different kinds of launches for differences
Change-Id: I749e7f7b887eaac87dd104f195b526b18040a2b9
Reviewed-on: https://gerrit.instructure.com/30087
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
test plan:
Add a custom variable with the value $Canvas.user.user and $Canvas.user.class.
These values should not be substituted when the tool launches .
fixes PLAT-311
Change-Id: Ifb64ebaeb0c732720d6c5312cbc595a9c6e9c21e
Reviewed-on: https://gerrit.instructure.com/28761
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Test Plan:
- Add a tool with variable substitution and anonymous privacy level
- It should substitute all of the variables that it can based on the context
here is a list of the valid substitution variables:
$Canvas.api.domain
$Canvas.assignment.id
$Canvas.assignment.title
$Canvas.assignment.points_possible
$Canvas.context.id
$Canvas.context.sis_source_id
$Canvas.enrollment.enrollment_state
$Canvas.membership.concluded_roles
$Canvas.user.id
$Canvas.user.login_id
$Person.name.full
$Person.name.family
$Person.name.given
$Person.address.timezone
fixes PLAT-187
Change-Id: I53619e1888b768cd4e9c327a44b6597bb00c6195
Reviewed-on: https://gerrit.instructure.com/26366
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
fixes CNVS-9030
test plan:
* use an LTI tool as users on two different shards with the same IDs
* verify that the two users get separate accounts in the LTI tool
Change-Id: I977cc13c11d6e0e39a2c184d350d52f25fe94d06
Reviewed-on: https://gerrit.instructure.com/26234
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
test plan:
- Install a tool that uses the rich text editor
- Select some text in the editor
- Launch the tool
- Ensure that canvas sends a "text" param with the selected text
Change-Id: I267b07f3ec5033d84c11e52b873fc36011602198
Reviewed-on: https://gerrit.instructure.com/24909
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
now we only automatically grade assignments when a grade is passed back,
otherwise we leave them ungraded so that the teacher will be notified.
Test Plan:
- Install a homework submission tool
- Submit a grade via LTI
* Ensure that the grade submits correctly
- Submit a url without a grade
* Ensure that the teacher is notified of the ungraded assessment
* Ensure that the url is recorded for that submission
- Submit text without a grade
* Ensure that the teacher is notified of the ungraded assessment
* Ensure that the text is recorded for that submission
Change-Id: Ic941c54062685ef1bba0aa860682db40cff952e3
Reviewed-on: https://gerrit.instructure.com/24474
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Adam Phillipps <adam@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
* use IANA timezone names, not Rails weird names
* don't send the offset (it will just be a source of bugs)
* don't allow a custom variable name when a standard
(http://www.imsglobal.org/LTI/v2p0pd2/uml/purl.imsglobal.org/vocab/lti/v2/variable/index.html)
one will do just fine
Change-Id: I774a8b34b14507c6e65b1c1b144369ba09d50af3
Reviewed-on: https://gerrit.instructure.com/24665
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brad Humphrey <brad@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
per the LTI spec the lis_outcome_service_url should always
be sent, and we were only sending it for students.
Test Plan:
* Do an LTI assignment launch as a teacher or admin
* Make sure the lis_outcome_service_url value is sent
* Also check that the custom_canvas_assignment_title/points_possible are sent
closes CNVS-6392
Change-Id: If69875884029e5cba9fb329f09c21d2220fcdfd0
Reviewed-on: https://gerrit.instructure.com/21652
Reviewed-by: Brad Humphrey <brad@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
test plan:
* create a external tool with a custom field keys like:
custom_time_zone=$Person.address.timezone
custom_time_zone2=$Canvas.user.timezone
custom_offset=$Canvas.user.timezone.offset
* confirm that the tool launch parameters includes the
custom keys substituted with the current set time zone
or time zone offset (which derives from the user,
or the root account)
fixes #CNVS-6281
Change-Id: I9bf44f7ba10b2c7f68cae65496caba30ff601f15
Reviewed-on: https://gerrit.instructure.com/21621
QA-Review: Clare Strong <clare@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
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>
fixes#10146
when using lti to pass back a grade on an assignment with no
points possible, a 500 was previously returned. now a proper
error response is returned and a submission is created with
a submission comment notifying the teacher of the attempted
grade and the error.
test plan:
* create an assignment with no points possible and a
grading_type of percent;
* attempt to pass back a grade using an lti tool;
* verify that a codeMajor of 'failure' is returned to the LTI
tool with a description of "Assignment has no points
possible";
* verify that a submission is created with a submission comment
that contains the attempted grade and an explanation of the
error.
Change-Id: I4b7acd2a61f70e3a402c13dd0714601b745b2fb4
Reviewed-on: https://gerrit.instructure.com/14318
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@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>
set submission_type on lti submissions so that submitted_at
logic works properly and filters in gradebook function as
expected.
test plan:
* create an external tool assignment with grade passback;
* create a submission through the external tool;
* in gradebook, "Message students who..." with the "Haven't
submitted yet" filter and verify that the user with a
submission is excluded.
Change-Id: I253b57e3edfa52d0960f889fc5ce5e03cd2bdf84
Reviewed-on: https://gerrit.instructure.com/10974
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@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>
Canvas' implementation now passes all the certification tests for section 8,
"LTI 1.1: Suport for Basic Outcomes Service"
testplan: manually set up an assignment as an external_tool, then use
the certification app to verify that deleteResult works as expected.
Change-Id: Idf694d9e5a617a08ef11c5d803ed564de6af1250
Reviewed-on: https://gerrit.instructure.com/6679
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Whitmer <brian@instructure.com>
testplan: you can set up an assignment as an external_tool type
manually, and then hit the IMS certification test tool to verify that
replaceResult and readResult are now fully supported.
Change-Id: Id193ba1943f51b3cb4b6a2d078d8a2262c26659e
Reviewed-on: https://gerrit.instructure.com/6678
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Whitmer <brian@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>
refs #5892
This also rejects values > 1.0, the LTI test suite specifically checks
for this. If we get a use case for a tool that wants to give extra
credit, we can re-evaluate.
Change-Id: I4894d8ae3b2fdcdb5eb3bae902ef934b34a632a3
Reviewed-on: https://gerrit.instructure.com/6658
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Whitmer <brian@instructure.com>
Also versioned the URI and removed the tool_id param. As part of the
processing it pulls the tool from the assignment and verifies that it's
the same tool as was used to launch, by looking at the sourcedid.
Assignments now have an external_tool type and link to a
ContextExternalTool.
testplan: there isn't a way in the UI to configure an assignment as an
external tool yet, so it'll need to be manually configured in the
console.
Change-Id: I0cf5ec85d450409d6ea1ec71ce1d5d4c19622d4c
Reviewed-on: https://gerrit.instructure.com/6652
Reviewed-by: Brian Whitmer <brian@instructure.com>
Tested-by: Hudson <hudson@instructure.com>