R/exams Moodle:完形填空与多项选择题

R/exams Moodle: Cloze with numerical and multiple-choice items

我正在使用 Moodle 进行科目考试。我想将数字完形填空题与单选题或多项选择题混合在一起。并且每道题的最终分数应该有不同的百分比,例如:第一道数字题 5%,第二道数字题 15%,第三道选择题 20% 等等。我制作了一个 cloze_mchoice.Rnw 文件:

<<echo=FALSE, results=hide>>=
@
\usepackage{Sweave}
\usepackage[spanish]{babel}
\usepackage[utf8]{inputenc}
\SweaveOpts{pdf=false}

\begin{question}
%
%
This is the question. This is the question

\begin{answerlist}
  \item Numerical answer 1. %Solution: 10
  \item Numerical answer 2. %Solution: 20
  \item Multiple choice answer 1. %true
  \item Multiple choice answer 2. %true
  \item Multiple choice answer 3. %false
  \item Multiple choice answer 4. %false
  \item Numerical answer 3. %Solution: 30
  \item Numerical answer 4. %Solution: 35
\end{answerlist}
%
\end{question}

\exname{cloze_mchoice}
\extype{cloze}
\exclozetype{num|num|mchoice|num|num}
%percentage of rigth answer:
%         (5%-15%-20%-25%-35%)  
\exsolution{10|20|1100|30|35|}
\extol{0.1*10|0.1*20|0.1*30|0.1*35} %Numerical Answer Tolerance

首先,我使用 HTML 进行编译,但收到此警告:

exams2html("cloze_mchoice.Rnw", encoding = "UTF-8", template = "plain8")
## Warning message:
## In do.call(paste("as", type, sep = "."), list(rval)) :
##   NAs introduced by coercion

我一直在尝试使用

编译成 xml
rmx <- exams2moodle("cloze_mchoice.Rnw", n = 1, name = "p_cloze_mchoice",
  mchoice = list(abstention = "No answer."))

但我收到了上面显示的相同警告消息。 p_cloze_mchoice.xml 文件未被 Moodle 读取。

文件Rnw是一个模板,我将使用csv文件导入输入数据和输出数据。

主要问题:错误与具体问题无关,只是由于expoints设置为非数字。例如,您应该使用 1 而不是 0.1 * 10。当您想动态计算 expoints 时,您需要在 R 代码块中执行此操作,然后将其与 \Sexpr{} 一起插入到 \expoints{}.

其他方面:

  • 最近在 Moodle 中添加了完形填空题中的多项选择题 XML。但是,它们不提供可用于单选项目的所有功能,或者其中一些功能不能可靠地工作,请参阅:

  • R/exams 最近进行了改进以适应 Moodle 的行为。要使用这些功能,请至少安装 2.4-0 版本的软件包。目前,这是 R-Forge 提供的开发版本:install.packages("exams", repos="http://R-Forge.R-project.org")

  • 目前你不能在完形填空题中添加弃权选项,至少据我所知是不可靠的。

  • 完形填空项目的百分比不能像在 Moodle 中那样指定。 Moodle 需要整数 "weights"。因此,exams2moodle() 将分数乘以一个合适的常数(此处为 100)。然而,Moodle 并不总是用这些权重来缩放默认等级。我们怀疑这是 Moodle 中的问题,建议改用整数 expoints

  • extol 的长度必须与 exclozetype 的长度相同(而不只是与 num 项的数量相同)。在这里,您可以为 mchoice 项插入一个 0

  • LaTeX \usepackage{} 被 R/exams 完全忽略了。对于转换为 HTML(对于 Moodle),它们无论如何都不会对 HTML 转换器产生任何影响。为了生成 PDF 输出,这些命令应该在 LaTeX 主模板中而不是单独的练习中。

  • 术语:您在原始问题中使用了 "multichoice" 来指代多项选择题(R/exams 中的 mchoice)。我改变了这个,因为在 Moodle 中 "multichoice" 指的是单选题(带有下拉菜单)。这里的行话在各个系统中并不统一,我尽量避免混淆。

  • 下面列出了我能想出的最好的练习版本。请注意,小数 expoints 在 R/exams 中会导致警告,并且在 Moodle 中无法正常工作(如上所述)。

\begin{question}
This is the question. This is the question

\begin{answerlist}
  \item Numerical answer 1.
  \item Numerical answer 2.
  \item Multiple choice answer 1.
  \item Multiple choice answer 2.
  \item Multiple choice answer 3.
  \item Multiple choice answer 4.
  \item Numerical answer 3.
  \item Numerical answer 4.
\end{answerlist}
\end{question}

\exname{cloze_mchoice}
\extype{cloze}
\exclozetype{num|num|mchoice|num|num}
\exsolution{10|20|1100|30|35|}
\extol{1|2|0|3|3.5}
\expoints{0.05|0.15|0.2|0.25|0.35}

感谢您的有趣话题。是否有混合单选和数字答案的模板文件?此外,是否可以在每个 single/multiple 选择题的开头使用所有 MC 字段通用的文本,例如

 \begin{question}
This is the general question

\begin{answerlist}
  \item question with numerical answer 1.
  \item question for MC :
  \begin{answerlist} 
    \item Multiple choice answer 1.
    \item Multiple choice answer 2.
    \item Multiple choice answer 3.
  \end{answerlist}
  
\end{answerlist}
\end{question}

谢谢,