Add support for expanding the Course Integration ID
When performing a LTI launch this allows the course integration ID be expanded in the custom data that is made available in an LTI launch. Closes INTEROP-6480 Closes GH-1606 flag = none test plan: - specs pass Change-Id: I5a21eab4f02f5da1f45f714d265903d5615bce6c Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/256921 Reviewed-by: Weston Dransfield <wdransfield@instructure.com> QA-Review: Weston Dransfield <wdransfield@instructure.com> Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Product-Review: Alex Slaughter <aslaughter@instructure.com>
This commit is contained in:
parent
bc2b124400
commit
91ee30c6a9
|
@ -550,6 +550,15 @@ returns the current course sis source id.
|
|||
**Availability**: *when launched in a course*
|
||||
|
||||
|
||||
```
|
||||
1234
|
||||
```
|
||||
## com.instructure.Course.integrationId
|
||||
returns the current course integration id.
|
||||
|
||||
**Availability**: *when launched in a course*
|
||||
|
||||
|
||||
```
|
||||
1234
|
||||
```
|
||||
|
|
|
@ -576,6 +576,15 @@ module Lti
|
|||
-> { @context.sis_source_id },
|
||||
COURSE_GUARD
|
||||
|
||||
# returns the current course integration id.
|
||||
# @example
|
||||
# ```
|
||||
# 1234
|
||||
# ```
|
||||
register_expansion 'com.instructure.Course.integrationId', [],
|
||||
-> { @context.integration_id },
|
||||
COURSE_GUARD
|
||||
|
||||
# returns the current course start date.
|
||||
# @example
|
||||
# ```
|
||||
|
|
|
@ -931,6 +931,13 @@ module Lti
|
|||
expect(exp_hash[:test]).to eq 'course1'
|
||||
end
|
||||
|
||||
it 'has substitution for $com.instructure.Course.integrationId' do
|
||||
course.integration_id = 'integration1'
|
||||
exp_hash = {test: '$com.instructure.Course.integrationId'}
|
||||
variable_expander.expand_variables!(exp_hash)
|
||||
expect(exp_hash[:test]).to eq 'integration1'
|
||||
end
|
||||
|
||||
it 'has substitution for $Canvas.enrollment.enrollmentState' do
|
||||
allow(Lti::SubstitutionsHelper).to receive(:new).and_return(substitution_helper)
|
||||
allow(substitution_helper).to receive(:enrollment_state).and_return('active')
|
||||
|
|
Loading…
Reference in New Issue