create_exercise: Create Course Exercise From Template

View source: R/create_ex.R

create_exerciseR Documentation

Create Course Exercise From Template

Description

The template rttexercise in the package rteachtools is used to create a new exercise. The use of this template-based creation approach assures that the structure of the source document is consistent with the requirements of the deployment tools.

Usage

create_exercise(ps_ex_path, pn_nr_problem, pl_data)

Arguments

ps_ex_path

path to output file where exercise should be written to

pn_nr_problem

number of problems in exercise

pl_data

list of replacement data for replacing placeholder

Details

The function rmarkdown::draft() is used to convert the template into the target document. Further, the placeholders in the template are replaced by specific values using the function whisker::whisker_render().

Examples

## Not run: 
create_exercise(ps_ex_path    = "ex/gel_ex01",
                pn_nr_problem = 2,
                pl_data       = list(course_name = "Genetic Evaluation",
                                     exercise_count = 1,
                                     creation_date = format(Sys.Date(), "%Y-%m-%d"),
                                     author = "Peter von Rohr"))

## End(Not run)

charlotte-ngs/rteachtools documentation built on Sept. 21, 2023, 4:20 p.m.