The unilur::examen_pdf and unilur::examen_pdf_solution formats (relying on the latex exam class) extend the possibilities of the tutorial format:

  • include an identification box to be filled in by the candidate
  • insert placeholders with dotted lines between questions to write in the answers
  • generate multiple choice questions

Yaml header arguments

argument value description
id yes/no draws a candidate identification form
mcq oneparchoices, oneparchoicesalt, oneparcheckboxesalt, oneparcheckboxes theme for the multiple choice questions

Questions

Use the fifth level of heading to create your questions (##### question). It is possible to leave some space with lines in the main pdf file that allow students to write down their answers. Just set the answer.lines = <s> chunk option (in inches) together with solution = TRUE.

---
title: "Examen demo"
author: "John Doe"
date: "19 April, 2016"
output:
  unilur::examen_pdf:
    id: yes
  unilur::examen_pdf_solution:
    id: yes
---

##### Write your answer below

```{block, solution = TRUE, answer.lines = 1}
This is the hidden answer generating lines in the main pdf file.
```

##### Second question

```{block, solution = TRUE, answer.lines = 0.5}
This would be the expected answer to the question
```

Multiple choice questions

Lists can be rendered as multiple choice questions. Write the list within a block chunk and set the option mcq = TRUE like in the example below:

```{block, mcq = TRUE}
- Item 1
- Item 2
- Item 3
- Item 4
- Item 5
```

The output theme of MCQ can be adjusted in the YAML front-matter as shown below:

output:
  unilur::examen_pdf:
    mcq: <mcq theme>

The snapshots below show how the different <mcq theme> values look like:

mcq theme result
oneparchoices
oneparchoicesalt
oneparcheckboxes
oneparcheckboxesalt

For the oneparchoicesalt and oneparcheckboxesalt options, it is possible to specify the number of items per line with the mcq.n chunk option (default is 3).

Generate a Rmarkdown file without solution chunks

Use the unilur::answer_rmd output format to generate a Rmarkdown document containing all the instructions but without the solution chunks which are replaced by empty ones. The Yaml header is also changed and you can adjust the title, author or output:

output:
  unilur::answer_rmd:
    yaml:
      title: "My answers"
      author: "My name"
      output: html_document