Document

@Serializable
data class Document(val id: String, val name: String, val modules: List<CourseConfig.Module> = emptyList(), val exerciseModules: Map<Long, Map<String, String>> = emptyMap(), val aPlusUrl: String? = null, val languages: List<String> = emptyList(), val version: String = "1.0", val resources: CourseConfig.Resources? = null, val requiredPlugins: List<CourseConfig.RequiredPlugin> = emptyList(), val vmOptions: Map<String, String> = emptyMap(), val optionalCategories: List<String> = emptyList(), val autoInstall: List<String> = emptyList(), val scalaRepl: CourseConfig.ScalaRepl? = null, val callbacks: CourseConfig.Callbacks? = null, val hiddenElements: List<Long> = emptyList(), val grading: CourseConfig.Grading? = null, val alwaysShowGroups: Boolean = false)(source)

A course manifest. IDE settings are optional for template-only consumers such as Hanami. JSON input requires id, name, modules and exerciseModules. Empty module lists and exercise mappings are always written because existing consumers require these fields. The collection defaults apply when constructing a document in Kotlin.

JSON examples: minimal catalog, Scala course, Python course.

Samples

val document = CourseConfig.Document(id = "524", name = "Example course")
val json = document.toJson()
return CourseConfig.parse(json)
val document = CourseConfig.Document(
    id = "524",
    name = "Example course",
    aPlusUrl = "https://plus.cs.aalto.fi/",
    languages = listOf("en"),
    version = "4.4",
    modules = listOf(CourseConfig.Module("Hello", "https://example.org/Hello.zip", version = "1.2")),
    exerciseModules = mapOf(42L to mapOf("en" to "Hello"), 43L to mapOf("en" to "StudentProject")),
    autoInstall = listOf("Hello"),
)
CourseConfig.validate(document)
return document

Constructors

Link copied to clipboard
constructor(id: String, name: String, modules: List<CourseConfig.Module> = emptyList(), exerciseModules: Map<Long, Map<String, String>> = emptyMap(), aPlusUrl: String? = null, languages: List<String> = emptyList(), version: String = "1.0", resources: CourseConfig.Resources? = null, requiredPlugins: List<CourseConfig.RequiredPlugin> = emptyList(), vmOptions: Map<String, String> = emptyMap(), optionalCategories: List<String> = emptyList(), autoInstall: List<String> = emptyList(), scalaRepl: CourseConfig.ScalaRepl? = null, callbacks: CourseConfig.Callbacks? = null, hiddenElements: List<Long> = emptyList(), grading: CourseConfig.Grading? = null, alwaysShowGroups: Boolean = false)

Properties

Link copied to clipboard

Whether to display exercise groups even when their heading is redundant.

Link copied to clipboard

A+ server base URL.

Link copied to clipboard

Names of downloadable modules installed during course setup.

Link copied to clipboard

Plugin callback identifiers.

Link copied to clipboard

Exercise API IDs mapped to language codes and module names. A module may be student-created and therefore absent from modules.

Link copied to clipboard

Grade progression rules. Omit to hide grade progression.

Link copied to clipboard

A+ element IDs hidden from the course view.

Link copied to clipboard
val id: String

Course's positive A+ ID within Long range.

Link copied to clipboard

Course language codes, such as fi and en.

Link copied to clipboard

Downloadable modules, in display order. Student-created modules need no entry.

Link copied to clipboard

Course name shown to students.

Link copied to clipboard

Exercise categories excluded from mandatory progress.

Link copied to clipboard

IntelliJ plugins required by the course.

Link copied to clipboard

Optional IDE settings and feedback styling downloads.

Link copied to clipboard

Per-module Scala REPL setup.

Link copied to clipboard

Plugin version used for compatibility checks, parsed by ConfigVersion.parse. A+ Courses blocks setup for an older major. Other mismatches trigger notifications.

Link copied to clipboard

JVM system properties applied by the plugin.

Functions

Link copied to clipboard
fun toJson(): String

Validates and serializes this manifest as formatted JSON.