json2report | R Documentation |
Creates a PDF report of the results and questions of JSON download of the detailled answers in Moodle.
A template file is used to create the report; if not given then the package default hu_german.Rmd
is used, see system.file('template', 'hu_german.Rmd', package="exams2moodle")
.
If the title
is not given then the file name of the JSON file will be used.
json2report(
json,
template = NULL,
title = NULL,
author = "",
pdf_param = list(),
...
)
json |
character: Name of the JSON file |
template |
character: RMarkdown file with a program to create a report (default: |
title |
character: report title (default: |
author |
character: report author (default: |
pdf_param |
list: parameters given to |
... |
further named parameter for replacements in the template file |
If your going to create your own templates then the following replacements are done
{{author}}
is replaced by author
{{title}}
is replaced by title
{{json}}
is replaced by json
Any futher named parameter will also replaced, e.g. test="My test"
will lead to a replacement
in the template file {{test}}
by My test
.
name of the generated pdf file
if (interactive()) {
# copy JSON data file to current directory
file.copy(system.file('json', 'Test-Klausur-Statistik.json', package="exams2moodle"), '.')
# create a PDF report 'Test-Klausur-Statistik.pdf' including points and grades
json2report('Test-Klausur-Statistik.json')
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.