# capitals: Knowledge Quiz Question about Capitals around the World

[This article was first published on

Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

**R/exams**, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Exercise template for a multiple-choice knowledge quiz question with flexible shuffling of the alternatives.

**Name:**

`capitals`

**Type:**

**Related:**

**Description:**

Knowledge quiz question about capitals (vs. large cities) in countries around the world with 5 correct and 6 false alternatives which are shuffled randomly in each version of the exercise. Due to the large number of both correct and false alternatives, the same template could also easily be turned into a single-choice (schoice) exercise. The Rmd exercise is in UTF-8 encoding while the Rnw exercise avoids non-ASCII characters by using LaTeX commands.

**Solution feedback:**

Yes

**Randomization:**

Shuffling (5 out of 11 alternatives)

**Mathematical notation:**

No

**Verbatim R input/output:**

No

**Images:**

No

**Other supplements:**

No

**Demo code:**

```
library("exams")
set.seed(403)
exams2html("capitals.Rnw")
set.seed(403)
exams2pdf("capitals.Rnw")
set.seed(403)
exams2html("capitals.Rmd")
set.seed(403)
exams2pdf("capitals.Rmd")
```

To

**leave a comment**for the author, please follow the link and comment on their blog:**R/exams**.R-bloggers.com offers

**daily e-mail updates**about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.

Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.