inst/doc/create-olat-tests.R

## ----include = FALSE----------------------------------------------------------
suppressPackageStartupMessages(library("exams"))

## ----paste-iso3-code, results = "markdown", echo = FALSE, comment = ""--------
cat(paste(readLines("iso3-code.Rmd"), collapse = "\n"))

## ----include = FALSE----------------------------------------------------------
set.seed(100)

## ----exams-metainfo-iso3-code-------------------------------------------------
# Test solutionstring
exams_metainfo(exams2html("iso3-code.Rmd"))

## ----stress-iso3-code, results = "hide", fig = TRUE, fig.width = 7, fig.height = 5----
# Stresstesting 'iso3-code.Rmd' (100 times)
stress <- stresstest_exercise("iso3-code.Rmd")
plot(stress)

## ----paste-vector-subsetting, results = "markdown", echo = FALSE, comment = ""----
cat(paste(readLines("vector-subsetting.Rmd"), collapse = "\n"))

## ----stress-vector-subsetting, results = "hide"-------------------------------
## Run the stresstest
#stress <- stresstest_exercise("vector-subsetting.Rmd")
## Plot overview
#plot(stress)

## ----stress-vector-subsetting-plot, fig = TRUE, fig.width = 7, fig.height = 3----
## Plot histograms of the two scalars idx/res from the
## 100 randomizations performed by the stresstest function
#par(mfrow = c(1, 2), mar = c(5, 5, 2, 1))
#hist(stress$objects$idx, col = "gray90",
#     breaks = seq(0.5, 5.5, by = 1),
#     main = "Histogram of idx")
#hist(stress$objects$res, col = "gray90",
#     main = "Histogram of res")

## ----img-import, echo = FALSE, out.width = "100%", fig.align = "center"-------
knitr::include_graphics("olat_test_import.jpg")

## ----img-test, echo = FALSE, out.width = "100%", fig.align = "center"---------
knitr::include_graphics("olat_create_test1.jpg")
knitr::include_graphics("olat_create_test2.jpg")
knitr::include_graphics("olat_create_test3.jpg")

Try the c403 package in your browser

Any scripts or data that you put into this service are public.

c403 documentation built on Oct. 20, 2023, 3:01 p.m.