Skip to contents

Creates a small, ready-to-edit tracking configuration template. The template can be written either as a directory of CSV files or as one YAML file.

Usage

create_tracking_config_template(
  path,
  format = c("csv", "yaml"),
  overwrite = FALSE
)

Arguments

path

Output path. For format = "csv", this is a directory. For format = "yaml", this is a YAML file path.

format

Template format. One of "csv" or "yaml".

overwrite

If TRUE, replace existing template files at path. Defaults to FALSE.

Value

A tibble with the created template component names and file paths, invisibly.

Examples

config_dir <- tempfile()
create_tracking_config_template(config_dir, format = "csv")
read_tracking_config(config_dir)
#> $courses
#> # A tibble: 1 × 3
#>   course_id course_label   semester
#>   <chr>     <chr>          <chr>   
#> 1 stat101   Statistics 101 W2026   
#> 
#> $tutorials
#> # A tibble: 1 × 4
#>   tutorial_id course_id tutorial_label version
#>   <chr>       <chr>     <chr>          <chr>  
#> 1 module_01   stat101   Module 1       0.0.1  
#> 
#> $students
#> # A tibble: 2 × 4
#>   student_id  student_label email                   group_id
#>   <chr>       <chr>         <chr>                   <chr>   
#> 1 student_001 Student 001   student_001@example.org A       
#> 2 student_002 Student 002   student_002@example.org A       
#> 
#> $questions
#> # A tibble: 2 × 5
#>   tutorial_id question_id question_label question_type max_score
#>   <chr>       <chr>       <chr>          <chr>             <dbl>
#> 1 module_01   q1          Question 1     radio                 1
#> 2 module_01   q2          Question 2     numeric               1
#>