Okay, I did my best to make a minimal example. Let's say this is "q2.Rmd":
好吧,我已经尽我所能来杀鸡儆猴了。假设这是“q2.Rmd”:
```{r data generation, echo = FALSE, results = "hide"}
mu = runif(1,200,800)
sig = runif(1,10,70)
n = sample(8:12,1)
x = round(rnorm(n,mu,sig),1)
correct_val_1 = round(mean(x),1)
correct_val_2 = round(sd(x),1)
num_under_1 = sample(0:3,1)
num_under_2 = sample(0:3,1)
mults_1 = c(0,sample(-1:-5,num_under_1),sample(1:5,3-num_under_1))
mults_2 = c(0,sample(-1:-5,num_under_2),sample(1:5,3-num_under_2))
choices_1 = sort(correct_val_1+0.2*mults_1)
choices_2 = sort(correct_val_2+0.2*mults_2)
ans1 = paste0((choices_1==correct_val_1)*1,collapse="")
ans2 = paste0((choices_2==correct_val_2)*1,collapse="")
```
Question
========
<style type="text/css" rel="stylesheet">
.bordered-table {
border-collapse: collapse;
border-spacing: 0;
border:2px solid #000000;
}
.bordered-table th {
border:2px solid #000000;
padding: 4px;
}
.bordered-table td{
border:2px solid #000000;
padding: 4px;
}
</style>
A biologist investigated a population of turtles. They weighed turtles from a simple-random sample; those weights are shown below in grams.
```{r tab_data, echo=FALSE, results="asis"}
opts <- options(knitr.kable.NA = "")
mydf = data.frame(x)
colnames(mydf) = c("Turtle weights (g)")
knitr::kable(mydf,format="html", align = "c",row.names=F,table.attr='class="bordered-table"')
```
\
Find the sample mean, $\bar{x}$, and the sample standard deviation, $s$ (using Bessel's correction).
$\bar{x} =$ ##ANSWER1##
$s =$ ##ANSWER2##
Answerlist
--------
* `r choices_1[1]`
* `r choices_1[2]`
* `r choices_1[3]`
* `r choices_1[4]`
* `r choices_2[1]`
* `r choices_2[2]`
* `r choices_2[3]`
* `r choices_2[4]`
Solution
========
The correct answers were $\bar{x} = `r correct_val_1`$ and $s = `r correct_val_2`$
`r sd(x)`
Meta-information
================
extype: cloze
exclozetype: schoice|schoice
exsolution: `r ans1`|`r ans2`
exname: find sample mean and sample standard deviation
exshuffle: FALSE
If I run exams2canvas("q2.Rmd")
, it produces a ZIP file, which I upload by clicking Import Existing Content
with the default settings (old style quiz). When I preview the quiz I get the following dropdowns on the schoices.
如果我运行Exams2canvas(“q2.Rmd”),它会生成一个ZIP文件,我通过单击导入具有默认设置的现有内容(旧式测验)来上传该文件。当我预览测验时,我得到了以下关于学校的下拉列表。
If I then edit the settings, to turn off answer shuffling, I can at least get the choices in order (a.1., a.2., a.3., a.4.) and students are able to ignore them. But is there a good reason for these to be here? Notice, having them makes answer-choice shuffling pointless.
如果我随后编辑设置,以关闭答案洗牌,我至少可以按顺序(A.1、A.2、A.3、A.4.)进行选择。学生们可以忽略它们。但是,这些东西有什么好的理由放在这里吗?请注意,有了它们,答案选择的洗牌就变得毫无意义了。
I have not tried to alter the source code yet. I don't think exams2canvas has a setting I'm messing up.
我还没有尝试修改源代码。我不认为Exams2canvas有我搞砸的设置。
更多回答
I think setting exams2canvas(..., cloze = list(enumerate = FALSE))
should do the trick. Please check and I'll post a proper answer when I have the time.
我认为设置Exams2canvas(...,CLOZE=LIST(ENUMERATE=FALSE))应该可以做到这一点。请查收,我会在有空的时候给你一个合适的答复。
That worked perfectly. Thanks Achim!
这样做效果很好。谢谢阿希姆!
Thanks for checking! I have decided now to change the default behavior in the development version of R/exams on R-Forge. Also, I posted a proper answer with more details below. Please accept it so that the question is flagged as resolved here on StackOverflow.
感谢您的查看!我现在已经决定在R-Forge上更改R/Exams开发版本中的默认行为。此外,我还发布了一个适当的答案,并在下面提供了更多细节。请接受它,以便在StackOverflow上将问题标记为此处已解决。
TL;DR This behavior can be controlled with the enumerate
argument for the different exercise types. In order to suppress enumeration for cloze exercises you can do
这种行为可以通过针对不同练习类型的ENUMERATE参数来控制。为了取消对完形填空练习的枚举,您可以执行以下操作
exams2canvas(..., cloze = list(enumerate = FALSE))
Starting from version 2.4-1 (the current development version on R-Forge at the time of writing), this will be the default.
从2.4-1版(撰写本文时R-Forge上的当前开发版本)开始,这将是默认的。
Background: Up to version 2.4-0 (the current CRAN version at the time of writing), the default was for exams
to add items within exercises (especially single-choice and multiple-choice items) into enumerated lists, i.e., with a., b., c., etc. For schoice/mchoice within cloze letters and numbers were also combined, i.e., a.1, a.2, a.3, etc. The original idea for this was to make it easier to match the full solution feedback (if any) to the items from the question. However, given that this adds clutter to the question, which is particularly confusing when the learning management system adds its own shuffling, I have decided to change the default behavior. If you install R/exams 2.4-1 (from R-Forge) then you don't need to change the argument yourself.
背景:直到2.4-0版(撰写本文时的当前CRAN版本),考试的默认做法是将练习中的项目(特别是单项选择和多项选择项目)添加到列举列表中,即使用a、b、c等。对于学校,完形填空中的字母和数字也结合在一起,即A.1、A.2、A.3等。这样做的最初想法是更容易将完整的解答反馈(如果有的话)与问题中的项目相匹配。然而,考虑到这增加了问题的杂乱性,当学习管理系统添加它自己的洗牌时,这特别令人困惑,我决定改变默认行为。如果您安装了R/Exames2.4-1(来自R-Forge),那么您不需要自己更改参数。
更多回答
我是一名优秀的程序员,十分优秀!