add_exercise: Add exercise to chapter file

Description Usage Arguments Examples

Description

Add exercise to chapter file

Usage

1
2
3
add_exercise(chapter_file, lang, type = c("NormalExercise",
  "MultipleChoiceExercise", "VideoExercise", "RStudioMultipleChoiceExercise",
  "ShinyNormalExercise"), title = NULL, content = NULL)

Arguments

chapter_file

path to the chapter you want to append a template to

lang

The programming language of the exercises in the template

type

type of the exercise you want to add a template for (default is "NormalExercise")

title

Title of the exercise

content

Short summary of the exercise (will be filled in in assignment part)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## Not run: 
add_exercise("chapter1.Rmd", lang = "r", type = "NormalExercise")
add_exercise("chapter1.Rmd", lang = "r", type = "MultipleChoiceExercise")
add_exercise("chapter1.Rmd", lang = "r", type = "VideoExercise")
add_exercise("chapter1.Rmd", lang = "r", type = "NormalExercise",
             title = "My Normal Exercise", content = "This is a normal exercise.")
add_exercise("chapter1.Rmd", lang = "r", type = "MultipleChoiceExercise")
             title = "My Multiple Choice Exercise", content = "This is an MCE.")
add_exercise("chapter1.Rmd", lang = "r", type = "VideoExercise",
             title = "My Video", content = "This video discusses interesting things.")

add_exercise("chapter1.md", lang = "python", type = "NormalExercise")
add_exercise("chapter1.md", lang = "python", type = "MultipleChoiceExercise")
add_exercise("chapter1.md", lang = "python", type = "VideoExercise")
add_exercise("chapter1.md", lang = "python", type = "NormalExercise",
             title = "My Normal Exercise", content = "This is a normal exercise.")
add_exercise("chapter1.md", lang = "python", type = "MultipleChoiceExercise")
             title = "My Multiple Choice Exercise", content = "This is an MCE.")
add_exercise("chapter1.md", lang = "python", type = "VideoExercise",
             title = "My Video", content = "This video discusses interesting things.")

## End(Not run)

Data-Camp/datacamp documentation built on May 6, 2019, 1:38 p.m.