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)
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 |
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()
.