具有固定和预先指定数量的真假答案的问题 [英] Questions with a fixed and pre-specified number of true and false answers

查看:81
本文介绍了具有固定和预先指定数量的真假答案的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 R/exams 包为 Moodle 测验创建多项选择题.但是,我不确定 R/exams 是否总是可以选择固定数量的正确项目.假设我们有一个关于以下项目的问题:

I would like to use the R/exams package to create multiple-choice questions for a Moodle quiz. However, I am not sure whether R/exams can always choose a fixed number of correct items. Suppose we have a question with the following items:

Answerlist
----------
* A (correct)
* B (correct)
* C (correct)
* D (incorrect)
* E (incorrect)
* F (incorrect)
* G (incorrect)
* H (incorrect)
* I (incorrect)

在这个例子中,我希望 R/exams 选择 2 个正确答案和 6 个错误答案.这可能吗?

In this example, I would like R/exams to choose exactly 2 correct answers and exactly 6 incorrect answers. Is that possible?

推荐答案

是的,这是可能的,但您需要为此编写一些 R 代码.如果您只将 exshuffle 设置为 8,那么 R/exams 将采样 8 个项目,并且仅使用至少有一个真和至少一个假项目的限制.

Yes, it is possible but you need to write a little bit of R code for it. If you only set exshuffle to 8, then R/exams would sample 8 items and use only the restriction that there is at least one true and at least one false item.

如果想进一步限制采样,一般可以通过为它编写相应的R代码来实现.在这种特殊情况下,我会执行以下操作:

If one wants further restrictions in the sampling, then generally these can be implemented by writing the corresponding R code for it. In this particular case I would do the following:

  • 举例 2 个正确的项目.
  • 示例 6 个正确的项目.
  • 将所有内容放入answerlist().
  • exshuffle 设置为 TRUE,这样 8 个选定的项目就会被 R 再排列一次.
  • Sample 2 correct items.
  • Sample 6 correct items.
  • Put everything into an answerlist().
  • Set exshuffle to TRUE so that the 8 selected items are permuted one more time by R.

相应的 Rmd 练习如下所示:

The corresponding Rmd exercise then looks like this:

```{r, include = FALSE}
correct <- c(
  "A (correct)",
  "B (correct)",
  "C (correct)"
)
correct <- sample(correct, 2)

incorrect <- c(
  "D (incorrect)",
  "E (incorrect)",
  "F (incorrect)",
  "G (incorrect)",
  "H (incorrect)",
  "I (incorrect)"
)
incorrect <- sample(incorrect, 6)
```

Question
========

Please select the correct items.

```{r, echo = FALSE, results = "asis"}
answerlist(c(correct, incorrect), markup = "markdown")
```

Meta-information
================
exname: Custom item sampling
extype: mchoice
exsolution: 11000000
exshuffle: TRUE

当这样设置时,也很容易随意扩展初始correctincorrect 项的列表.其余的代码将始终确保您从 正确 项中得到 2 项,从 不正确 项中得到 6 项.

When set up like this, it is also easily possibly to extend the list of initial correct and incorrect items arbitrarily. The rest of the code will always assure that you get 2 out of the correct and 6 out of the incorrect items.

这里没有任何内容特定于 exams2moodle(),也就是说,您可以将此练习与任何 exams2xyz() 接口一起使用(除了 exams2nops()code> 仅支持最多包含 5 个项目的项目列表).

Nothing in this is specific to exams2moodle(), i.e., you can use this exercise with any exams2xyz() interface (except exams2nops() which just supports item lists with up to 5 items).

这篇关于具有固定和预先指定数量的真假答案的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆