RuboCop: Style/RedundantFreeze
[skip-stages=Flakey] auto-corrected Change-Id: Id1b8bafdd744219a4797e6e1ba5891cd7ce4bccd Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/277888 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Simon Williams <simon@instructure.com> QA-Review: Cody Cutrer <cody@instructure.com> Product-Review: Cody Cutrer <cody@instructure.com>
This commit is contained in:
parent
b2d5e59698
commit
cf213ee24b
|
@ -140,6 +140,8 @@ Style/PerlBackrefs:
|
||||||
Enabled: false # Regexp.last_match(1) is far worse than $1
|
Enabled: false # Regexp.last_match(1) is far worse than $1
|
||||||
Style/RedundantInterpolation:
|
Style/RedundantInterpolation:
|
||||||
Severity: error
|
Severity: error
|
||||||
|
Style/RedundantFreeze:
|
||||||
|
Severity: error
|
||||||
Style/RedundantParentheses:
|
Style/RedundantParentheses:
|
||||||
Severity: error
|
Severity: error
|
||||||
Style/SpecialGlobalVars:
|
Style/SpecialGlobalVars:
|
||||||
|
|
|
@ -32,7 +32,7 @@ module Lti
|
||||||
|
|
||||||
before_action :verify_target_developer_key, only: [:create, :update]
|
before_action :verify_target_developer_key, only: [:create, :update]
|
||||||
|
|
||||||
MIME_TYPE = 'application/vnd.canvas.contextexternaltools+json'.freeze
|
MIME_TYPE = 'application/vnd.canvas.contextexternaltools+json'
|
||||||
|
|
||||||
ACTION_SCOPE_MATCHERS = {
|
ACTION_SCOPE_MATCHERS = {
|
||||||
create: all_of(TokenScopes::LTI_CREATE_ACCOUNT_EXTERNAL_TOOLS_SCOPE),
|
create: all_of(TokenScopes::LTI_CREATE_ACCOUNT_EXTERNAL_TOOLS_SCOPE),
|
||||||
|
|
|
@ -67,7 +67,7 @@ module Lti
|
||||||
include ::Lti::IMS::Concerns::AdvantageServices
|
include ::Lti::IMS::Concerns::AdvantageServices
|
||||||
include Api::V1::Account
|
include Api::V1::Account
|
||||||
|
|
||||||
MIME_TYPE = 'application/vnd.canvas.accountlookup+json'.freeze
|
MIME_TYPE = 'application/vnd.canvas.accountlookup+json'
|
||||||
|
|
||||||
# @API Get account
|
# @API Get account
|
||||||
# Retrieve information on an individual account, given by local or global ID.
|
# Retrieve information on an individual account, given by local or global ID.
|
||||||
|
|
|
@ -78,7 +78,7 @@ module Lti
|
||||||
#
|
#
|
||||||
class DataServicesController < ApplicationController
|
class DataServicesController < ApplicationController
|
||||||
include ::Lti::IMS::Concerns::AdvantageServices
|
include ::Lti::IMS::Concerns::AdvantageServices
|
||||||
MIME_TYPE = 'application/vnd.canvas.dataservices+json'.freeze
|
MIME_TYPE = 'application/vnd.canvas.dataservices+json'
|
||||||
|
|
||||||
ACTION_SCOPE_MATCHERS = {
|
ACTION_SCOPE_MATCHERS = {
|
||||||
create: all_of(TokenScopes::LTI_CREATE_DATA_SERVICE_SUBSCRIPTION_SCOPE),
|
create: all_of(TokenScopes::LTI_CREATE_DATA_SERVICE_SUBSCRIPTION_SCOPE),
|
||||||
|
|
|
@ -43,7 +43,7 @@ module Lti
|
||||||
#
|
#
|
||||||
class FeatureFlagsController < ApplicationController
|
class FeatureFlagsController < ApplicationController
|
||||||
include ::Lti::IMS::Concerns::AdvantageServices
|
include ::Lti::IMS::Concerns::AdvantageServices
|
||||||
MIME_TYPE = 'application/vnd.canvas.featureflags+json'.freeze
|
MIME_TYPE = 'application/vnd.canvas.featureflags+json'
|
||||||
|
|
||||||
ACTION_SCOPE_MATCHERS = {
|
ACTION_SCOPE_MATCHERS = {
|
||||||
show: all_of(TokenScopes::LTI_SHOW_FEATURE_FLAG_SCOPE),
|
show: all_of(TokenScopes::LTI_SHOW_FEATURE_FLAG_SCOPE),
|
||||||
|
|
|
@ -38,7 +38,7 @@ module Lti
|
||||||
scope
|
scope
|
||||||
].freeze
|
].freeze
|
||||||
OPTIONAL_PARAMS = ['state'].freeze
|
OPTIONAL_PARAMS = ['state'].freeze
|
||||||
SCOPE = 'openid'.freeze
|
SCOPE = 'openid'
|
||||||
|
|
||||||
skip_before_action :load_user, only: :authorize_redirect
|
skip_before_action :load_user, only: :authorize_redirect
|
||||||
skip_before_action :verify_authenticity_token, only: :authorize_redirect
|
skip_before_action :verify_authenticity_token, only: :authorize_redirect
|
||||||
|
|
|
@ -73,8 +73,8 @@ module Lti
|
||||||
].freeze
|
].freeze
|
||||||
|
|
||||||
class InvalidGrant < RuntimeError; end
|
class InvalidGrant < RuntimeError; end
|
||||||
JWT_GRANT_TYPE = 'urn:ietf:params:oauth:grant-type:jwt-bearer'.freeze
|
JWT_GRANT_TYPE = 'urn:ietf:params:oauth:grant-type:jwt-bearer'
|
||||||
AUTHORIZATION_CODE_GRANT_TYPE = 'authorization_code'.freeze
|
AUTHORIZATION_CODE_GRANT_TYPE = 'authorization_code'
|
||||||
GRANT_TYPES = [JWT_GRANT_TYPE, AUTHORIZATION_CODE_GRANT_TYPE].freeze
|
GRANT_TYPES = [JWT_GRANT_TYPE, AUTHORIZATION_CODE_GRANT_TYPE].freeze
|
||||||
|
|
||||||
rescue_from JSON::JWS::VerificationFailed,
|
rescue_from JSON::JWS::VerificationFailed,
|
||||||
|
|
|
@ -21,7 +21,7 @@ module Lti::IMS::Concerns
|
||||||
module DeepLinkingServices
|
module DeepLinkingServices
|
||||||
extend ActiveSupport::Concern
|
extend ActiveSupport::Concern
|
||||||
|
|
||||||
CLAIM_PREFIX = 'https://purl.imsglobal.org/spec/lti-dl/claim/'.freeze
|
CLAIM_PREFIX = 'https://purl.imsglobal.org/spec/lti-dl/claim/'
|
||||||
|
|
||||||
def validate_jwt
|
def validate_jwt
|
||||||
render_error(deep_linking_jwt.errors) and return unless deep_linking_jwt.valid?
|
render_error(deep_linking_jwt.errors) and return unless deep_linking_jwt.valid?
|
||||||
|
|
|
@ -22,7 +22,7 @@ module Lti::IMS::Concerns
|
||||||
extend ActiveSupport::Concern
|
extend ActiveSupport::Concern
|
||||||
|
|
||||||
UNIVERSAL_GRANT_HOST = Canvas::Security.config['lti_grant_host'] ||
|
UNIVERSAL_GRANT_HOST = Canvas::Security.config['lti_grant_host'] ||
|
||||||
'canvas.instructure.com'.freeze
|
'canvas.instructure.com'
|
||||||
|
|
||||||
class AccessToken
|
class AccessToken
|
||||||
def initialize(raw_jwt_str)
|
def initialize(raw_jwt_str)
|
||||||
|
|
|
@ -80,8 +80,8 @@ module Lti
|
||||||
index: any_of(TokenScopes::LTI_AGS_LINE_ITEM_SCOPE, TokenScopes::LTI_AGS_LINE_ITEM_READ_ONLY_SCOPE)
|
index: any_of(TokenScopes::LTI_AGS_LINE_ITEM_SCOPE, TokenScopes::LTI_AGS_LINE_ITEM_READ_ONLY_SCOPE)
|
||||||
}.with_indifferent_access.freeze
|
}.with_indifferent_access.freeze
|
||||||
|
|
||||||
MIME_TYPE = 'application/vnd.ims.lis.v2.lineitem+json'.freeze
|
MIME_TYPE = 'application/vnd.ims.lis.v2.lineitem+json'
|
||||||
CONTAINER_MIME_TYPE = 'application/vnd.ims.lis.v2.lineitemcontainer+json'.freeze
|
CONTAINER_MIME_TYPE = 'application/vnd.ims.lis.v2.lineitemcontainer+json'
|
||||||
|
|
||||||
rescue_from ActionController::BadRequest do |e|
|
rescue_from ActionController::BadRequest do |e|
|
||||||
unless Rails.env.production?
|
unless Rails.env.production?
|
||||||
|
|
|
@ -261,7 +261,7 @@ module Lti::IMS
|
||||||
class NamesAndRolesController < ApplicationController
|
class NamesAndRolesController < ApplicationController
|
||||||
include Concerns::AdvantageServices
|
include Concerns::AdvantageServices
|
||||||
|
|
||||||
MIME_TYPE = 'application/vnd.ims.lti-nrps.v2.membershipcontainer+json'.freeze
|
MIME_TYPE = 'application/vnd.ims.lti-nrps.v2.membershipcontainer+json'
|
||||||
|
|
||||||
# @API List Course Memberships
|
# @API List Course Memberships
|
||||||
# Return active NamesAndRoleMemberships in the given course.
|
# Return active NamesAndRoleMemberships in the given course.
|
||||||
|
|
|
@ -64,7 +64,7 @@ module Lti::IMS
|
||||||
before_action :verify_line_item_in_context
|
before_action :verify_line_item_in_context
|
||||||
before_action :verify_result_in_line_item, only: %i[show]
|
before_action :verify_result_in_line_item, only: %i[show]
|
||||||
|
|
||||||
MIME_TYPE = 'application/vnd.ims.lis.v2.resultcontainer+json'.freeze
|
MIME_TYPE = 'application/vnd.ims.lis.v2.resultcontainer+json'
|
||||||
|
|
||||||
# @API Show a collection of Results
|
# @API Show a collection of Results
|
||||||
#
|
#
|
||||||
|
|
|
@ -78,7 +78,7 @@ module Lti::IMS
|
||||||
:verify_attempts_for_online_upload,
|
:verify_attempts_for_online_upload,
|
||||||
)
|
)
|
||||||
|
|
||||||
MIME_TYPE = 'application/vnd.ims.lis.v1.score+json'.freeze
|
MIME_TYPE = 'application/vnd.ims.lis.v1.score+json'
|
||||||
|
|
||||||
# @API Create a Score
|
# @API Create a Score
|
||||||
#
|
#
|
||||||
|
@ -219,7 +219,7 @@ module Lti::IMS
|
||||||
content_items: %i[type url title]
|
content_items: %i[type url title]
|
||||||
].freeze
|
].freeze
|
||||||
SCORE_SUBMISSION_TYPES = %w[none basic_lti_launch online_text_entry online_url external_tool online_upload].freeze
|
SCORE_SUBMISSION_TYPES = %w[none basic_lti_launch online_text_entry online_url external_tool online_upload].freeze
|
||||||
DEFAULT_SUBMISSION_TYPE = 'external_tool'.freeze
|
DEFAULT_SUBMISSION_TYPE = 'external_tool'
|
||||||
|
|
||||||
def scopes_matcher
|
def scopes_matcher
|
||||||
self.class.all_of(TokenScopes::LTI_AGS_SCORE_SCOPE)
|
self.class.all_of(TokenScopes::LTI_AGS_SCORE_SCOPE)
|
||||||
|
|
|
@ -23,7 +23,7 @@ module Lti
|
||||||
class ToolConsumerProfileController < ApplicationController
|
class ToolConsumerProfileController < ApplicationController
|
||||||
include Lti::IMS::AccessTokenHelper
|
include Lti::IMS::AccessTokenHelper
|
||||||
|
|
||||||
TOOL_CONSUMER_PROFILE_SERVICE = 'ToolConsumerProfile'.freeze
|
TOOL_CONSUMER_PROFILE_SERVICE = 'ToolConsumerProfile'
|
||||||
|
|
||||||
before_action :require_context
|
before_action :require_context
|
||||||
skip_before_action :load_user
|
skip_before_action :load_user
|
||||||
|
|
|
@ -24,8 +24,8 @@ module Lti
|
||||||
include Lti::ApiServiceHelper
|
include Lti::ApiServiceHelper
|
||||||
include Lti::IMS::AccessTokenHelper
|
include Lti::IMS::AccessTokenHelper
|
||||||
|
|
||||||
TOOL_PROXY_COLLECTION = 'ToolProxy.collection'.freeze
|
TOOL_PROXY_COLLECTION = 'ToolProxy.collection'
|
||||||
TOOL_PROXY_ITEM = 'ToolProxy.item'.freeze
|
TOOL_PROXY_ITEM = 'ToolProxy.item'
|
||||||
|
|
||||||
SERVICE_DEFINITIONS = [
|
SERVICE_DEFINITIONS = [
|
||||||
{
|
{
|
||||||
|
|
|
@ -33,9 +33,9 @@ module Lti
|
||||||
}, status: :not_found
|
}, status: :not_found
|
||||||
end
|
end
|
||||||
|
|
||||||
TOOL_SETTINGS_SERVICE = 'ToolProxySettings'.freeze
|
TOOL_SETTINGS_SERVICE = 'ToolProxySettings'
|
||||||
TOOL_PROXY_BINDING_SERVICE = 'ToolProxyBindingSettings'.freeze
|
TOOL_PROXY_BINDING_SERVICE = 'ToolProxyBindingSettings'
|
||||||
LTI_LINK_SETTINGS = 'LtiLinkSettings'.freeze
|
LTI_LINK_SETTINGS = 'LtiLinkSettings'
|
||||||
|
|
||||||
skip_before_action :load_user
|
skip_before_action :load_user
|
||||||
before_action :authenticate_api_call
|
before_action :authenticate_api_call
|
||||||
|
|
|
@ -113,7 +113,7 @@ module Lti
|
||||||
class OriginalityReportsApiController < ApplicationController
|
class OriginalityReportsApiController < ApplicationController
|
||||||
include Lti::IMS::AccessTokenHelper
|
include Lti::IMS::AccessTokenHelper
|
||||||
|
|
||||||
ORIGINALITY_REPORT_SERVICE = 'vnd.Canvas.OriginalityReport'.freeze
|
ORIGINALITY_REPORT_SERVICE = 'vnd.Canvas.OriginalityReport'
|
||||||
|
|
||||||
SERVICE_DEFINITIONS = [
|
SERVICE_DEFINITIONS = [
|
||||||
{
|
{
|
||||||
|
|
|
@ -67,7 +67,7 @@ module Lti
|
||||||
skip_before_action :load_user
|
skip_before_action :load_user
|
||||||
before_action :authorized_lti2_tool, :tool_proxy_related_to_assignment?, :user_related_to_assignment?
|
before_action :authorized_lti2_tool, :tool_proxy_related_to_assignment?, :user_related_to_assignment?
|
||||||
|
|
||||||
ASSIGNMENT_SERVICE = 'vnd.Canvas.Assignment'.freeze
|
ASSIGNMENT_SERVICE = 'vnd.Canvas.Assignment'
|
||||||
SERVICE_DEFINITIONS = [
|
SERVICE_DEFINITIONS = [
|
||||||
{
|
{
|
||||||
id: ASSIGNMENT_SERVICE,
|
id: ASSIGNMENT_SERVICE,
|
||||||
|
|
|
@ -136,7 +136,7 @@ module Lti
|
||||||
include ::Lti::IMS::Concerns::LtiServices
|
include ::Lti::IMS::Concerns::LtiServices
|
||||||
include Api::V1::DeveloperKey
|
include Api::V1::DeveloperKey
|
||||||
|
|
||||||
MIME_TYPE = 'application/vnd.ims.lis.v2.publicjwk+json'.freeze
|
MIME_TYPE = 'application/vnd.ims.lis.v2.publicjwk+json'
|
||||||
|
|
||||||
ACTION_SCOPE_MATCHERS = {
|
ACTION_SCOPE_MATCHERS = {
|
||||||
update: all_of(TokenScopes::LTI_UPDATE_PUBLIC_JWK_SCOPE)
|
update: all_of(TokenScopes::LTI_UPDATE_PUBLIC_JWK_SCOPE)
|
||||||
|
|
|
@ -46,7 +46,7 @@ module Lti
|
||||||
class SubscriptionsApiController < ApplicationController
|
class SubscriptionsApiController < ApplicationController
|
||||||
include Lti::IMS::AccessTokenHelper
|
include Lti::IMS::AccessTokenHelper
|
||||||
|
|
||||||
WEBHOOK_SUBSCRIPTION_SERVICE = 'vnd.Canvas.webhooksSubscription'.freeze
|
WEBHOOK_SUBSCRIPTION_SERVICE = 'vnd.Canvas.webhooksSubscription'
|
||||||
|
|
||||||
SERVICE_DEFINITIONS = [
|
SERVICE_DEFINITIONS = [
|
||||||
{
|
{
|
||||||
|
|
|
@ -29,8 +29,8 @@ module Lti
|
||||||
before_action :user_in_context, only: :show
|
before_action :user_in_context, only: :show
|
||||||
before_action :tool_in_context, only: :group_index
|
before_action :tool_in_context, only: :group_index
|
||||||
|
|
||||||
USER_SERVICE = 'vnd.Canvas.User'.freeze
|
USER_SERVICE = 'vnd.Canvas.User'
|
||||||
GROUP_INDEX_SERVICE = 'vnd.Canvas.GroupIndex'.freeze
|
GROUP_INDEX_SERVICE = 'vnd.Canvas.GroupIndex'
|
||||||
SERVICE_DEFINITIONS = [
|
SERVICE_DEFINITIONS = [
|
||||||
{
|
{
|
||||||
id: USER_SERVICE,
|
id: USER_SERVICE,
|
||||||
|
|
|
@ -312,12 +312,12 @@ class SisApiController < ApplicationController
|
||||||
|
|
||||||
GRADE_EXPORT_NOT_ENABLED_ERROR = {
|
GRADE_EXPORT_NOT_ENABLED_ERROR = {
|
||||||
code: 'not_enabled',
|
code: 'not_enabled',
|
||||||
error: 'A SIS integration is not configured and the bulk SIS Grade Export feature is not enabled'.freeze
|
error: 'A SIS integration is not configured and the bulk SIS Grade Export feature is not enabled'
|
||||||
}.freeze
|
}.freeze
|
||||||
|
|
||||||
COURSE_NOT_PUBLISHED_ERROR = {
|
COURSE_NOT_PUBLISHED_ERROR = {
|
||||||
code: 'unpublished_course',
|
code: 'unpublished_course',
|
||||||
error: 'Grade data is not available for non-published courses'.freeze
|
error: 'Grade data is not available for non-published courses'
|
||||||
}.freeze
|
}.freeze
|
||||||
|
|
||||||
# @API Retrieve assignments enabled for grade export to SIS
|
# @API Retrieve assignments enabled for grade export to SIS
|
||||||
|
|
|
@ -45,7 +45,7 @@ class Assignment < ActiveRecord::Base
|
||||||
ALLOWED_GRADING_TYPES = %w(points percent letter_grade gpa_scale pass_fail not_graded).freeze
|
ALLOWED_GRADING_TYPES = %w(points percent letter_grade gpa_scale pass_fail not_graded).freeze
|
||||||
OFFLINE_SUBMISSION_TYPES = %i(on_paper external_tool none not_graded wiki_page).freeze
|
OFFLINE_SUBMISSION_TYPES = %i(on_paper external_tool none not_graded wiki_page).freeze
|
||||||
SUBMITTABLE_TYPES = %w(online_quiz discussion_topic wiki_page).freeze
|
SUBMITTABLE_TYPES = %w(online_quiz discussion_topic wiki_page).freeze
|
||||||
LTI_EULA_SERVICE = 'vnd.Canvas.Eula'.freeze
|
LTI_EULA_SERVICE = 'vnd.Canvas.Eula'
|
||||||
AUDITABLE_ATTRIBUTES = %w[
|
AUDITABLE_ATTRIBUTES = %w[
|
||||||
muted
|
muted
|
||||||
due_at
|
due_at
|
||||||
|
|
|
@ -22,8 +22,8 @@ class Assignment
|
||||||
class GradeError < StandardError
|
class GradeError < StandardError
|
||||||
attr_accessor :status_code, :error_code
|
attr_accessor :status_code, :error_code
|
||||||
|
|
||||||
PROVISIONAL_GRADE_INVALID_SCORE = "PROVISIONAL_GRADE_INVALID_SCORE".freeze
|
PROVISIONAL_GRADE_INVALID_SCORE = "PROVISIONAL_GRADE_INVALID_SCORE"
|
||||||
PROVISIONAL_GRADE_MODIFY_SELECTED = "PROVISIONAL_GRADE_MODIFY_SELECTED".freeze
|
PROVISIONAL_GRADE_MODIFY_SELECTED = "PROVISIONAL_GRADE_MODIFY_SELECTED"
|
||||||
|
|
||||||
# The following parameters are all optional, and allow for different behavior
|
# The following parameters are all optional, and allow for different behavior
|
||||||
# depending on the type of error.
|
# depending on the type of error.
|
||||||
|
|
|
@ -24,7 +24,7 @@ class AssignmentOverride < ActiveRecord::Base
|
||||||
|
|
||||||
NOOP_MASTERY_PATHS = 1
|
NOOP_MASTERY_PATHS = 1
|
||||||
|
|
||||||
SET_TYPE_NOOP = 'Noop'.freeze
|
SET_TYPE_NOOP = 'Noop'
|
||||||
|
|
||||||
simply_versioned :keep => 10
|
simply_versioned :keep => 10
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ class Attachment < ActiveRecord::Base
|
||||||
EXCLUDED_COPY_ATTRIBUTES = %w{id root_attachment_id uuid folder_id user_id
|
EXCLUDED_COPY_ATTRIBUTES = %w{id root_attachment_id uuid folder_id user_id
|
||||||
filename namespace workflow_state root_account_id}
|
filename namespace workflow_state root_account_id}
|
||||||
|
|
||||||
CLONING_ERROR_TYPE = 'attachment_clone_url'.freeze
|
CLONING_ERROR_TYPE = 'attachment_clone_url'
|
||||||
|
|
||||||
include HasContentTags
|
include HasContentTags
|
||||||
include ContextModuleItem
|
include ContextModuleItem
|
||||||
|
|
|
@ -43,7 +43,7 @@ class AuthenticationProvider::Apple < AuthenticationProvider::OpenIDConnect
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.login_attributes
|
def self.login_attributes
|
||||||
['sub'.freeze, 'email'.freeze].freeze
|
['sub', 'email'].freeze
|
||||||
end
|
end
|
||||||
validates :login_attribute, inclusion: login_attributes
|
validates :login_attribute, inclusion: login_attributes
|
||||||
|
|
||||||
|
@ -53,10 +53,10 @@ class AuthenticationProvider::Apple < AuthenticationProvider::OpenIDConnect
|
||||||
|
|
||||||
def self.recognized_federated_attributes
|
def self.recognized_federated_attributes
|
||||||
[
|
[
|
||||||
'email'.freeze,
|
'email',
|
||||||
'firstName'.freeze,
|
'firstName',
|
||||||
'lastName'.freeze,
|
'lastName',
|
||||||
'sub'.freeze,
|
'sub',
|
||||||
].freeze
|
].freeze
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ require 'casclient'
|
||||||
|
|
||||||
class AuthenticationProvider::CAS < AuthenticationProvider::Delegated
|
class AuthenticationProvider::CAS < AuthenticationProvider::Delegated
|
||||||
def self.sti_name
|
def self.sti_name
|
||||||
'cas'.freeze
|
'cas'
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.recognized_params
|
def self.recognized_params
|
||||||
|
|
|
@ -32,19 +32,19 @@ class AuthenticationProvider::Clever < AuthenticationProvider::OAuth2
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.login_attributes
|
def self.login_attributes
|
||||||
['id'.freeze, 'sis_id'.freeze, 'email'.freeze, 'student_number'.freeze, 'teacher_number'.freeze, 'state_id'.freeze, 'district_username'.freeze].freeze
|
['id', 'sis_id', 'email', 'student_number', 'teacher_number', 'state_id', 'district_username'].freeze
|
||||||
end
|
end
|
||||||
validates :login_attribute, inclusion: login_attributes
|
validates :login_attribute, inclusion: login_attributes
|
||||||
|
|
||||||
def self.recognized_federated_attributes
|
def self.recognized_federated_attributes
|
||||||
(login_attributes + ['first_name'.freeze, 'last_name'.freeze, 'home_language'.freeze]).freeze
|
(login_attributes + ['first_name', 'last_name', 'home_language']).freeze
|
||||||
end
|
end
|
||||||
|
|
||||||
# Rename db field
|
# Rename db field
|
||||||
alias_attribute :district_id, :auth_filter
|
alias_attribute :district_id, :auth_filter
|
||||||
|
|
||||||
def login_attribute
|
def login_attribute
|
||||||
super || 'id'.freeze
|
super || 'id'
|
||||||
end
|
end
|
||||||
|
|
||||||
def unique_id(token)
|
def unique_id(token)
|
||||||
|
@ -81,9 +81,9 @@ class AuthenticationProvider::Clever < AuthenticationProvider::OAuth2
|
||||||
|
|
||||||
def client_options
|
def client_options
|
||||||
{
|
{
|
||||||
site: 'https://api.clever.com'.freeze,
|
site: 'https://api.clever.com',
|
||||||
authorize_url: 'https://clever.com/oauth/authorize',
|
authorize_url: 'https://clever.com/oauth/authorize',
|
||||||
token_url: 'https://clever.com/oauth/tokens'.freeze,
|
token_url: 'https://clever.com/oauth/tokens',
|
||||||
auth_scheme: :basic_auth,
|
auth_scheme: :basic_auth,
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
|
@ -42,23 +42,23 @@ class AuthenticationProvider::Facebook < AuthenticationProvider::OAuth2
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.login_attributes
|
def self.login_attributes
|
||||||
['id'.freeze, 'email'.freeze].freeze
|
['id', 'email'].freeze
|
||||||
end
|
end
|
||||||
validates :login_attribute, inclusion: login_attributes
|
validates :login_attribute, inclusion: login_attributes
|
||||||
|
|
||||||
def self.recognized_federated_attributes
|
def self.recognized_federated_attributes
|
||||||
[
|
[
|
||||||
'email'.freeze,
|
'email',
|
||||||
'first_name'.freeze,
|
'first_name',
|
||||||
'id'.freeze,
|
'id',
|
||||||
'last_name'.freeze,
|
'last_name',
|
||||||
'locale'.freeze,
|
'locale',
|
||||||
'name'.freeze,
|
'name',
|
||||||
].freeze
|
].freeze
|
||||||
end
|
end
|
||||||
|
|
||||||
def login_attribute
|
def login_attribute
|
||||||
super || 'id'.freeze
|
super || 'id'
|
||||||
end
|
end
|
||||||
|
|
||||||
def unique_id(token)
|
def unique_id(token)
|
||||||
|
@ -81,7 +81,7 @@ class AuthenticationProvider::Facebook < AuthenticationProvider::OAuth2
|
||||||
|
|
||||||
def authorize_options
|
def authorize_options
|
||||||
if login_attribute == 'email' || federated_attributes.any? { |(_k, v)| v['attribute'] == 'email' }
|
if login_attribute == 'email' || federated_attributes.any? { |(_k, v)| v['attribute'] == 'email' }
|
||||||
{ scope: 'email'.freeze }.freeze
|
{ scope: 'email' }.freeze
|
||||||
else
|
else
|
||||||
{}.freeze
|
{}.freeze
|
||||||
end
|
end
|
||||||
|
@ -89,9 +89,9 @@ class AuthenticationProvider::Facebook < AuthenticationProvider::OAuth2
|
||||||
|
|
||||||
def client_options
|
def client_options
|
||||||
{
|
{
|
||||||
site: 'https://graph.facebook.com'.freeze,
|
site: 'https://graph.facebook.com',
|
||||||
authorize_url: 'https://www.facebook.com/dialog/oauth'.freeze,
|
authorize_url: 'https://www.facebook.com/dialog/oauth',
|
||||||
token_url: 'oauth/access_token'.freeze
|
token_url: 'oauth/access_token'
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -24,7 +24,7 @@ class AuthenticationProvider::GitHub < AuthenticationProvider::OAuth2
|
||||||
plugin_settings :domain, :client_id, client_secret: :client_secret_dec
|
plugin_settings :domain, :client_id, client_secret: :client_secret_dec
|
||||||
|
|
||||||
def self.sti_name
|
def self.sti_name
|
||||||
'github'.freeze
|
'github'
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.recognized_params
|
def self.recognized_params
|
||||||
|
@ -32,16 +32,16 @@ class AuthenticationProvider::GitHub < AuthenticationProvider::OAuth2
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.login_attributes
|
def self.login_attributes
|
||||||
['id'.freeze, 'email'.freeze, 'login'.freeze].freeze
|
['id', 'email', 'login'].freeze
|
||||||
end
|
end
|
||||||
validates :login_attribute, inclusion: login_attributes
|
validates :login_attribute, inclusion: login_attributes
|
||||||
|
|
||||||
def self.recognized_federated_attributes
|
def self.recognized_federated_attributes
|
||||||
[
|
[
|
||||||
'email'.freeze,
|
'email',
|
||||||
'id'.freeze,
|
'id',
|
||||||
'login'.freeze,
|
'login',
|
||||||
'name'.freeze
|
'name'
|
||||||
].freeze
|
].freeze
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ class AuthenticationProvider::GitHub < AuthenticationProvider::OAuth2
|
||||||
end
|
end
|
||||||
|
|
||||||
def login_attribute
|
def login_attribute
|
||||||
super || 'id'.freeze
|
super || 'id'
|
||||||
end
|
end
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
@ -81,13 +81,13 @@ class AuthenticationProvider::GitHub < AuthenticationProvider::OAuth2
|
||||||
|
|
||||||
def client_options
|
def client_options
|
||||||
{
|
{
|
||||||
site: domain.present? ? "https://#{domain}/api/v3" : 'https://api.github.com'.freeze,
|
site: domain.present? ? "https://#{domain}/api/v3" : 'https://api.github.com',
|
||||||
authorize_url: "https://#{inferred_domain}/login/oauth/authorize",
|
authorize_url: "https://#{inferred_domain}/login/oauth/authorize",
|
||||||
token_url: "https://#{inferred_domain}/login/oauth/access_token"
|
token_url: "https://#{inferred_domain}/login/oauth/access_token"
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
def inferred_domain
|
def inferred_domain
|
||||||
domain.presence || 'github.com'.freeze
|
domain.presence || 'github.com'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -39,18 +39,18 @@ class AuthenticationProvider::Google < AuthenticationProvider::OpenIDConnect
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.login_attributes
|
def self.login_attributes
|
||||||
['sub'.freeze, 'email'.freeze].freeze
|
['sub', 'email'].freeze
|
||||||
end
|
end
|
||||||
validates :login_attribute, inclusion: login_attributes
|
validates :login_attribute, inclusion: login_attributes
|
||||||
|
|
||||||
def self.recognized_federated_attributes
|
def self.recognized_federated_attributes
|
||||||
[
|
[
|
||||||
'email'.freeze,
|
'email',
|
||||||
'family_name'.freeze,
|
'family_name',
|
||||||
'given_name'.freeze,
|
'given_name',
|
||||||
'locale'.freeze,
|
'locale',
|
||||||
'name'.freeze,
|
'name',
|
||||||
'sub'.freeze,
|
'sub',
|
||||||
].freeze
|
].freeze
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ class AuthenticationProvider::Google < AuthenticationProvider::OpenIDConnect
|
||||||
protected
|
protected
|
||||||
|
|
||||||
def userinfo_endpoint
|
def userinfo_endpoint
|
||||||
"https://www.googleapis.com/oauth2/v3/userinfo".freeze
|
"https://www.googleapis.com/oauth2/v3/userinfo"
|
||||||
end
|
end
|
||||||
|
|
||||||
def client_options
|
def client_options
|
||||||
|
@ -91,7 +91,7 @@ class AuthenticationProvider::Google < AuthenticationProvider::OpenIDConnect
|
||||||
|
|
||||||
def scope
|
def scope
|
||||||
scopes = []
|
scopes = []
|
||||||
scopes << 'email' if login_attribute == 'email'.freeze ||
|
scopes << 'email' if login_attribute == 'email' ||
|
||||||
hosted_domain ||
|
hosted_domain ||
|
||||||
federated_attributes.any? { |(_k, v)| v['attribute'] == 'email' }
|
federated_attributes.any? { |(_k, v)| v['attribute'] == 'email' }
|
||||||
scopes << 'profile' if federated_attributes.any? { |(_k, v)| v['attribute'] == 'name' }
|
scopes << 'profile' if federated_attributes.any? { |(_k, v)| v['attribute'] == 'name' }
|
||||||
|
@ -99,11 +99,11 @@ class AuthenticationProvider::Google < AuthenticationProvider::OpenIDConnect
|
||||||
end
|
end
|
||||||
|
|
||||||
def authorize_url
|
def authorize_url
|
||||||
'https://accounts.google.com/o/oauth2/auth'.freeze
|
'https://accounts.google.com/o/oauth2/auth'
|
||||||
end
|
end
|
||||||
|
|
||||||
def token_url
|
def token_url
|
||||||
'https://accounts.google.com/o/oauth2/token'.freeze
|
'https://accounts.google.com/o/oauth2/token'
|
||||||
end
|
end
|
||||||
|
|
||||||
def hosted_domains
|
def hosted_domains
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
|
|
||||||
class AuthenticationProvider::LDAP < AuthenticationProvider
|
class AuthenticationProvider::LDAP < AuthenticationProvider
|
||||||
def self.sti_name
|
def self.sti_name
|
||||||
'ldap'.freeze
|
'ldap'
|
||||||
end
|
end
|
||||||
|
|
||||||
# if the config changes, clear out last_timeout_failure so another attempt can be made immediately
|
# if the config changes, clear out last_timeout_failure so another attempt can be made immediately
|
||||||
|
|
|
@ -24,7 +24,7 @@ class AuthenticationProvider::LinkedIn < AuthenticationProvider::OAuth2
|
||||||
plugin_settings :client_id, client_secret: :client_secret_dec
|
plugin_settings :client_id, client_secret: :client_secret_dec
|
||||||
|
|
||||||
def self.sti_name
|
def self.sti_name
|
||||||
'linkedin'.freeze
|
'linkedin'
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.recognized_params
|
def self.recognized_params
|
||||||
|
@ -32,21 +32,21 @@ class AuthenticationProvider::LinkedIn < AuthenticationProvider::OAuth2
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.login_attributes
|
def self.login_attributes
|
||||||
['id'.freeze, 'emailAddress'.freeze].freeze
|
['id', 'emailAddress'].freeze
|
||||||
end
|
end
|
||||||
validates :login_attribute, inclusion: login_attributes
|
validates :login_attribute, inclusion: login_attributes
|
||||||
|
|
||||||
def self.recognized_federated_attributes
|
def self.recognized_federated_attributes
|
||||||
[
|
[
|
||||||
'emailAddress'.freeze,
|
'emailAddress',
|
||||||
'firstName'.freeze,
|
'firstName',
|
||||||
'id'.freeze,
|
'id',
|
||||||
'lastName'.freeze,
|
'lastName',
|
||||||
].freeze
|
].freeze
|
||||||
end
|
end
|
||||||
|
|
||||||
def login_attribute
|
def login_attribute
|
||||||
super || 'id'.freeze
|
super || 'id'
|
||||||
end
|
end
|
||||||
|
|
||||||
def unique_id(token)
|
def unique_id(token)
|
||||||
|
@ -87,13 +87,13 @@ class AuthenticationProvider::LinkedIn < AuthenticationProvider::OAuth2
|
||||||
end
|
end
|
||||||
|
|
||||||
def email_required?
|
def email_required?
|
||||||
login_attribute == 'emailAddress'.freeze ||
|
login_attribute == 'emailAddress' ||
|
||||||
federated_attributes.any? { |(_k, v)| v['attribute'] == 'emailAddress' }
|
federated_attributes.any? { |(_k, v)| v['attribute'] == 'emailAddress' }
|
||||||
end
|
end
|
||||||
|
|
||||||
def client_options
|
def client_options
|
||||||
{
|
{
|
||||||
site: 'https://api.linkedin.com'.freeze,
|
site: 'https://api.linkedin.com',
|
||||||
authorize_url: 'https://www.linkedin.com/uas/oauth2/authorization',
|
authorize_url: 'https://www.linkedin.com/uas/oauth2/authorization',
|
||||||
token_url: 'https://www.linkedin.com/uas/oauth2/accessToken'
|
token_url: 'https://www.linkedin.com/uas/oauth2/accessToken'
|
||||||
}
|
}
|
||||||
|
@ -105,9 +105,9 @@ class AuthenticationProvider::LinkedIn < AuthenticationProvider::OAuth2
|
||||||
|
|
||||||
def scope
|
def scope
|
||||||
if email_required?
|
if email_required?
|
||||||
'r_liteprofile r_emailaddress'.freeze
|
'r_liteprofile r_emailaddress'
|
||||||
else
|
else
|
||||||
'r_liteprofile'.freeze
|
'r_liteprofile'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -55,22 +55,22 @@ class AuthenticationProvider::Microsoft < AuthenticationProvider::OpenIDConnect
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.login_attributes
|
def self.login_attributes
|
||||||
['sub'.freeze, 'email'.freeze, 'oid'.freeze, 'preferred_username'.freeze].freeze
|
['sub', 'email', 'oid', 'preferred_username'].freeze
|
||||||
end
|
end
|
||||||
validates :login_attribute, inclusion: login_attributes
|
validates :login_attribute, inclusion: login_attributes
|
||||||
|
|
||||||
def self.recognized_federated_attributes
|
def self.recognized_federated_attributes
|
||||||
[
|
[
|
||||||
'email'.freeze,
|
'email',
|
||||||
'name'.freeze,
|
'name',
|
||||||
'preferred_username'.freeze,
|
'preferred_username',
|
||||||
'oid'.freeze,
|
'oid',
|
||||||
'sub'.freeze,
|
'sub',
|
||||||
].freeze
|
].freeze
|
||||||
end
|
end
|
||||||
|
|
||||||
def login_attribute
|
def login_attribute
|
||||||
super || 'id'.freeze
|
super || 'id'
|
||||||
end
|
end
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
|
@ -22,11 +22,11 @@ class AuthenticationProvider::OpenIDConnect < AuthenticationProvider::OAuth2
|
||||||
attr_accessor :instance_debugging
|
attr_accessor :instance_debugging
|
||||||
|
|
||||||
def self.sti_name
|
def self.sti_name
|
||||||
self == OpenIDConnect ? 'openid_connect'.freeze : super
|
self == OpenIDConnect ? 'openid_connect' : super
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.display_name
|
def self.display_name
|
||||||
self == OpenIDConnect ? 'OpenID Connect'.freeze : super
|
self == OpenIDConnect ? 'OpenID Connect' : super
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.open_id_connect_params
|
def self.open_id_connect_params
|
||||||
|
@ -79,7 +79,7 @@ class AuthenticationProvider::OpenIDConnect < AuthenticationProvider::OAuth2
|
||||||
end
|
end
|
||||||
|
|
||||||
def login_attribute
|
def login_attribute
|
||||||
super.presence || 'sub'.freeze
|
super.presence || 'sub'
|
||||||
end
|
end
|
||||||
|
|
||||||
def unique_id(token)
|
def unique_id(token)
|
||||||
|
@ -148,9 +148,9 @@ class AuthenticationProvider::OpenIDConnect < AuthenticationProvider::OAuth2
|
||||||
PROFILE_CLAIMS = ['name', 'family_name', 'given_name', 'middle_name', 'nickname', 'preferred_username',
|
PROFILE_CLAIMS = ['name', 'family_name', 'given_name', 'middle_name', 'nickname', 'preferred_username',
|
||||||
'profile', 'picture', 'website', 'gender', 'birthdate', 'zoneinfo', 'locale', 'updated_at'].freeze
|
'profile', 'picture', 'website', 'gender', 'birthdate', 'zoneinfo', 'locale', 'updated_at'].freeze
|
||||||
def scope_for_options
|
def scope_for_options
|
||||||
result = (scope || ''.freeze).split(' '.freeze)
|
result = (scope || '').split(' ')
|
||||||
|
|
||||||
result.unshift('openid'.freeze)
|
result.unshift('openid')
|
||||||
claims = requested_claims
|
claims = requested_claims
|
||||||
# see http://openid.net/specs/openid-connect-core-1_0.html#ScopeClaims
|
# see http://openid.net/specs/openid-connect-core-1_0.html#ScopeClaims
|
||||||
result << 'profile' unless (claims & PROFILE_CLAIMS).empty?
|
result << 'profile' unless (claims & PROFILE_CLAIMS).empty?
|
||||||
|
@ -159,6 +159,6 @@ class AuthenticationProvider::OpenIDConnect < AuthenticationProvider::OAuth2
|
||||||
result << 'phone' if claims.include?('phone_number') || claims.include?('phone_number_verified')
|
result << 'phone' if claims.include?('phone_number') || claims.include?('phone_number_verified')
|
||||||
|
|
||||||
result.uniq!
|
result.uniq!
|
||||||
result.join(' '.freeze)
|
result.join(' ')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -22,7 +22,7 @@ require 'saml2'
|
||||||
|
|
||||||
class AuthenticationProvider::SAML < AuthenticationProvider::Delegated
|
class AuthenticationProvider::SAML < AuthenticationProvider::Delegated
|
||||||
def self.sti_name
|
def self.sti_name
|
||||||
'saml'.freeze
|
'saml'
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.enabled?(_account = nil)
|
def self.enabled?(_account = nil)
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
require 'saml2'
|
require 'saml2'
|
||||||
|
|
||||||
class AuthenticationProvider::SAML::InCommon < AuthenticationProvider::SAML::Federation
|
class AuthenticationProvider::SAML::InCommon < AuthenticationProvider::SAML::Federation
|
||||||
URN = 'urn:mace:incommon'.freeze
|
URN = 'urn:mace:incommon'
|
||||||
|
|
||||||
class << self
|
class << self
|
||||||
def endpoint
|
def endpoint
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
require 'saml2'
|
require 'saml2'
|
||||||
|
|
||||||
class AuthenticationProvider::SAML::UKFederation < AuthenticationProvider::SAML::Federation
|
class AuthenticationProvider::SAML::UKFederation < AuthenticationProvider::SAML::Federation
|
||||||
URN = 'http://ukfederation.org.uk'.freeze
|
URN = 'http://ukfederation.org.uk'
|
||||||
|
|
||||||
class << self
|
class << self
|
||||||
def endpoint
|
def endpoint
|
||||||
|
|
|
@ -28,21 +28,21 @@ class AuthenticationProvider::Twitter < AuthenticationProvider::OAuth
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.login_attributes
|
def self.login_attributes
|
||||||
['user_id'.freeze, 'screen_name'.freeze].freeze
|
['user_id', 'screen_name'].freeze
|
||||||
end
|
end
|
||||||
validates :login_attribute, inclusion: login_attributes
|
validates :login_attribute, inclusion: login_attributes
|
||||||
|
|
||||||
def self.recognized_federated_attributes
|
def self.recognized_federated_attributes
|
||||||
[
|
[
|
||||||
'name'.freeze,
|
'name',
|
||||||
'screen_name'.freeze,
|
'screen_name',
|
||||||
'time_zone'.freeze,
|
'time_zone',
|
||||||
'user_id'.freeze,
|
'user_id',
|
||||||
].freeze
|
].freeze
|
||||||
end
|
end
|
||||||
|
|
||||||
def login_attribute
|
def login_attribute
|
||||||
super || 'user_id'.freeze
|
super || 'user_id'
|
||||||
end
|
end
|
||||||
|
|
||||||
def unique_id(token)
|
def unique_id(token)
|
||||||
|
@ -61,8 +61,8 @@ class AuthenticationProvider::Twitter < AuthenticationProvider::OAuth
|
||||||
|
|
||||||
def consumer_options
|
def consumer_options
|
||||||
{
|
{
|
||||||
site: 'https://api.twitter.com'.freeze,
|
site: 'https://api.twitter.com',
|
||||||
authorize_path: '/oauth/authenticate'.freeze
|
authorize_path: '/oauth/authenticate'
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -41,13 +41,13 @@ class ContentExport < ActiveRecord::Base
|
||||||
before_create :set_global_identifiers
|
before_create :set_global_identifiers
|
||||||
|
|
||||||
# export types
|
# export types
|
||||||
COMMON_CARTRIDGE = 'common_cartridge'.freeze
|
COMMON_CARTRIDGE = 'common_cartridge'
|
||||||
COURSE_COPY = 'course_copy'.freeze
|
COURSE_COPY = 'course_copy'
|
||||||
MASTER_COURSE_COPY = 'master_course_copy'.freeze
|
MASTER_COURSE_COPY = 'master_course_copy'
|
||||||
QTI = 'qti'.freeze
|
QTI = 'qti'
|
||||||
USER_DATA = 'user_data'.freeze
|
USER_DATA = 'user_data'
|
||||||
ZIP = 'zip'.freeze
|
ZIP = 'zip'
|
||||||
QUIZZES2 = 'quizzes2'.freeze
|
QUIZZES2 = 'quizzes2'
|
||||||
CC_EXPORT_TYPES = [COMMON_CARTRIDGE, COURSE_COPY, MASTER_COURSE_COPY, QTI, QUIZZES2].freeze
|
CC_EXPORT_TYPES = [COMMON_CARTRIDGE, COURSE_COPY, MASTER_COURSE_COPY, QTI, QUIZZES2].freeze
|
||||||
|
|
||||||
workflow do
|
workflow do
|
||||||
|
|
|
@ -57,11 +57,11 @@ class ContextExternalTool < ActiveRecord::Base
|
||||||
:editor_button => [:use_tray].freeze
|
:editor_button => [:use_tray].freeze
|
||||||
}.freeze
|
}.freeze
|
||||||
|
|
||||||
DISABLED_STATE = 'disabled'.freeze
|
DISABLED_STATE = 'disabled'
|
||||||
QUIZ_LTI = 'Quizzes 2'.freeze
|
QUIZ_LTI = 'Quizzes 2'
|
||||||
ANALYTICS_2 = 'fd75124a-140e-470f-944c-114d2d93bb40'.freeze
|
ANALYTICS_2 = 'fd75124a-140e-470f-944c-114d2d93bb40'
|
||||||
TOOL_FEATURE_MAPPING = { ANALYTICS_2 => :analytics_2 }.freeze
|
TOOL_FEATURE_MAPPING = { ANALYTICS_2 => :analytics_2 }.freeze
|
||||||
PREFERRED_LTI_VERSION = '1_3'.freeze
|
PREFERRED_LTI_VERSION = '1_3'
|
||||||
|
|
||||||
workflow do
|
workflow do
|
||||||
state :anonymous
|
state :anonymous
|
||||||
|
|
|
@ -315,7 +315,7 @@ class Course < ActiveRecord::Base
|
||||||
|
|
||||||
# A hard limit on the number of graders (excluding the moderator) a moderated
|
# A hard limit on the number of graders (excluding the moderator) a moderated
|
||||||
# assignment can have.
|
# assignment can have.
|
||||||
MODERATED_GRADING_GRADER_LIMIT = 10.freeze
|
MODERATED_GRADING_GRADER_LIMIT = 10
|
||||||
|
|
||||||
def [](attr)
|
def [](attr)
|
||||||
attr.to_s == 'asset_string' ? self.asset_string : super
|
attr.to_s == 'asset_string' ? self.asset_string : super
|
||||||
|
|
|
@ -128,7 +128,7 @@ module Csp::AccountHelper
|
||||||
domains.uniq.sort
|
domains.uniq.sort
|
||||||
end
|
end
|
||||||
|
|
||||||
ACCOUNT_TOOL_CACHE_KEY_PREFIX = "account_tool_domains".freeze
|
ACCOUNT_TOOL_CACHE_KEY_PREFIX = "account_tool_domains"
|
||||||
def cached_tool_domains
|
def cached_tool_domains
|
||||||
@cached_tool_domains ||= Rails.cache.fetch([ACCOUNT_TOOL_CACHE_KEY_PREFIX, self.global_id].cache_key) do
|
@cached_tool_domains ||= Rails.cache.fetch([ACCOUNT_TOOL_CACHE_KEY_PREFIX, self.global_id].cache_key) do
|
||||||
get_account_tool_domains
|
get_account_tool_domains
|
||||||
|
|
|
@ -41,7 +41,7 @@ class ErrorReport < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
class Reporter
|
class Reporter
|
||||||
IGNORED_CATEGORIES = "404,ActionDispatch::RemoteIp::IpSpoofAttackError,Turnitin::Errors::SubmissionNotScoredError".freeze
|
IGNORED_CATEGORIES = "404,ActionDispatch::RemoteIp::IpSpoofAttackError,Turnitin::Errors::SubmissionNotScoredError"
|
||||||
|
|
||||||
def ignored_categories
|
def ignored_categories
|
||||||
Setting.get('ignored_error_report_categories', IGNORED_CATEGORIES).split(',')
|
Setting.get('ignored_error_report_categories', IGNORED_CATEGORIES).split(',')
|
||||||
|
|
|
@ -21,7 +21,7 @@ require 'English'
|
||||||
|
|
||||||
module Exporters
|
module Exporters
|
||||||
class Quizzes2Exporter
|
class Quizzes2Exporter
|
||||||
GROUP_NAME = 'Migrated Quizzes'.freeze
|
GROUP_NAME = 'Migrated Quizzes'
|
||||||
|
|
||||||
attr_accessor :course, :quiz
|
attr_accessor :course, :quiz
|
||||||
|
|
||||||
|
|
|
@ -20,10 +20,10 @@
|
||||||
module Lti
|
module Lti
|
||||||
module ContentMigrationService
|
module ContentMigrationService
|
||||||
class Migrator
|
class Migrator
|
||||||
FAILED_STATUS = 'failed'.freeze
|
FAILED_STATUS = 'failed'
|
||||||
JWT_LIFETIME = 30.seconds
|
JWT_LIFETIME = 30.seconds
|
||||||
SUCCESSFUL_STATUS = 'completed'.freeze
|
SUCCESSFUL_STATUS = 'completed'
|
||||||
JSON_FORMAT = 'json'.freeze
|
JSON_FORMAT = 'json'
|
||||||
private_constant :FAILED_STATUS, :JWT_LIFETIME, :SUCCESSFUL_STATUS, :JSON_FORMAT
|
private_constant :FAILED_STATUS, :JWT_LIFETIME, :SUCCESSFUL_STATUS, :JSON_FORMAT
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
|
@ -48,7 +48,7 @@ class Lti::LineItem < ApplicationRecord
|
||||||
before_destroy :destroy_resource_link, if: :assignment_line_item? # assignment will destroy all the other line_items of a resourceLink
|
before_destroy :destroy_resource_link, if: :assignment_line_item? # assignment will destroy all the other line_items of a resourceLink
|
||||||
before_destroy :destroy_assignment
|
before_destroy :destroy_assignment
|
||||||
|
|
||||||
AGS_EXT_SUBMISSION_TYPE = 'https://canvas.instructure.com/lti/submission_type'.freeze
|
AGS_EXT_SUBMISSION_TYPE = 'https://canvas.instructure.com/lti/submission_type'
|
||||||
|
|
||||||
def assignment_line_item?
|
def assignment_line_item?
|
||||||
assignment.line_items.order(:created_at).first.id == self.id
|
assignment.line_items.order(:created_at).first.id == self.id
|
||||||
|
|
|
@ -20,8 +20,8 @@
|
||||||
|
|
||||||
module Lti
|
module Lti
|
||||||
class MessageHandler < ActiveRecord::Base
|
class MessageHandler < ActiveRecord::Base
|
||||||
BASIC_LTI_LAUNCH_REQUEST = 'basic-lti-launch-request'.freeze
|
BASIC_LTI_LAUNCH_REQUEST = 'basic-lti-launch-request'
|
||||||
TOOL_PROXY_REREGISTRATION_REQUEST = 'ToolProxyRegistrationRequest'.freeze
|
TOOL_PROXY_REREGISTRATION_REQUEST = 'ToolProxyRegistrationRequest'
|
||||||
|
|
||||||
attr_readonly :created_at
|
attr_readonly :created_at
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ module Lti
|
||||||
POST_GRADES = 'post_grades'
|
POST_GRADES = 'post_grades'
|
||||||
RESOURCE_SELECTION = 'resource_selection'
|
RESOURCE_SELECTION = 'resource_selection'
|
||||||
SIMILARITY_DETECTION = 'similarity_detection'
|
SIMILARITY_DETECTION = 'similarity_detection'
|
||||||
GLOBAL_NAVIGATION = 'global_navigation'.freeze
|
GLOBAL_NAVIGATION = 'global_navigation'
|
||||||
|
|
||||||
SIMILARITY_DETECTION_LTI2 = 'Canvas.placements.similarityDetection'
|
SIMILARITY_DETECTION_LTI2 = 'Canvas.placements.similarityDetection'
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ class Lti::Result < ApplicationRecord
|
||||||
ACCEPT_GIVEN_SCORE_TYPES = %w[FullyGraded PendingManual].freeze
|
ACCEPT_GIVEN_SCORE_TYPES = %w[FullyGraded PendingManual].freeze
|
||||||
ACTIVITY_PROGRESS_TYPES = %w[Initialized Started InProgress Submitted Completed].freeze
|
ACTIVITY_PROGRESS_TYPES = %w[Initialized Started InProgress Submitted Completed].freeze
|
||||||
|
|
||||||
AGS_EXT_SUBMISSION = 'https://canvas.instructure.com/lti/submission'.freeze
|
AGS_EXT_SUBMISSION = 'https://canvas.instructure.com/lti/submission'
|
||||||
|
|
||||||
self.record_timestamps = false
|
self.record_timestamps = false
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
|
|
||||||
module Lti
|
module Lti
|
||||||
class ToolConfiguration < ActiveRecord::Base
|
class ToolConfiguration < ActiveRecord::Base
|
||||||
CANVAS_EXTENSION_LABEL = 'canvas.instructure.com'.freeze
|
CANVAS_EXTENSION_LABEL = 'canvas.instructure.com'
|
||||||
DEFAULT_PRIVACY_LEVEL = 'anonymous'.freeze
|
DEFAULT_PRIVACY_LEVEL = 'anonymous'
|
||||||
|
|
||||||
belongs_to :developer_key
|
belongs_to :developer_key
|
||||||
|
|
||||||
|
|
|
@ -27,9 +27,9 @@ module Lti
|
||||||
serialize :services
|
serialize :services
|
||||||
serialize :capabilities
|
serialize :capabilities
|
||||||
|
|
||||||
DEFAULT_TCP_UUID = "339b6700-e4cb-47c5-a54f-3ee0064921a9".freeze
|
DEFAULT_TCP_UUID = "339b6700-e4cb-47c5-a54f-3ee0064921a9"
|
||||||
|
|
||||||
WEBHOOK_GRANT_ALL_CAPABILITY = 'vnd.instructure.webhooks.root_account.all'.freeze
|
WEBHOOK_GRANT_ALL_CAPABILITY = 'vnd.instructure.webhooks.root_account.all'
|
||||||
WEBHOOK_SUBSCRIPTION_CAPABILITIES = {
|
WEBHOOK_SUBSCRIPTION_CAPABILITIES = {
|
||||||
all: [WEBHOOK_GRANT_ALL_CAPABILITY].freeze,
|
all: [WEBHOOK_GRANT_ALL_CAPABILITY].freeze,
|
||||||
quiz_submitted: %w(vnd.instructure.webhooks.root_account.quiz_submitted
|
quiz_submitted: %w(vnd.instructure.webhooks.root_account.quiz_submitted
|
||||||
|
|
|
@ -31,7 +31,7 @@ module MasterCourses
|
||||||
CONTENT_TYPES_FOR_DELETIONS = (ALLOWED_CONTENT_TYPES - ['Wiki']).freeze
|
CONTENT_TYPES_FOR_DELETIONS = (ALLOWED_CONTENT_TYPES - ['Wiki']).freeze
|
||||||
CONTENT_TYPES_FOR_UNSYNCED_CHANGES = (ALLOWED_CONTENT_TYPES - ['ContentTag', 'Wiki'] + ['Folder']).freeze
|
CONTENT_TYPES_FOR_UNSYNCED_CHANGES = (ALLOWED_CONTENT_TYPES - ['ContentTag', 'Wiki'] + ['Folder']).freeze
|
||||||
|
|
||||||
MIGRATION_ID_PREFIX = "mastercourse_".freeze
|
MIGRATION_ID_PREFIX = "mastercourse_"
|
||||||
|
|
||||||
LOCK_TYPES = [:content, :settings, :points, :due_dates, :availability_dates, :state].freeze
|
LOCK_TYPES = [:content, :settings, :points, :due_dates, :availability_dates, :state].freeze
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,6 @@ module Quizzes::LogAuditing
|
||||||
AND attempt = :attempt
|
AND attempt = :attempt
|
||||||
AND event_type = '#{EVENT_TYPE}'
|
AND event_type = '#{EVENT_TYPE}'
|
||||||
SQL
|
SQL
|
||||||
.freeze
|
|
||||||
|
|
||||||
# Main API. Extract, optimize, and persist an answer event from a given
|
# Main API. Extract, optimize, and persist an answer event from a given
|
||||||
# submission data construct.
|
# submission data construct.
|
||||||
|
|
|
@ -23,10 +23,10 @@ class Quizzes::QuizSubmissionEvent < ActiveRecord::Base
|
||||||
include CanvasPartman::Concerns::Partitioned
|
include CanvasPartman::Concerns::Partitioned
|
||||||
|
|
||||||
# An event describing the student choosing an answer to a question.
|
# An event describing the student choosing an answer to a question.
|
||||||
EVT_QUESTION_ANSWERED = "question_answered".freeze
|
EVT_QUESTION_ANSWERED = "question_answered"
|
||||||
EVT_QUESTION_FLAGGED = "question_flagged".freeze
|
EVT_QUESTION_FLAGGED = "question_flagged"
|
||||||
# An event for every new submission created
|
# An event for every new submission created
|
||||||
EVT_SUBMISSION_CREATED = "submission_created".freeze
|
EVT_SUBMISSION_CREATED = "submission_created"
|
||||||
|
|
||||||
belongs_to :quiz_submission, class_name: 'Quizzes::QuizSubmission'
|
belongs_to :quiz_submission, class_name: 'Quizzes::QuizSubmission'
|
||||||
resolves_root_account through: :quiz_submission
|
resolves_root_account through: :quiz_submission
|
||||||
|
|
|
@ -1582,7 +1582,7 @@ class RoleOverride < ActiveRecord::Base
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
ACCESS_TOKEN_SCOPE_PREFIX = 'https://api.instructure.com/auth/canvas'.freeze
|
ACCESS_TOKEN_SCOPE_PREFIX = 'https://api.instructure.com/auth/canvas'
|
||||||
|
|
||||||
def self.permissions
|
def self.permissions
|
||||||
Permissions.retrieve
|
Permissions.retrieve
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
class Setting < Switchman::UnshardedRecord
|
class Setting < Switchman::UnshardedRecord
|
||||||
SITE_ADMIN_ACCESS_TO_NEW_DEV_KEY_FEATURES = 'site_admin_access_to_new_dev_key_features'.freeze
|
SITE_ADMIN_ACCESS_TO_NEW_DEV_KEY_FEATURES = 'site_admin_access_to_new_dev_key_features'
|
||||||
|
|
||||||
def self.skip_cache
|
def self.skip_cache
|
||||||
@skip_cache, old_enabled = true, @skip_cache
|
@skip_cache, old_enabled = true, @skip_cache
|
||||||
|
|
|
@ -30,7 +30,7 @@ class UserPreferenceValue < ActiveRecord::Base
|
||||||
|
|
||||||
# this means that the preference value is no longer stored on the user object
|
# this means that the preference value is no longer stored on the user object
|
||||||
# and is in it's own record in the db
|
# and is in it's own record in the db
|
||||||
EXTERNAL = :external.freeze
|
EXTERNAL = :external
|
||||||
|
|
||||||
def self.add_user_preference(key, use_sub_keys: false)
|
def self.add_user_preference(key, use_sub_keys: false)
|
||||||
# set use_sub_keys if we were previously storing a big ol' Hash but only getting/setting one value at a time
|
# set use_sub_keys if we were previously storing a big ol' Hash but only getting/setting one value at a time
|
||||||
|
|
|
@ -30,7 +30,7 @@ module TimeZoneFormImprovements
|
||||||
|
|
||||||
unfriendly_zone = "".html_safe
|
unfriendly_zone = "".html_safe
|
||||||
unfriendly_zone.safe_concat options_for_select([["#{selected} (#{zone.formatted_offset})", selected]], selected)
|
unfriendly_zone.safe_concat options_for_select([["#{selected} (#{zone.formatted_offset})", selected]], selected)
|
||||||
unfriendly_zone.safe_concat content_tag("option".freeze, '-------------', value: '', disabled: true)
|
unfriendly_zone.safe_concat content_tag("option", '-------------', value: '', disabled: true)
|
||||||
unfriendly_zone.safe_concat "\n"
|
unfriendly_zone.safe_concat "\n"
|
||||||
unfriendly_zone.safe_concat result
|
unfriendly_zone.safe_concat result
|
||||||
result = unfriendly_zone
|
result = unfriendly_zone
|
||||||
|
|
|
@ -18,5 +18,5 @@
|
||||||
# with this program. If not, see <http://www.gnu.org/licenses/>.
|
# with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
module Audits
|
module Audits
|
||||||
VERSION = '0.1.0'.freeze
|
VERSION = '0.1.0'
|
||||||
end
|
end
|
||||||
|
|
|
@ -38,8 +38,8 @@ module CanvasQuizStatistics::Analyzers
|
||||||
inherit :responses, :full_credit, from: :essay
|
inherit :responses, :full_credit, from: :essay
|
||||||
inherit :correct, :incorrect, from: :fill_in_multiple_blanks
|
inherit :correct, :incorrect, from: :fill_in_multiple_blanks
|
||||||
|
|
||||||
RANGE_ANSWER = 'range_answer'.freeze
|
RANGE_ANSWER = 'range_answer'
|
||||||
PRECISION_ANSWER = 'precision_answer'.freeze
|
PRECISION_ANSWER = 'precision_answer'
|
||||||
|
|
||||||
# Statistics for the pre-defined answers.
|
# Statistics for the pre-defined answers.
|
||||||
#
|
#
|
||||||
|
|
|
@ -20,9 +20,9 @@
|
||||||
|
|
||||||
module CanvasSecurity
|
module CanvasSecurity
|
||||||
class KeyStorage
|
class KeyStorage
|
||||||
PAST = 'jwk-past.json'.freeze
|
PAST = 'jwk-past.json'
|
||||||
PRESENT = 'jwk-present.json'.freeze
|
PRESENT = 'jwk-present.json'
|
||||||
FUTURE = 'jwk-future.json'.freeze
|
FUTURE = 'jwk-future.json'
|
||||||
MAX_CACHE_AGE = 10.days.to_i
|
MAX_CACHE_AGE = 10.days.to_i
|
||||||
MIN_ROTATION_PERIOD = 1.hour
|
MIN_ROTATION_PERIOD = 1.hour
|
||||||
|
|
||||||
|
|
|
@ -21,8 +21,8 @@ require 'openssl'
|
||||||
|
|
||||||
module CanvasSecurity
|
module CanvasSecurity
|
||||||
class RSAKeyPair < JWKKeyPair
|
class RSAKeyPair < JWKKeyPair
|
||||||
KTY = 'RSA'.freeze
|
KTY = 'RSA'
|
||||||
ALG = 'RS256'.freeze
|
ALG = 'RS256'
|
||||||
SIZE = 2048
|
SIZE = 2048
|
||||||
def initialize(use: 'sig')
|
def initialize(use: 'sig')
|
||||||
super()
|
super()
|
||||||
|
|
|
@ -19,10 +19,10 @@
|
||||||
|
|
||||||
module LtiAdvantage::Serializers
|
module LtiAdvantage::Serializers
|
||||||
class JwtMessageSerializer
|
class JwtMessageSerializer
|
||||||
IMS_CLAIM_PREFIX = 'https://purl.imsglobal.org/spec/lti/claim/'.freeze
|
IMS_CLAIM_PREFIX = 'https://purl.imsglobal.org/spec/lti/claim/'
|
||||||
DL_CLAIM_PREFIX = 'https://purl.imsglobal.org/spec/lti-dl/claim/'.freeze
|
DL_CLAIM_PREFIX = 'https://purl.imsglobal.org/spec/lti-dl/claim/'
|
||||||
NRPS_CLAIM_URL = 'https://purl.imsglobal.org/spec/lti-nrps/claim/namesroleservice'.freeze
|
NRPS_CLAIM_URL = 'https://purl.imsglobal.org/spec/lti-nrps/claim/namesroleservice'
|
||||||
AGS_CLAIM_URL = 'https://purl.imsglobal.org/spec/lti-ags/claim/endpoint'.freeze
|
AGS_CLAIM_URL = 'https://purl.imsglobal.org/spec/lti-ags/claim/endpoint'
|
||||||
|
|
||||||
STANDARD_IMS_CLAIMS = %w(
|
STANDARD_IMS_CLAIMS = %w(
|
||||||
context
|
context
|
||||||
|
@ -46,8 +46,8 @@ module LtiAdvantage::Serializers
|
||||||
content_items
|
content_items
|
||||||
).freeze
|
).freeze
|
||||||
|
|
||||||
NAMES_AND_ROLES_SERVICE_CLAIM = 'names_and_roles_service'.freeze
|
NAMES_AND_ROLES_SERVICE_CLAIM = 'names_and_roles_service'
|
||||||
ASSIGNMENT_AND_GRADE_SERVICE_CLAIM = 'assignment_and_grade_service'.freeze
|
ASSIGNMENT_AND_GRADE_SERVICE_CLAIM = 'assignment_and_grade_service'
|
||||||
|
|
||||||
def initialize(object)
|
def initialize(object)
|
||||||
@object = object
|
@object = object
|
||||||
|
|
|
@ -23,7 +23,7 @@ module RuboCop
|
||||||
class NoDisableImplicitWait < Cop
|
class NoDisableImplicitWait < Cop
|
||||||
MSG = "Avoid using disable_implicit_wait.\n" \
|
MSG = "Avoid using disable_implicit_wait.\n" \
|
||||||
"Look through custom_selenium_rspec_matchers.rb" \
|
"Look through custom_selenium_rspec_matchers.rb" \
|
||||||
" and custom_wait_methods.rb.".freeze
|
" and custom_wait_methods.rb."
|
||||||
|
|
||||||
METHOD = :disable_implicit_wait
|
METHOD = :disable_implicit_wait
|
||||||
|
|
||||||
|
|
|
@ -27,9 +27,9 @@ module RuboCop
|
||||||
" Selenium::WebDriver::Error::NoSuchElementError" \
|
" Selenium::WebDriver::Error::NoSuchElementError" \
|
||||||
" (just like find_element, etc).\n" \
|
" (just like find_element, etc).\n" \
|
||||||
"Look through custom_selenium_rspec_matchers.rb" \
|
"Look through custom_selenium_rspec_matchers.rb" \
|
||||||
" and custom_wait_methods.rb.".freeze
|
" and custom_wait_methods.rb."
|
||||||
|
|
||||||
BAD_CONST = "Selenium::WebDriver::Wait".freeze
|
BAD_CONST = "Selenium::WebDriver::Wait"
|
||||||
BAD_CONST_MATCHER = BAD_CONST.split("::")
|
BAD_CONST_MATCHER = BAD_CONST.split("::")
|
||||||
.map { |name| ":#{name})" }
|
.map { |name| ":#{name})" }
|
||||||
.join(" ")
|
.join(" ")
|
||||||
|
|
|
@ -24,7 +24,7 @@ module RuboCop
|
||||||
module Specs
|
module Specs
|
||||||
class NoSkipWithoutTicket < Cop
|
class NoSkipWithoutTicket < Cop
|
||||||
MSG = "Reference a ticket if skipping."\
|
MSG = "Reference a ticket if skipping."\
|
||||||
" Example: skip('time bomb on saturdays CNVS-123456').".freeze
|
" Example: skip('time bomb on saturdays CNVS-123456')."
|
||||||
|
|
||||||
METHOD = :skip
|
METHOD = :skip
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ module RuboCop
|
||||||
class NoWaitForNoSuchElement < Cop
|
class NoWaitForNoSuchElement < Cop
|
||||||
MSG = "Avoid using wait_for_no_such_element. Instead, use"\
|
MSG = "Avoid using wait_for_no_such_element. Instead, use"\
|
||||||
" not_to contain_css/contain_link.\n"\
|
" not_to contain_css/contain_link.\n"\
|
||||||
"e.g. expect(f('#courses')).not_to contain_css('#course_123')".freeze
|
"e.g. expect(f('#courses')).not_to contain_css('#course_123')"
|
||||||
|
|
||||||
METHOD = :wait_for_no_such_element
|
METHOD = :wait_for_no_such_element
|
||||||
|
|
||||||
|
|
|
@ -1,23 +1,23 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Consts
|
module Consts
|
||||||
APP_COFFEE_PATH = "app/coffeescripts/calendar/CalendarEvent.coffee".freeze
|
APP_COFFEE_PATH = "app/coffeescripts/calendar/CalendarEvent.coffee"
|
||||||
APP_COFFEE_BUNDLE_PATH = "app/coffeescripts/bundles/authentication_providers.coffee".freeze
|
APP_COFFEE_BUNDLE_PATH = "app/coffeescripts/bundles/authentication_providers.coffee"
|
||||||
COFFEE_SPEC_PATH = "spec/coffeescripts/calendar/CalendarSpec.coffee".freeze
|
COFFEE_SPEC_PATH = "spec/coffeescripts/calendar/CalendarSpec.coffee"
|
||||||
|
|
||||||
APP_JSX_PATH = "app/jsx/dashboard_card/DashboardCardAction.js".freeze
|
APP_JSX_PATH = "app/jsx/dashboard_card/DashboardCardAction.js"
|
||||||
JSX_SPEC_PATH = "spec/javascripts/jsx/dashboard_card/DashboardCardActionSpec.coffee".freeze
|
JSX_SPEC_PATH = "spec/javascripts/jsx/dashboard_card/DashboardCardActionSpec.coffee"
|
||||||
|
|
||||||
APP_RB_PATH = "app/controllers/accounts_controller.rb".freeze
|
APP_RB_PATH = "app/controllers/accounts_controller.rb"
|
||||||
APP_RB_SPEC_PATH = "spec/controllers/accounts_controller_spec.rb".freeze
|
APP_RB_SPEC_PATH = "spec/controllers/accounts_controller_spec.rb"
|
||||||
LIB_RB_PATH = "lib/reporting/counts_report.rb".freeze
|
LIB_RB_PATH = "lib/reporting/counts_report.rb"
|
||||||
LIB_RB_SPEC_PATH = "spec/lib/reporting/counts_report_spec.rb".freeze
|
LIB_RB_SPEC_PATH = "spec/lib/reporting/counts_report_spec.rb"
|
||||||
|
|
||||||
APP_ERB_PATH = "app/views/announcements/index.html.erb".freeze
|
APP_ERB_PATH = "app/views/announcements/index.html.erb"
|
||||||
OTHER_ERB_PATH = "spec/formatters/error_context/html_page_formatter/template.html.erb".freeze
|
OTHER_ERB_PATH = "spec/formatters/error_context/html_page_formatter/template.html.erb"
|
||||||
PUBLIC_JS_PATH = "public/javascripts/account_statistics.js".freeze
|
PUBLIC_JS_PATH = "public/javascripts/account_statistics.js"
|
||||||
PUBLIC_JS_SPEC_PATH = "spec/javascripts/jsx/eportfolios/eportfolioSectionSpec.jsx".freeze
|
PUBLIC_JS_SPEC_PATH = "spec/javascripts/jsx/eportfolios/eportfolioSectionSpec.jsx"
|
||||||
|
|
||||||
PUBLIC_VENDOR_JS_PATH = "public/javascripts/vendor/bootstrap/bootstrap-dropdown.js".freeze
|
PUBLIC_VENDOR_JS_PATH = "public/javascripts/vendor/bootstrap/bootstrap-dropdown.js"
|
||||||
SELENIUM_SPEC_PATH = "spec/selenium/announcements/announcements_student_spec.rb".freeze
|
SELENIUM_SPEC_PATH = "spec/selenium/announcements/announcements_student_spec.rb"
|
||||||
end
|
end
|
||||||
|
|
|
@ -45,7 +45,7 @@ describe Utf8Cleaner do
|
||||||
end
|
end
|
||||||
|
|
||||||
it "strips out invalid characters from frozen strings" do
|
it "strips out invalid characters from frozen strings" do
|
||||||
frozen = "\x7Fohai".freeze
|
frozen = "\x7Fohai"
|
||||||
expect(Utf8Cleaner.strip_invalid_utf8(frozen)).to eql("ohai")
|
expect(Utf8Cleaner.strip_invalid_utf8(frozen)).to eql("ohai")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ module BrandableCSS
|
||||||
APP_ROOT = (defined?(Rails) && Rails.root) || Pathname.pwd
|
APP_ROOT = (defined?(Rails) && Rails.root) || Pathname.pwd
|
||||||
CONFIG = YAML.load_file(APP_ROOT.join('config/brandable_css.yml')).freeze
|
CONFIG = YAML.load_file(APP_ROOT.join('config/brandable_css.yml')).freeze
|
||||||
BRANDABLE_VARIABLES = JSON.parse(File.read(APP_ROOT.join(CONFIG['paths']['brandable_variables_json']))).freeze
|
BRANDABLE_VARIABLES = JSON.parse(File.read(APP_ROOT.join(CONFIG['paths']['brandable_variables_json']))).freeze
|
||||||
MIGRATION_NAME = 'RegenerateBrandFilesBasedOnNewDefaults'.freeze
|
MIGRATION_NAME = 'RegenerateBrandFilesBasedOnNewDefaults'
|
||||||
|
|
||||||
VARIABLE_HUMAN_NAMES = {
|
VARIABLE_HUMAN_NAMES = {
|
||||||
"ic-brand-primary" => lambda { I18n.t("Primary Brand Color") },
|
"ic-brand-primary" => lambda { I18n.t("Primary Brand Color") },
|
||||||
|
|
|
@ -28,7 +28,7 @@ module Canvas
|
||||||
# that puts a call to `fetch_without_expiration` in the rescue
|
# that puts a call to `fetch_without_expiration` in the rescue
|
||||||
# clause
|
# clause
|
||||||
module FallbackExpirationCache
|
module FallbackExpirationCache
|
||||||
KEY_SUFFIX = '__no_expire'.freeze
|
KEY_SUFFIX = '__no_expire'
|
||||||
|
|
||||||
def fetch(*, expires_in: nil, race_condition_ttl: nil)
|
def fetch(*, expires_in: nil, race_condition_ttl: nil)
|
||||||
return yield if expires_in == 0
|
return yield if expires_in == 0
|
||||||
|
|
|
@ -99,7 +99,7 @@ module Canvas::Migration::ExternalContent
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
NOT_FOUND = "$OBJECT_NOT_FOUND".freeze
|
NOT_FOUND = "$OBJECT_NOT_FOUND"
|
||||||
|
|
||||||
def get_canvas_id_from_migration_id(obj_class, migration_id)
|
def get_canvas_id_from_migration_id(obj_class, migration_id)
|
||||||
return NOT_FOUND if migration_id == NOT_FOUND
|
return NOT_FOUND if migration_id == NOT_FOUND
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
require 'vault'
|
require 'vault'
|
||||||
|
|
||||||
module Canvas::Vault
|
module Canvas::Vault
|
||||||
CACHE_KEY_PREFIX = 'vault/'.freeze
|
CACHE_KEY_PREFIX = 'vault/'
|
||||||
class MissingVaultSecret < StandardError; end
|
class MissingVaultSecret < StandardError; end
|
||||||
|
|
||||||
class << self
|
class << self
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
# You should have received a copy of the GNU Affero General Public License along
|
# You should have received a copy of the GNU Affero General Public License along
|
||||||
# with this program. If not, see <http://www.gnu.org/licenses/>.
|
# with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
class CSVWithI18n < CSV
|
class CSVWithI18n < CSV
|
||||||
BYTE_ORDER_MARK = "\xEF\xBB\xBF".freeze
|
BYTE_ORDER_MARK = "\xEF\xBB\xBF"
|
||||||
|
|
||||||
def initialize(data, **options)
|
def initialize(data, **options)
|
||||||
@include_bom = options.delete(:include_bom)
|
@include_bom = options.delete(:include_bom)
|
||||||
|
|
|
@ -96,7 +96,7 @@ module DataFixup
|
||||||
end
|
end
|
||||||
|
|
||||||
# sanity safety check
|
# sanity safety check
|
||||||
KEY_VALUE_PATTERN = '\s*"\d+"\s*:\s*"[0-9a-f-]+"\s*'.freeze
|
KEY_VALUE_PATTERN = '\s*"\d+"\s*:\s*"[0-9a-f-]+"\s*'
|
||||||
JSON_LINE_PATTERN = /^\s*{#{KEY_VALUE_PATTERN}(?:,#{KEY_VALUE_PATTERN})*}\s*$/.freeze
|
JSON_LINE_PATTERN = /^\s*{#{KEY_VALUE_PATTERN}(?:,#{KEY_VALUE_PATTERN})*}\s*$/.freeze
|
||||||
def valid_import_json?(line)
|
def valid_import_json?(line)
|
||||||
line =~ JSON_LINE_PATTERN
|
line =~ JSON_LINE_PATTERN
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
|
|
||||||
module DataFixup
|
module DataFixup
|
||||||
class InitAccountIndexForCourseAuditLog
|
class InitAccountIndexForCourseAuditLog
|
||||||
LAST_BATCH_TABLE = 'courses_index_last_batch'.freeze
|
LAST_BATCH_TABLE = 'courses_index_last_batch'
|
||||||
|
|
||||||
def self.run
|
def self.run
|
||||||
fixup = new
|
fixup = new
|
||||||
|
@ -57,11 +57,11 @@ module DataFixup
|
||||||
FROM courses
|
FROM courses
|
||||||
WHERE token(id) > token(?)
|
WHERE token(id) > token(?)
|
||||||
LIMIT ?
|
LIMIT ?
|
||||||
}.freeze
|
}
|
||||||
|
|
||||||
UPDATE_CQL = %{
|
UPDATE_CQL = %{
|
||||||
UPDATE courses SET account_id = ? WHERE id = ?
|
UPDATE courses SET account_id = ? WHERE id = ?
|
||||||
}.freeze
|
}
|
||||||
|
|
||||||
ResultStruct = Struct.new(:index, :record, :key)
|
ResultStruct = Struct.new(:index, :record, :key)
|
||||||
|
|
||||||
|
|
|
@ -24,13 +24,13 @@ module DataFixup
|
||||||
new.build_indexes
|
new.build_indexes
|
||||||
end
|
end
|
||||||
|
|
||||||
LAST_BATCH_TABLE = 'grade_changes_index_last_batch'.freeze
|
LAST_BATCH_TABLE = 'grade_changes_index_last_batch'
|
||||||
SEARCH_CQL = %{
|
SEARCH_CQL = %{
|
||||||
SELECT id, created_at, context_id, assignment_id, grader_id, student_id
|
SELECT id, created_at, context_id, assignment_id, grader_id, student_id
|
||||||
FROM grade_changes
|
FROM grade_changes
|
||||||
WHERE token(id) > token(?)
|
WHERE token(id) > token(?)
|
||||||
LIMIT ?
|
LIMIT ?
|
||||||
}.freeze
|
}
|
||||||
INDEX_METHODS = [
|
INDEX_METHODS = [
|
||||||
:add_course_assignment_index,
|
:add_course_assignment_index,
|
||||||
:add_course_assignment_grader_index,
|
:add_course_assignment_grader_index,
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
module DataFixup::Lti::UpdateCustomParams
|
module DataFixup::Lti::UpdateCustomParams
|
||||||
LOGGER_PREFIX = "Lti::UpdateCustomParams => ".freeze
|
LOGGER_PREFIX = "Lti::UpdateCustomParams => "
|
||||||
|
|
||||||
# This script will update all specified instances of LTI tools within Canvas,
|
# This script will update all specified instances of LTI tools within Canvas,
|
||||||
# it is intended to be copied and pasted into a Canvas console
|
# it is intended to be copied and pasted into a Canvas console
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
# with this program. If not, see <http://www.gnu.org/licenses/>.
|
# with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
module DataFixup::RebuildQuizSubmissionsFromQuizSubmissionEvents
|
module DataFixup::RebuildQuizSubmissionsFromQuizSubmissionEvents
|
||||||
LOG_PREFIX = "RebuildingQuizSubmissions - ".freeze
|
LOG_PREFIX = "RebuildingQuizSubmissions - "
|
||||||
|
|
||||||
SQL_SEARCH_STRING = <<-SQL
|
SQL_SEARCH_STRING = <<-SQL
|
||||||
select
|
select
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
# with this program. If not, see <http://www.gnu.org/licenses/>.
|
# with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
module DataFixup::RebuildQuizSubmissionsFromQuizSubmissionVersions
|
module DataFixup::RebuildQuizSubmissionsFromQuizSubmissionVersions
|
||||||
LOG_PREFIX = "RebuildingQuizSubmissions - ".freeze
|
LOG_PREFIX = "RebuildingQuizSubmissions - "
|
||||||
|
|
||||||
class << self
|
class << self
|
||||||
def run(submission_id, timestamp = Time.zone.now)
|
def run(submission_id, timestamp = Time.zone.now)
|
||||||
|
|
|
@ -36,7 +36,7 @@ module DataFixup
|
||||||
# submitted in the time range will have events
|
# submitted in the time range will have events
|
||||||
# retriggered.
|
# retriggered.
|
||||||
class ResendPlagiarismEvents
|
class ResendPlagiarismEvents
|
||||||
EVENT_NAME = 'plagiarism_resubmit'.freeze
|
EVENT_NAME = 'plagiarism_resubmit'
|
||||||
|
|
||||||
def self.run(start_time: 3.months.ago, end_time: Time.zone.now, only_errors: false)
|
def self.run(start_time: 3.months.ago, end_time: Time.zone.now, only_errors: false)
|
||||||
limit, = Setting.get('trigger_plagiarism_resubmit', '100,180').split(',').map(&:to_i)
|
limit, = Setting.get('trigger_plagiarism_resubmit', '100,180').split(',').map(&:to_i)
|
||||||
|
|
|
@ -33,8 +33,8 @@ module DataFixup::SetActlContextTypeForCourseLevelToolProxies
|
||||||
end
|
end
|
||||||
|
|
||||||
class ProductFamilyFixer
|
class ProductFamilyFixer
|
||||||
COURSE_CONTEXT_TYPE = 'Course'.freeze
|
COURSE_CONTEXT_TYPE = 'Course'
|
||||||
ACCOUNT_CONTEXT_TYPE = 'Account'.freeze
|
ACCOUNT_CONTEXT_TYPE = 'Account'
|
||||||
|
|
||||||
attr_reader :product_family
|
attr_reader :product_family
|
||||||
|
|
||||||
|
|
|
@ -68,7 +68,7 @@ class DueDateCacher
|
||||||
self.executing_users.last
|
self.executing_users.last
|
||||||
end
|
end
|
||||||
|
|
||||||
INFER_SUBMISSION_WORKFLOW_STATE_SQL = <<~SQL_FRAGMENT.freeze
|
INFER_SUBMISSION_WORKFLOW_STATE_SQL = <<~SQL_FRAGMENT
|
||||||
CASE
|
CASE
|
||||||
WHEN grade IS NOT NULL OR excused IS TRUE THEN
|
WHEN grade IS NOT NULL OR excused IS TRUE THEN
|
||||||
'graded'
|
'graded'
|
||||||
|
|
|
@ -28,7 +28,7 @@ module Lti
|
||||||
'default' => { template: 'lti/framed_launch' }.freeze,
|
'default' => { template: 'lti/framed_launch' }.freeze,
|
||||||
'full_width_in_context' => { template: 'lti/full_width_in_context' }.freeze,
|
'full_width_in_context' => { template: 'lti/full_width_in_context' }.freeze,
|
||||||
}.freeze
|
}.freeze
|
||||||
BLACKLIST_WILDCARD = '*'.freeze # to set up 'deny all' rules
|
BLACKLIST_WILDCARD = '*' # to set up 'deny all' rules
|
||||||
|
|
||||||
def self.display_template(display_type = nil, display_override: nil)
|
def self.display_template(display_type = nil, display_override: nil)
|
||||||
unless TOOL_DISPLAY_TEMPLATES.key?(display_type)
|
unless TOOL_DISPLAY_TEMPLATES.key?(display_type)
|
||||||
|
|
|
@ -36,7 +36,7 @@ module Lti::Messages
|
||||||
# Canvas, please see the inline documentation of
|
# Canvas, please see the inline documentation of
|
||||||
# app/models/lti/lti_advantage_adapter.rb.
|
# app/models/lti/lti_advantage_adapter.rb.
|
||||||
class JwtMessage
|
class JwtMessage
|
||||||
EXTENSION_PREFIX = 'https://www.instructure.com/'.freeze
|
EXTENSION_PREFIX = 'https://www.instructure.com/'
|
||||||
|
|
||||||
def initialize(tool:, context:, user:, expander:, return_url:, opts: {})
|
def initialize(tool:, context:, user:, expander:, return_url:, opts: {})
|
||||||
@tool = tool
|
@tool = tool
|
||||||
|
|
|
@ -22,7 +22,7 @@ module Lti
|
||||||
class AccessToken
|
class AccessToken
|
||||||
private_class_method :new
|
private_class_method :new
|
||||||
|
|
||||||
ISS = 'Canvas'.freeze
|
ISS = 'Canvas'
|
||||||
|
|
||||||
attr_reader :aud, :sub, :reg_key, :shard_id
|
attr_reader :aud, :sub, :reg_key, :shard_id
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ module Lti
|
||||||
class PlagiarismSubscriptionError < StandardError
|
class PlagiarismSubscriptionError < StandardError
|
||||||
end
|
end
|
||||||
|
|
||||||
SUBMISSION_EVENT_ID = 'vnd.Canvas.SubmissionEvent'.freeze
|
SUBMISSION_EVENT_ID = 'vnd.Canvas.SubmissionEvent'
|
||||||
EVENT_TYPES = %w(submission_created
|
EVENT_TYPES = %w(submission_created
|
||||||
plagiarism_resubmit
|
plagiarism_resubmit
|
||||||
submission_updated
|
submission_updated
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
module Lti
|
module Lti
|
||||||
class ReRegConstraint
|
class ReRegConstraint
|
||||||
RE_REG_HEADER = 'VND-IMS-CONFIRM-URL'.freeze
|
RE_REG_HEADER = 'VND-IMS-CONFIRM-URL'
|
||||||
|
|
||||||
def matches?(request)
|
def matches?(request)
|
||||||
request.headers[RE_REG_HEADER].present? &&
|
request.headers[RE_REG_HEADER].present? &&
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
|
|
||||||
module Lti::RedisMessageClient
|
module Lti::RedisMessageClient
|
||||||
TTL = 5.minutes
|
TTL = 5.minutes
|
||||||
LTI_1_3_PREFIX = 'external_tool:id_token:'.freeze
|
LTI_1_3_PREFIX = 'external_tool:id_token:'
|
||||||
SESSIONLESS_LAUNCH_PREFIX = 'external_tool:sessionless_launch:'.freeze
|
SESSIONLESS_LAUNCH_PREFIX = 'external_tool:sessionless_launch:'
|
||||||
|
|
||||||
def cache_launch(launch, context, prefix: LTI_1_3_PREFIX)
|
def cache_launch(launch, context, prefix: LTI_1_3_PREFIX)
|
||||||
return unless Canvas.redis_enabled?
|
return unless Canvas.redis_enabled?
|
||||||
|
|
|
@ -103,7 +103,7 @@ module Lti
|
||||||
values.each { |value| memo[value] += [key] }
|
values.each { |value| memo[value] += [key] }
|
||||||
end.reverse_merge({}).freeze
|
end.reverse_merge({}).freeze
|
||||||
|
|
||||||
LIS_V2_LTI_ADVANTAGE_ROLE_NONE = 'http://purl.imsglobal.org/vocab/lis/v2/system/person#None'.freeze
|
LIS_V2_LTI_ADVANTAGE_ROLE_NONE = 'http://purl.imsglobal.org/vocab/lis/v2/system/person#None'
|
||||||
|
|
||||||
def initialize(context, root_account, user, tool = nil)
|
def initialize(context, root_account, user, tool = nil)
|
||||||
@context = context
|
@context = context
|
||||||
|
|
|
@ -511,7 +511,7 @@ module SIS
|
||||||
ERRORS_TO_REASONS = {
|
ERRORS_TO_REASONS = {
|
||||||
'unique_id is invalid' => "Invalid login_id: '%{login_id}'",
|
'unique_id is invalid' => "Invalid login_id: '%{login_id}'",
|
||||||
}.freeze
|
}.freeze
|
||||||
DEFAULT_REASON = 'Unknown reason: %{message}'.freeze
|
DEFAULT_REASON = 'Unknown reason: %{message}'
|
||||||
|
|
||||||
def generate_readable_error_message(options)
|
def generate_readable_error_message(options)
|
||||||
response = ERRORS_TO_REASONS.fetch(options[:message]) { DEFAULT_REASON }
|
response = ERRORS_TO_REASONS.fetch(options[:message]) { DEFAULT_REASON }
|
||||||
|
|
|
@ -45,7 +45,7 @@ module SupportHelpers
|
||||||
end
|
end
|
||||||
|
|
||||||
def like_error
|
def like_error
|
||||||
"turnitin_data LIKE '%error%'".freeze
|
"turnitin_data LIKE '%error%'"
|
||||||
end
|
end
|
||||||
|
|
||||||
def object_type
|
def object_type
|
||||||
|
@ -73,7 +73,7 @@ module SupportHelpers
|
||||||
end
|
end
|
||||||
|
|
||||||
def like_error
|
def like_error
|
||||||
"turnitin_settings LIKE '%2305%'".freeze
|
"turnitin_settings LIKE '%2305%'"
|
||||||
end
|
end
|
||||||
|
|
||||||
def object_type
|
def object_type
|
||||||
|
@ -93,7 +93,7 @@ module SupportHelpers
|
||||||
end
|
end
|
||||||
|
|
||||||
def like_error
|
def like_error
|
||||||
"turnitin_settings LIKE '%MD5 not authenticated%'".freeze
|
"turnitin_settings LIKE '%MD5 not authenticated%'"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -269,7 +269,7 @@ module SupportHelpers
|
||||||
private
|
private
|
||||||
|
|
||||||
def like_error
|
def like_error
|
||||||
"turnitin_data LIKE '--- \n:last_processed_attempt: _\n' OR turnitin_data LIKE '--- \n:last_processed_attempt: _\nattachment_________: \n :status: pending\n'".freeze
|
"turnitin_data LIKE '--- \n:last_processed_attempt: _\n' OR turnitin_data LIKE '--- \n:last_processed_attempt: _\nattachment_________: \n :status: pending\n'"
|
||||||
end
|
end
|
||||||
|
|
||||||
def load_broken_objects
|
def load_broken_objects
|
||||||
|
@ -296,7 +296,7 @@ module SupportHelpers
|
||||||
end
|
end
|
||||||
|
|
||||||
def like_error
|
def like_error
|
||||||
'turnitin_data LIKE E\'%:status: pending\n:status: error\n:assignment_error: !ruby/hash:ActiveSupport::HashWithIndifferentAccess\n error_code: 217%\''.freeze
|
'turnitin_data LIKE E\'%:status: pending\n:status: error\n:assignment_error: !ruby/hash:ActiveSupport::HashWithIndifferentAccess\n error_code: 217%\''
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
# with this program. If not, see <http://www.gnu.org/licenses/>.
|
# with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
class TokenScopes
|
class TokenScopes
|
||||||
OAUTH2_SCOPE_NAMESPACE = '/auth/'.freeze
|
OAUTH2_SCOPE_NAMESPACE = '/auth/'
|
||||||
USER_INFO_SCOPE = {
|
USER_INFO_SCOPE = {
|
||||||
resource: :oauth2,
|
resource: :oauth2,
|
||||||
verb: "GET",
|
verb: "GET",
|
||||||
|
@ -28,28 +28,28 @@ class TokenScopes
|
||||||
CD2_SCOPE = {
|
CD2_SCOPE = {
|
||||||
resource: :peer_services,
|
resource: :peer_services,
|
||||||
verb: "GET",
|
verb: "GET",
|
||||||
scope: "cd2".freeze
|
scope: "cd2"
|
||||||
}.freeze
|
}.freeze
|
||||||
LTI_AGS_LINE_ITEM_SCOPE = "https://purl.imsglobal.org/spec/lti-ags/scope/lineitem".freeze
|
LTI_AGS_LINE_ITEM_SCOPE = "https://purl.imsglobal.org/spec/lti-ags/scope/lineitem"
|
||||||
LTI_AGS_LINE_ITEM_READ_ONLY_SCOPE = "https://purl.imsglobal.org/spec/lti-ags/scope/lineitem.readonly".freeze
|
LTI_AGS_LINE_ITEM_READ_ONLY_SCOPE = "https://purl.imsglobal.org/spec/lti-ags/scope/lineitem.readonly"
|
||||||
LTI_AGS_RESULT_READ_ONLY_SCOPE = "https://purl.imsglobal.org/spec/lti-ags/scope/result.readonly".freeze
|
LTI_AGS_RESULT_READ_ONLY_SCOPE = "https://purl.imsglobal.org/spec/lti-ags/scope/result.readonly"
|
||||||
LTI_AGS_SCORE_SCOPE = "https://purl.imsglobal.org/spec/lti-ags/scope/score".freeze
|
LTI_AGS_SCORE_SCOPE = "https://purl.imsglobal.org/spec/lti-ags/scope/score"
|
||||||
LTI_AGS_SHOW_PROGRESS_SCOPE = "https://canvas.instructure.com/lti-ags/progress/scope/show".freeze
|
LTI_AGS_SHOW_PROGRESS_SCOPE = "https://canvas.instructure.com/lti-ags/progress/scope/show"
|
||||||
LTI_NRPS_V2_SCOPE = "https://purl.imsglobal.org/spec/lti-nrps/scope/contextmembership.readonly".freeze
|
LTI_NRPS_V2_SCOPE = "https://purl.imsglobal.org/spec/lti-nrps/scope/contextmembership.readonly"
|
||||||
LTI_UPDATE_PUBLIC_JWK_SCOPE = "https://canvas.instructure.com/lti/public_jwk/scope/update".freeze
|
LTI_UPDATE_PUBLIC_JWK_SCOPE = "https://canvas.instructure.com/lti/public_jwk/scope/update"
|
||||||
LTI_ACCOUNT_LOOKUP_SCOPE = "https://canvas.instructure.com/lti/account_lookup/scope/show".freeze
|
LTI_ACCOUNT_LOOKUP_SCOPE = "https://canvas.instructure.com/lti/account_lookup/scope/show"
|
||||||
LTI_CREATE_DATA_SERVICE_SUBSCRIPTION_SCOPE = "https://canvas.instructure.com/lti/data_services/scope/create".freeze
|
LTI_CREATE_DATA_SERVICE_SUBSCRIPTION_SCOPE = "https://canvas.instructure.com/lti/data_services/scope/create"
|
||||||
LTI_SHOW_DATA_SERVICE_SUBSCRIPTION_SCOPE = "https://canvas.instructure.com/lti/data_services/scope/show".freeze
|
LTI_SHOW_DATA_SERVICE_SUBSCRIPTION_SCOPE = "https://canvas.instructure.com/lti/data_services/scope/show"
|
||||||
LTI_UPDATE_DATA_SERVICE_SUBSCRIPTION_SCOPE = "https://canvas.instructure.com/lti/data_services/scope/update".freeze
|
LTI_UPDATE_DATA_SERVICE_SUBSCRIPTION_SCOPE = "https://canvas.instructure.com/lti/data_services/scope/update"
|
||||||
LTI_LIST_DATA_SERVICE_SUBSCRIPTION_SCOPE = "https://canvas.instructure.com/lti/data_services/scope/list".freeze
|
LTI_LIST_DATA_SERVICE_SUBSCRIPTION_SCOPE = "https://canvas.instructure.com/lti/data_services/scope/list"
|
||||||
LTI_DESTROY_DATA_SERVICE_SUBSCRIPTION_SCOPE = "https://canvas.instructure.com/lti/data_services/scope/destroy".freeze
|
LTI_DESTROY_DATA_SERVICE_SUBSCRIPTION_SCOPE = "https://canvas.instructure.com/lti/data_services/scope/destroy"
|
||||||
LTI_LIST_EVENT_TYPES_DATA_SERVICE_SUBSCRIPTION_SCOPE = "https://canvas.instructure.com/lti/data_services/scope/list_event_types".freeze
|
LTI_LIST_EVENT_TYPES_DATA_SERVICE_SUBSCRIPTION_SCOPE = "https://canvas.instructure.com/lti/data_services/scope/list_event_types"
|
||||||
LTI_SHOW_FEATURE_FLAG_SCOPE = "https://canvas.instructure.com/lti/feature_flags/scope/show".freeze
|
LTI_SHOW_FEATURE_FLAG_SCOPE = "https://canvas.instructure.com/lti/feature_flags/scope/show"
|
||||||
LTI_CREATE_ACCOUNT_EXTERNAL_TOOLS_SCOPE = "https://canvas.instructure.com/lti/account_external_tools/scope/create".freeze
|
LTI_CREATE_ACCOUNT_EXTERNAL_TOOLS_SCOPE = "https://canvas.instructure.com/lti/account_external_tools/scope/create"
|
||||||
LTI_DESTROY_ACCOUNT_EXTERNAL_TOOLS_SCOPE = "https://canvas.instructure.com/lti/account_external_tools/scope/destroy".freeze
|
LTI_DESTROY_ACCOUNT_EXTERNAL_TOOLS_SCOPE = "https://canvas.instructure.com/lti/account_external_tools/scope/destroy"
|
||||||
LTI_LIST_ACCOUNT_EXTERNAL_TOOLS_SCOPE = "https://canvas.instructure.com/lti/account_external_tools/scope/list".freeze
|
LTI_LIST_ACCOUNT_EXTERNAL_TOOLS_SCOPE = "https://canvas.instructure.com/lti/account_external_tools/scope/list"
|
||||||
LTI_SHOW_ACCOUNT_EXTERNAL_TOOLS_SCOPE = "https://canvas.instructure.com/lti/account_external_tools/scope/show".freeze
|
LTI_SHOW_ACCOUNT_EXTERNAL_TOOLS_SCOPE = "https://canvas.instructure.com/lti/account_external_tools/scope/show"
|
||||||
LTI_UPDATE_ACCOUNT_EXTERNAL_TOOLS_SCOPE = "https://canvas.instructure.com/lti/account_external_tools/scope/update".freeze
|
LTI_UPDATE_ACCOUNT_EXTERNAL_TOOLS_SCOPE = "https://canvas.instructure.com/lti/account_external_tools/scope/update"
|
||||||
LTI_SCOPES = {
|
LTI_SCOPES = {
|
||||||
LTI_AGS_LINE_ITEM_SCOPE => I18n.t("Can create and view assignment data in the gradebook associated with the tool."),
|
LTI_AGS_LINE_ITEM_SCOPE => I18n.t("Can create and view assignment data in the gradebook associated with the tool."),
|
||||||
LTI_AGS_LINE_ITEM_READ_ONLY_SCOPE => I18n.t("Can view assignment data in the gradebook associated with the tool."),
|
LTI_AGS_LINE_ITEM_READ_ONLY_SCOPE => I18n.t("Can view assignment data in the gradebook associated with the tool."),
|
||||||
|
|
|
@ -18,8 +18,8 @@
|
||||||
# with this program. If not, see <http://www.gnu.org/licenses/>.
|
# with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
class PactApiConsumerProxy
|
class PactApiConsumerProxy
|
||||||
AUTH_HEADER = 'HTTP_AUTHORIZATION'.freeze
|
AUTH_HEADER = 'HTTP_AUTHORIZATION'
|
||||||
USER_HEADER = 'HTTP_AUTH_USER'.freeze
|
USER_HEADER = 'HTTP_AUTH_USER'
|
||||||
|
|
||||||
def call(env)
|
def call(env)
|
||||||
# Users calling the API will know the user name of the
|
# Users calling the API will know the user name of the
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
module Factories
|
module Factories
|
||||||
class GradingPeriodGroupHelper
|
class GradingPeriodGroupHelper
|
||||||
TITLE = "Example Grading Period Group".freeze
|
TITLE = "Example Grading Period Group"
|
||||||
|
|
||||||
def valid_attributes(attr = {})
|
def valid_attributes(attr = {})
|
||||||
{
|
{
|
||||||
|
|
|
@ -25,20 +25,20 @@ module Gradebook
|
||||||
extend SeleniumDependencies
|
extend SeleniumDependencies
|
||||||
|
|
||||||
# Student Headings
|
# Student Headings
|
||||||
STUDENT_COLUMN_MENU_SELECTOR = '.container_0 .Gradebook__ColumnHeaderAction'.freeze
|
STUDENT_COLUMN_MENU_SELECTOR = '.container_0 .Gradebook__ColumnHeaderAction'
|
||||||
|
|
||||||
# Gradebook Menu
|
# Gradebook Menu
|
||||||
GRADEBOOK_MENU_SELECTOR = '[data-component="GradebookMenu"]'.freeze
|
GRADEBOOK_MENU_SELECTOR = '[data-component="GradebookMenu"]'
|
||||||
INDIVIDUAL_VIEW_ITEM_SELECTOR = 'individual-gradebook'.freeze
|
INDIVIDUAL_VIEW_ITEM_SELECTOR = 'individual-gradebook'
|
||||||
GRADE_HISTORY_ITEM_SELECTOR = 'gradebook-history'.freeze
|
GRADE_HISTORY_ITEM_SELECTOR = 'gradebook-history'
|
||||||
LEARING_MASTERY_ITEM_SELECTOR = 'learning-mastery'.freeze
|
LEARING_MASTERY_ITEM_SELECTOR = 'learning-mastery'
|
||||||
|
|
||||||
# Action Menu
|
# Action Menu
|
||||||
ACTION_MENU_SELECTOR = '[data-component="ActionMenu"]'.freeze
|
ACTION_MENU_SELECTOR = '[data-component="ActionMenu"]'
|
||||||
ACTION_MENU_ITEM_SELECTOR = 'body [data-menu-id="%s"]'.freeze
|
ACTION_MENU_ITEM_SELECTOR = 'body [data-menu-id="%s"]'
|
||||||
|
|
||||||
# Menu Items
|
# Menu Items
|
||||||
MENU_ITEM_SELECTOR = 'span[data-menu-item-id="%s"]'.freeze
|
MENU_ITEM_SELECTOR = 'span[data-menu-item-id="%s"]'
|
||||||
|
|
||||||
def self.gradebook_settings_cog
|
def self.gradebook_settings_cog
|
||||||
f('#gradebook-settings-button')
|
f('#gradebook-settings-button')
|
||||||
|
|
|
@ -20,12 +20,12 @@
|
||||||
require_relative '../common'
|
require_relative '../common'
|
||||||
|
|
||||||
module AdminSettingsCommon
|
module AdminSettingsCommon
|
||||||
SIS_SYNC_ID = "#account_settings_sis_syncing_value".freeze
|
SIS_SYNC_ID = "#account_settings_sis_syncing_value"
|
||||||
SIS_IMPORT_ID = "#account_allow_sis_import".freeze
|
SIS_IMPORT_ID = "#account_allow_sis_import"
|
||||||
DUE_DATE_REQUIRED_CHECKBOX_ID = "#account_settings_sis_require_assignment_due_date_value".freeze
|
DUE_DATE_REQUIRED_CHECKBOX_ID = "#account_settings_sis_require_assignment_due_date_value"
|
||||||
NAME_LENGTH_ID = "#account_settings_sis_assignment_name_length_value".freeze
|
NAME_LENGTH_ID = "#account_settings_sis_assignment_name_length_value"
|
||||||
NAME_LENGTH_VALUE_ID = "#account_settings_sis_assignment_name_length_input_value".freeze
|
NAME_LENGTH_VALUE_ID = "#account_settings_sis_assignment_name_length_input_value"
|
||||||
DEFAULT_SIS = "#account_settings_sis_default_grade_export_value".freeze
|
DEFAULT_SIS = "#account_settings_sis_default_grade_export_value"
|
||||||
|
|
||||||
def turn_on_sis_settings(account)
|
def turn_on_sis_settings(account)
|
||||||
account.set_feature_flag! 'post_grades', 'on'
|
account.set_feature_flag! 'post_grades', 'on'
|
||||||
|
|
|
@ -21,9 +21,9 @@ module DifferentiatedAssignments
|
||||||
module HomeworkAssignee
|
module HomeworkAssignee
|
||||||
module Group
|
module Group
|
||||||
BASE = 'Group'
|
BASE = 'Group'
|
||||||
GROUP_X = "#{BASE} A".freeze
|
GROUP_X = "#{BASE} A"
|
||||||
GROUP_Y = "#{BASE} B".freeze
|
GROUP_Y = "#{BASE} B"
|
||||||
GROUP_Z = "#{BASE} C".freeze
|
GROUP_Z = "#{BASE} C"
|
||||||
ALL = Group.constants.map { |c| Group.const_get(c) }
|
ALL = Group.constants.map { |c| Group.const_get(c) }
|
||||||
.reject { |c| c == Group::BASE }
|
.reject { |c| c == Group::BASE }
|
||||||
.freeze
|
.freeze
|
||||||
|
@ -31,9 +31,9 @@ module DifferentiatedAssignments
|
||||||
|
|
||||||
module Section
|
module Section
|
||||||
BASE = 'Section'
|
BASE = 'Section'
|
||||||
SECTION_A = "#{BASE} A".freeze
|
SECTION_A = "#{BASE} A"
|
||||||
SECTION_B = "#{BASE} B".freeze
|
SECTION_B = "#{BASE} B"
|
||||||
SECTION_C = "#{BASE} C".freeze
|
SECTION_C = "#{BASE} C"
|
||||||
ALL = Section.constants.map { |c| Section.const_get(c) }
|
ALL = Section.constants.map { |c| Section.const_get(c) }
|
||||||
.reject { |c| c == Section::BASE }
|
.reject { |c| c == Section::BASE }
|
||||||
.freeze
|
.freeze
|
||||||
|
@ -41,16 +41,16 @@ module DifferentiatedAssignments
|
||||||
|
|
||||||
module Student
|
module Student
|
||||||
BASE = 'Student'
|
BASE = 'Student'
|
||||||
FIRST_STUDENT = "#{BASE} 1".freeze
|
FIRST_STUDENT = "#{BASE} 1"
|
||||||
SECOND_STUDENT = "#{BASE} 2".freeze
|
SECOND_STUDENT = "#{BASE} 2"
|
||||||
THIRD_STUDENT = "#{BASE} 3".freeze
|
THIRD_STUDENT = "#{BASE} 3"
|
||||||
FOURTH_STUDENT = "#{BASE} 4".freeze
|
FOURTH_STUDENT = "#{BASE} 4"
|
||||||
ALL = Student.constants.map { |c| Student.const_get(c) }
|
ALL = Student.constants.map { |c| Student.const_get(c) }
|
||||||
.reject { |c| c == Student::BASE }
|
.reject { |c| c == Student::BASE }
|
||||||
.freeze
|
.freeze
|
||||||
end
|
end
|
||||||
|
|
||||||
EVERYONE = 'Everyone'.freeze
|
EVERYONE = 'Everyone'
|
||||||
ALL = HomeworkAssignee.constants.map { |c| HomeworkAssignee.const_get(c) }
|
ALL = HomeworkAssignee.constants.map { |c| HomeworkAssignee.const_get(c) }
|
||||||
|
|
||||||
ASSIGNEES = [
|
ASSIGNEES = [
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue