CourseSource

interface CourseSource(source)

Supplies course structure and progress data from A+ in Hanami-owned models.

URLs returned through these models must be absolute HTTP or HTTPS URLs accepted by the configured A+ and outbound-resource policies.

Properties

Link copied to clipboard
abstract val webUrl: String

Base browser URL for links that open the configured A+ instance.

Functions

Link copied to clipboard
abstract suspend fun course(courseId: Long, token: String): ExternalCourse

Returns the course metadata visible to token.

Link copied to clipboard
abstract suspend fun courseStructure(entry: CourseEntry, lang: String, token: String): CourseStructure

Builds the localized static course hierarchy configured by entry.

Link copied to clipboard
abstract suspend fun discoverLtiLoginUrl(courseHtmlUrl: String): String?

Returns the configured Hanami LTI login URL found on courseHtmlUrl, if present.

Link copied to clipboard
abstract fun invalidateCourse(courseId: Long)

Invalidates adapter-owned raw data after course configuration changes.

Link copied to clipboard
open fun preloadCourseStructure(entry: CourseEntry, token: String)

Enqueues a course-structure load when the adapter has no usable cached value.

Link copied to clipboard
abstract fun studentBestSnapshot(entry: CourseEntry, lang: String, studentId: String, structure: CourseStructure, points: CoursePoints): StudentBestSnapshot

Maps cached points onto an existing localized structure.

Link copied to clipboard
abstract suspend fun studentPoints(courseId: Long, studentId: String, token: String): CoursePoints

Returns the complete points data used to resolve submission links for one student.

Link copied to clipboard
abstract suspend fun studentPointsSummary(courseId: Long, studentId: String, token: String): StudentPointsSummary

Returns the compact points summary used by staff course views.

Link copied to clipboard
abstract suspend fun students(entry: CourseEntry, token: String): List<StudentView>

Returns enrolled students using the grader and tag rules in entry.

Link copied to clipboard
abstract suspend fun tags(courseId: Long, token: String): List<ExternalCourseTag>

Returns the course tags visible to token.

Link copied to clipboard
abstract suspend fun weekFileUrls(weekId: Long, structure: CourseStructure, points: CoursePoints, token: String): WeekFileUrls

Resolves file links for weekId from the supplied structure and points data.