Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only return administrating courses in LTI picker #5124

Merged
merged 5 commits into from
Nov 9, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Revert "Revert "Revert "Setup local reproduction"""
This reverts commit 6b80235.
jorg-vr committed Nov 9, 2023
commit 1184a31376184fa949c74ed62d7079ca9c3d5316
33 changes: 1 addition & 32 deletions app/controllers/concerns/set_lti_message.rb
Original file line number Diff line number Diff line change
@@ -8,38 +8,7 @@ module SetLtiMessage
include LTI::Messages

def set_lti_message
# @lti_message = parse_message(params[:id_token], params[:provider_id])
provider = Provider::Lti.find(params[:provider_id])
payload = {
iss: provider.issuer,
aud: provider.client_id,
exp: Time.now.to_i + 600,
iat: Time.now.to_i,
sub: 'test-user-123',
nonce: 'nonce',
'https://purl.imsglobal.org/spec/lti/claim/message_type': 'target',
'https://purl.imsglobal.org/spec/lti/claim/version': '1.3.0',
'https://purl.imsglobal.org/spec/lti/claim/deployment_id': 'c5899818-7062-44d1-b377-5a08097daeb3',
'https://purl.imsglobal.org/spec/lti/claim/target_link_uri': 'LtiDeepLinkingRequest',
'https://purl.imsglobal.org/spec/lti/claim/resource_link': {
id: '5B0748E6-E75C-4A93-8875-E034639B31CD-513799_107172',
title: 'Oef 3-2 - vierkantsvergelijking',
description: nil
},
'https://purl.imsglobal.org/spec/lti-dl/claim/deep_linking_settings': {
accept_types: %w[link file html ltiResourceLink image],
accept_media_types: 'image/*,text/html',
accept_presentation_document_targets: %w[iframe window embed],
accept_multiple: true,
auto_create: true,
title: 'This is the default title',
text: 'This is the default text',
data: 'Some random opaque data that MUST be sent back',
deep_link_return_url: 'https://www.example.com/deep_links'
}
}.with_indifferent_access
@lti_message = ::LTI::Messages::Types::DeepLinkingRequest.new(payload)

@lti_message = parse_message(params[:id_token], params[:provider_id])
@lti_launch = @lti_message.is_a?(LTI::Messages::Types::ResourceLaunchRequest)
helpers.locale = @lti_message&.launch_presentation_locale if @lti_message&.launch_presentation_locale.present?
rescue JSON::JWK::Set::KidNotFound => _e
2 changes: 1 addition & 1 deletion config/database.yml
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ default: &default

development:
<<: *default
database: dodona_backup
database: dodona

staging:
<<: *default
2 changes: 1 addition & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
@@ -105,8 +105,8 @@
t.integer "series_id_non_nil", null: false
t.index ["accepted", "user_id", "series_id"], name: "index_activity_statuses_on_accepted_and_user_id_and_series_id"
t.index ["activity_id"], name: "index_activity_statuses_on_activity_id"
t.index ["series_id", "started", "user_id", "last_submission_id"], name: "index_as_on_series_and_started_and_user_and_last_submission"
t.index ["series_id"], name: "fk_rails_1bc42c2178"
t.index ["started", "user_id", "last_submission_id"], name: "index_as_on_started_and_user_and_last_submission"
t.index ["started", "user_id", "series_id"], name: "index_activity_statuses_on_started_and_user_id_and_series_id"
t.index ["user_id", "series_id", "last_submission_id"], name: "index_as_on_user_and_series_and_last_submission"
t.index ["user_id", "series_id_non_nil", "activity_id"], name: "index_on_user_id_series_id_non_nil_activity_id", unique: true