完形填空问题不显示问题?
cloze question does not display questions?
我在使用 R 中的 exams
包编写完形填空题时遇到了问题。我试图贴近 boxhist.Rmd
示例,但肯定有问题。奇怪的是,在 rstudio 中编织 Rmd 显示所有组件都正常 - 只是 html 输出对于问题是空白的?非常感谢任何想法!这是我的 Rmd 文件,我给 exams:::exams2html
:
```{r data generation, echo = FALSE, results = "hide"}
m = sample(c(-1,0,5),1)
s = sample(c(1,10,20))
x = rnorm(mean = m, sd = s, n = 100)
write.csv(x, file="sumstats.csv",quote = FALSE,row.names = FALSE)
questions <- rep(list(""), 5)
solutions <- rep(list(""), 5)
explanations <- rep(list(""), 5)
type <- rep(list("num"),5)
questions[[1]] <- "What is the Interquartile range of $x$?"
questions[[2]] <- "What is the Variance of $x$?"
questions[[3]] <- "What is the standard deviation of $x$?"
questions[[4]] <- c("The standard deviation is *always* smaller than the variance.","The standard deviation is *NOT always* smaller than the variance.")
questions[[5]] <- "What is the median of $x$?"
solutions[[1]] <- round(IQR(x),3)
solutions[[2]] <- round(var(x),3)
solutions[[3]] <- round(sd(x) ,3)
solutions[[4]] <- mchoice2string(c(FALSE,TRUE))
solutions[[5]] <- round(median(x),3)
type[[4]] <- "schoice"
explanations[[1]] <- "Function `IQR`"
explanations[[2]] <- "Use `var(x)`"
explanations[[3]] <- "`sd(x)`"
explanations[[4]] <- "$\sqrt{x}$ is not always smaller than $x$. Try $x=0.5$!"
explanations[[5]] <- "`median(x)`"
```
```{r questionlist, echo = FALSE, results = "asis"}
answerlist(unlist(questions), markup = "markdown")
```
Solution
========
```{r solutionlist, echo = FALSE, results = "asis"}
answerlist(paste(unlist(explanations), ".", sep = ""), markup = "markdown")
```
Meta-information
================
extype: cloze
exsolution: `r paste(solutions, collapse = "|")`
exclozetype: `r paste(type, collapse = "|")`
exname: sumstats
extol: 0.05
你省略了
Question
========
问题列表前的标记。实际上,鉴于 R/exams 不知道问题出在哪里...
此外,未列出的问题(6)的长度需要与未列出的解决方案(目前只有 5)的长度相匹配。这在某些学习管理系统中可能是必要的,以提供对各个子项目的反馈。
我在使用 R 中的 exams
包编写完形填空题时遇到了问题。我试图贴近 boxhist.Rmd
示例,但肯定有问题。奇怪的是,在 rstudio 中编织 Rmd 显示所有组件都正常 - 只是 html 输出对于问题是空白的?非常感谢任何想法!这是我的 Rmd 文件,我给 exams:::exams2html
:
```{r data generation, echo = FALSE, results = "hide"}
m = sample(c(-1,0,5),1)
s = sample(c(1,10,20))
x = rnorm(mean = m, sd = s, n = 100)
write.csv(x, file="sumstats.csv",quote = FALSE,row.names = FALSE)
questions <- rep(list(""), 5)
solutions <- rep(list(""), 5)
explanations <- rep(list(""), 5)
type <- rep(list("num"),5)
questions[[1]] <- "What is the Interquartile range of $x$?"
questions[[2]] <- "What is the Variance of $x$?"
questions[[3]] <- "What is the standard deviation of $x$?"
questions[[4]] <- c("The standard deviation is *always* smaller than the variance.","The standard deviation is *NOT always* smaller than the variance.")
questions[[5]] <- "What is the median of $x$?"
solutions[[1]] <- round(IQR(x),3)
solutions[[2]] <- round(var(x),3)
solutions[[3]] <- round(sd(x) ,3)
solutions[[4]] <- mchoice2string(c(FALSE,TRUE))
solutions[[5]] <- round(median(x),3)
type[[4]] <- "schoice"
explanations[[1]] <- "Function `IQR`"
explanations[[2]] <- "Use `var(x)`"
explanations[[3]] <- "`sd(x)`"
explanations[[4]] <- "$\sqrt{x}$ is not always smaller than $x$. Try $x=0.5$!"
explanations[[5]] <- "`median(x)`"
```
```{r questionlist, echo = FALSE, results = "asis"}
answerlist(unlist(questions), markup = "markdown")
```
Solution
========
```{r solutionlist, echo = FALSE, results = "asis"}
answerlist(paste(unlist(explanations), ".", sep = ""), markup = "markdown")
```
Meta-information
================
extype: cloze
exsolution: `r paste(solutions, collapse = "|")`
exclozetype: `r paste(type, collapse = "|")`
exname: sumstats
extol: 0.05
你省略了
Question
========
问题列表前的标记。实际上,鉴于 R/exams 不知道问题出在哪里...
此外,未列出的问题(6)的长度需要与未列出的解决方案(目前只有 5)的长度相匹配。这在某些学习管理系统中可能是必要的,以提供对各个子项目的反馈。