```{r, echo=FALSE}
include_supplement("median.num", recursive=TRUE)
# required variables:
#  sc <- num_result(...)
library("exams.forge")
instruction <- NULL
library("knitr")
n <- sample(5:10, 1)
x <- c()
repeat{
  repeat{
    x   <- round(rnorm(n, mean=1.8, sd=0.15), 2)
    iqr <- IQR(x)
    q   <- quantile(x, c(0.25, 0.75))
    sx  <- ifelse(x<q[1], (q[1]-x)/iqr, ifelse(x>q[2], (x-q[2])/iqr, 0))
    h   <- as.numeric(cut(sx, c(-1, 1, 3.5, 100)))
    if (all(!is.na(h))) break
  }
  si  <- if(n%%2==1) (n+1)/2 else n/2+c(0,1)
  sx  <- sort(x)[si]
  if ((length(sx)==2) || (sx!=x[si]))  {
    if ((sum(h==2)==0) && (sum(h==3)==1)) break
  }
}
xi <- affix(1:n, "x_{", "}=")
sc <- num_result (c(median(x), x), digits = 2, tolmult = 2)
```


Question
========

```{r, error=TRUE, child=instruction}
```

Es wurden folgende Körpergrößen bei  `r n` Männern erhoben:

`r as_string(sprintf("$x_{%.0f}=%.*f$", 1:n, sc$digits, x), last = ' und ')`.

Berechnen Sie ein geeignetes Mittel der Daten. `r round_de(sc$digits)`.


```{r, child="median.num"}
```

Meta-information
================
extype: num
exsolution: `r sc$fx[1]`
extol: `r sc$tolerance`
exname: `r knitr::current_input()`
