Generated Courses

Writing Trane courses in the way specified in the Writing Trane Courses section can get tedious quickly, even if you are automating the process. In order to make it easier to write courses for Trane, Trane can now automatically generate most of the manifest files specified in the previous section as long as your files fit the structure specified by each type of generated course.

This has several advantages:

  • Reduce the number of manifests needed to write a course. Generated courses still require a course_manifest.json file. This file specifies the type of generated course as well as any available options. However, you do not need to write any manifests for the lessons and exercises in the course.
  • You can combine normal and generated courses seamlessly. Internally, Trane uses the generator config and the files in the course directory to generate all the manifests needed. This means that once those manifests are generated, Trane makes no distinction between normal and generated courses. Generated courses can include individual lessons that are specified via their manifests. Generated courses can depend on any other course or lesson.
  • Less maintenance required for course authors. Trane's data formats and APIs are still subject to change. Since generated courses do not require you to write all but the course manifest, most changes to those formats should not require any changes on your part.
  • Save on disk space. Normal courses can end up with a lot of manifests (one per the course, one per lesson, and another one per exercise). Generated courses only require at minimum one manifest per course but can contain more if there are lessons that are not generated.
  • Generated courses enable custom learning experiences. For example, the transcription course takes a set of musical passages, which could either be entire songs or just a few bars, and generates a course that guides the student through internalizing the song in their ear and their instruments of choice.

How to Write a Generated Course

The process is as follows:

  1. Create a directory for your course. And write the course_manifest.json file just as you would for a normal course. A new field called course_generator specifies which course generator to use for this course. Its value is None for normal courses. For generated courses, it must be specified along with any available options.
  2. Add files to your course directory. Each type of generated course requires a specific type of file structure. Refer to the documentation for each type of generated course for more details.
  3. Once that process is complete, open the Trane library to which this course belongs. All the required manifests will be generated automatically and added to Trane. After that, you can work with them in the same way as you would with any other course.

Generated Course config

The specification for the course_generator field in the course_manifest.json file is as follows:

#![allow(unused)]
fn main() {
/// A configuration used for generating special types of courses on the fly.
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
pub enum CourseGenerator {
    /// The configuration for generating a knowledge base course. Currently, there are no
    /// configuration options, but the struct was added to implement the [GenerateManifests] trait
    /// and for future extensibility.
    KnowledgeBase(KnowledgeBaseConfig),

    /// The configuration for generating a music piece course.
    MusicPiece(MusicPieceConfig),

    /// The configuration for generating a transcription course.
    Transcription(TranscriptionConfig),
}
}

Refer to the documentation for each type of generated course for the specification for each type of config.

Example configs

Refer to the documentation for each type of generated course for examples of the course_generator configuration.