Sha256: 6858c680508c8afca88fec40a77aaf3ac448a817791515c3f8060450595184d2
Contents?: true
Size: 1.94 KB
Versions: 28
Compression:
Stored size: 1.94 KB
Contents
# frozen_string_literal: true # # <%= autogenerated_model_warning %> class LearningOutcomeResult < ActiveRecord::Base include CanvasSync::Record include CanvasSync::Concerns::ApiSyncable belongs_to :user, primary_key: :canvas_id, foreign_key: :canvas_user_id, optional: true belongs_to :learning_outcome, primary_key: :canvas_id, foreign_key: :canvas_learning_outcome_id, optional: true belongs_to :alignment, class_name: "ContentTag", primary_key: :canvas_id, foreign_key: :canvas_content_tag_id, optional: true belongs_to :association_object, polymorphic: [:rubric_association, :assignment], foreign_key: :association_id, foreign_type: :association_type, optional: true belongs_to :artifact, polymorphic: [:rubric_assessment, :submission], primary_key: :canvas_artifact_id, foreign_key: :canvas_artifact_id, foreign_type: :canvas_artifact_type, optional: true belongs_to :context, polymorphic: [:course], primary_key: :canvas_id, foreign_key: :canvas_context_id, foreign_type: :canvas_context_type, optional: true # Not yet implemented in CanvasSync # belongs_to :associated_asset, # polymorphic: # [:assessment_question, # :assignment, # { quiz: "Quizzes::Quiz", assessment: "LiveAssessments::Assessment" }], # polymorphic_prefix: true # Not yet implemented in CanvasSync # has_many :learning_outcome_question_results, dependent: :destroy api_syncable({ canvas_id: :id, canvas_content_tag_id: :links&.[]("alignment"), canvas_learning_outcome_id: :links&.[]("learning_outcome"), canvas_user_id: :links&.[]("user"), score: :score, assessed_at: :submitted_or_assessed_at, percent: :percent }, ->(api) { api.get("/api/v1/courses/#{self.canvas_context_id}/#{self.canvas_id}")&.find { |item| item[:id] == self.canvas_id } }) end
Version data entries
28 entries across 28 versions & 1 rubygems