/** * OneRoster Resources Types * * Types for digital learning resources and content. */ import type { TimebackGrade, TimebackSubject } from '../../primitives'; import type { LessonType } from '../qti/primitives'; import type { Base, LearningObjectiveSet, Ref } from './base'; /** * Resource type - determines which path prefix to use. */ export type ResourceType = 'rostering' | 'gradebook' | 'resources'; /** * Common metadata fields shared across all resource types. */ export interface BaseResourceMetadata { /** Academic subject area (e.g., "Math", "Science", "Language") */ subject?: TimebackSubject; /** Array or range of grade levels */ grades?: TimebackGrade[]; /** Language of the content, using standard IETF BCP 47 codes (e.g., "en-US") */ language?: string; /** Experience points (XP) assigned for completing this resource */ xp?: number; /** Learning objectives this resource is aligned to */ learningObjectiveSet?: LearningObjectiveSet; /** Array of topic-related tags or important terms covered by the content */ keywords?: string[]; /** Direct content URL or support URL */ url?: string; /** Estimated seconds for a student to consume the content */ timeLength?: number; /** UI label for the activity badge (e.g., "Article", "Exercise", "Quiz", "Video"). */ activityType?: string; /** Extensible for custom vendor-specific fields */ [key: string]: unknown; } /** * Metadata for QTI (IMS Question and Test Interoperability) resources. */ export interface QtiResourceMetadata extends BaseResourceMetadata { type: 'qti'; /** Specific QTI type: "qti-question", "qti-test", "qti-test-bank", "qti-stimulus" */ subType?: 'qti-question' | 'qti-test' | 'qti-test-bank' | 'qti-stimulus'; } /** * Metadata for textual resources (PDFs, eBooks, etc.). */ export interface TextualResourceMetadata extends BaseResourceMetadata { type: 'text'; /** File or content format (e.g., "pdf", "epub", "docx", "html") */ format?: string; /** Name of the person or organization that created the content */ author?: string; /** Number of pages if applicable */ pageCount?: number; /** Number of words in the content */ wordLength?: number; } /** * Metadata for audio recordings. */ export interface AudioResourceMetadata extends BaseResourceMetadata { type: 'audio'; /** Length of the audio in HH:MM:SS format */ duration?: string; /** Audio format (e.g., "mp3", "wav") */ format?: string; /** Name of the speaker or narrator */ speaker?: string; } /** * Metadata for video content. */ export interface VideoResourceMetadata extends BaseResourceMetadata { type: 'video'; /** Length of the video in HH:MM:SS format */ duration?: string; /** Indicates if closed captions are available */ captionsAvailable?: boolean; /** Video format (e.g., "mp4", "webm", "mov") */ format?: string; } /** * Metadata for interactive 3rd party tools (Desmos, LTI apps, etc.). */ export interface InteractiveResourceMetadata extends BaseResourceMetadata { type: 'interactive'; /** The URL used to launch the tool, often via LTI or similar protocols */ launchUrl?: string; /** Name of the external tool provider (e.g., "Desmos", "Khan Academy") */ toolProvider?: string; /** Teaching method supported (e.g., "exploratory", "direct-instruction") */ instructionalMethod?: string; } /** * Metadata for visual resources (images, diagrams, etc.). */ export interface VisualResourceMetadata extends BaseResourceMetadata { type: 'visual'; /** Image format (e.g., "png", "jpeg", "svg", "pdf") */ format?: string; /** Dimensions in pixels (e.g., "1920x1080") */ resolution?: string; } /** * Metadata for structured course materials. */ export interface CourseMaterialResourceMetadata extends BaseResourceMetadata { type: 'course-material'; /** Material classification: "unit", "course", "resource-collection" */ subType?: 'unit' | 'course' | 'resource-collection'; /** Name of the person or organization who created the material */ author?: string; /** File format (e.g., "docx", "pdf", "cc") */ format?: string; /** Teaching method supported (e.g., "direct-instruction", "project-based") */ instructionalMethod?: string; } /** * Metadata for a collection of assessments served in sequence. */ export interface AssessmentBankResourceMetadata extends BaseResourceMetadata { type: 'assessment-bank'; /** Array of individual test Resource IDs included in this bank */ resources: string[]; } /** * Union of all valid resource metadata types. * Uses the `type` field as a discriminator. */ export type ResourceMetadata = QtiResourceMetadata | TextualResourceMetadata | AudioResourceMetadata | VideoResourceMetadata | InteractiveResourceMetadata | VisualResourceMetadata | CourseMaterialResourceMetadata | AssessmentBankResourceMetadata | BaseResourceMetadata; /** * A digital learning resource (content, activity, or material). * * Resources represent external content that can be assigned to * students through courses and classes. */ export interface Resource extends Base { /** Resource title */ title: string; /** Roles this resource is intended for */ roles?: ('primary' | 'secondary')[]; /** Importance level of this resource */ importance?: 'primary' | 'secondary'; /** Vendor's identifier for this resource */ vendorResourceId: string; /** Vendor identifier */ vendorId?: string; /** Application identifier */ applicationId?: string; /** Content-specific metadata */ metadata?: ResourceMetadata | null; } /** * A resource linked to a course component. * * Component resources map digital content to specific parts * of a course structure. */ export interface ComponentResource extends Base { /** Resource title */ title: string; /** Course component this resource belongs to */ courseComponent: Ref; /** The resource being linked */ resource: Ref; /** Display order within the component */ sortOrder?: number; /** Type of lesson (proprietary extension) */ lessonType?: LessonType; } //# sourceMappingURL=resources.d.ts.map