The instructor toolkit keeps a course's teaching materials in one folder
that you can edit, extend and re-run with your own data. new_course()
creates the folder:
Usage
new_course(path, title = NULL, instructor = NULL, overwrite = FALSE)
course_materials(course = ".")Value
new_course() returns the course path, invisibly.
course_materials() returns a tibble with one row per material: name,
type ("lab" or "chapter"), title, path, source ("toolkit"
for labs built with new_lab(), "built-in" for copies of the package's
labs, "book" for chapters copied from the mirtverse book, "own"
otherwise) and data (the data a toolkit lab uses).
Details
course.json: The course title and instructor.README.md: A short how-to for whoever opens the folder next.labs/: Interactive labs (learnr tutorials), one folder each, made withnew_lab()orcopy_lab().chapters/: Notes chapters (R Markdown), made withnew_chapter()orcopy_chapter().data/: Your raw data files, for reference.
course_materials() lists the labs and chapters in a course folder. It
scans labs/ and chapters/, so materials you add by hand are listed too.
All toolkit functions take paths, never ask questions, and return the path they wrote (invisibly) or a tibble, so they can be scripted.
Examples
course <- file.path(tempdir(), "irt-course")
new_course(course, title = "EDPY 507: Item response theory")
copy_lab("model-choice", course)
course_materials(course)
#> # A tibble: 1 × 6
#> name type title path source data
#> <chr> <chr> <chr> <chr> <chr> <chr>
#> 1 model-choice lab Lab 1: Choosing a model the board can d… /tmp… built… NA