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.

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

if (FALSE) { 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")) }