Skip to content

Commit

Permalink
Change references to grade_changed event to grade_change event
Browse files Browse the repository at this point in the history
fixes PLAT-2867

Test plan:
* Ensure documentation is correct for both live events and lti
  capabilities
* Ensure grade_change capability works for LTI 2 tools

Change-Id: I68c381883a9feb50f2f3705f1aa0f122db766e61
Reviewed-on: https://gerrit.instructure.com/130067
Tested-by: Jenkins
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Andrew Butterfield <abutterfield@instructure.com>
  • Loading branch information
Andrew Butterfield committed Oct 19, 2017
1 parent a554a57 commit 6d9aae5
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app/models/lti/tool_consumer_profile.rb
Expand Up @@ -33,7 +33,7 @@ class ToolConsumerProfile < ActiveRecord::Base
all: [WEBHOOK_GRANT_ALL_CAPABILITY].freeze,
quiz_submitted: %w(vnd.instructure.webhooks.root_account.quiz_submitted
vnd.instructure.webhooks.assignment.quiz_submitted).freeze,
grade_changed: %w(vnd.instructure.webhooks.root_account.grade_changed).freeze,
grade_change: %w(vnd.instructure.webhooks.root_account.grade_change).freeze,
attachment_created: %w(vnd.instructure.webhooks.root_account.attachment_created
vnd.instructure.webhooks.assignment.attachment_created).freeze,
submission_created: %w(vnd.instructure.webhooks.root_account.submission_created
Expand Down
2 changes: 1 addition & 1 deletion doc/api/live_events.md
Expand Up @@ -218,7 +218,7 @@ No extra data.
| `quiz_id` | The Canvas id of the quiz. |


#### `grade_changed`
#### `grade_change`

`grade_change` events are posted every time a grade changes. These can
happen as the result of a teacher changing a grade in the gradebook or
Expand Down
4 changes: 2 additions & 2 deletions doc/api/subscriptions_appendix.md
Expand Up @@ -7,8 +7,8 @@ subscriptions of the associated type.
* vnd.instructure.webhooks.root_account.quiz_submitted
* vnd.instructure.webhooks.assignment.quiz_submitted

### `GRADE_CHANGED` Event Type
* vnd.instructure.webhooks.root_account.grade_changed
### `GRADE_CHANGE` Event Type
* vnd.instructure.webhooks.root_account.grade_change

### `ATTACHMENT_CREATED` Event Type
* vnd.instructure.webhooks.root_account.attachment_created
Expand Down
2 changes: 1 addition & 1 deletion doc/live_events.md
Expand Up @@ -4,7 +4,7 @@ Canvas includes the ability to push a subset of real-time events to a
Kinesis stream, which can then be consumed for various analytics
purposes. This is not a full-fidelity feed of all changes to the
database, but a targetted set of interesting actions such as
`grade_changed`, `login`, etc.
`grade_change`, `login`, etc.

## Development and Testing

Expand Down
8 changes: 4 additions & 4 deletions spec/apis/lti/subscriptions_validator_spec.rb
Expand Up @@ -82,11 +82,11 @@ module Lti
end
end

context "GRADE_CHANGED" do
context "GRADE_CHANGE" do
let(:subscription) do
{
RootAccountUUID: account.uuid,
EventTypes:["grade_changed"],
EventTypes:["grade_change"],
ContextType: "root_account",
ContextId: account.uuid,
Format: "live-event",
Expand All @@ -103,12 +103,12 @@ module Lti
product_family: product_family,
product_version: '1',
workflow_state: 'active',
raw_data: {'enabled_capability' => ['vnd.instructure.webhooks.root_account.grade_changed']},
raw_data: {'enabled_capability' => ['vnd.instructure.webhooks.root_account.grade_change']},
lti_version: '1'
)
end

it 'allows subscription if vnd.instructure.webhooks.root_account.grade_changed' do
it 'allows subscription if vnd.instructure.webhooks.root_account.grade_change' do
validator = SubscriptionsValidator.new(subscription, tool_proxy)
expect { validator.check_required_capabilities! }.not_to raise_error
end
Expand Down

0 comments on commit 6d9aae5

Please sign in to comment.