-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdemo-moodle.R
More file actions
30 lines (19 loc) · 974 Bytes
/
demo-moodle.R
File metadata and controls
30 lines (19 loc) · 974 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
## exams ----------------------------------------------------------------------------
##set working directory
setwd("~/GitHub/r-tutorials")
## load package
library("exams")
## exam with a simple vector of exercises in R/Markdown (.Rmd) format
## -> alternatively try a list of vectors of more exercises
myexam <- c("deriv.Rmd", "swisscapital.Rmd", "boxplots.Rmd", "function.Rmd", "lm.Rmd")
## exams2moodle ---------------------------------------------------------------------
## Moodle XML output (1 file containing all exams)
## -> for import into a Moodle system
## generate Moodle exam with three replications per question
exams2moodle(myexam, n = 3, name = "moodle-demo",
dir = "output",
edir = "exercises")
## hint: to quickly check (prior to Moodle export) whether each exercise can be
## converted to HTML, exams2html() can be used
exams2html("exercises/deriv.Rmd")
## ----------------------------------------------------------------------------------