【发布时间】:2021-04-22 07:45:34
【问题描述】:
我在 r/exams 中创建了包含我在 Moodle 中使用的“num”和“string”答案字段的测验。 对于不正确的答案,我想给负分(例如,该答案可能得分的 -0.25%)。 理论上,r/exams 中有一些函数允许这样做(exams_eval),但对我来说,它们只适用于选择题,不适用于数字题。
我还尝试了不同的“规则”设置和 r/exams 命令的变体,但没有成功。数字考试不能给负分吗?
R/exams 命令:
exams2moodle("example.Rmd", cloze = list(eval = list(partial = TRUE, rule = "false", negative = -0.25)))
Rmd 代码(实际代码更复杂,这只是数字答案的示例):
`{r data generation, echo = FALSE, results = "hide"}
a <- 1
b <- 2
n = a + b
m = a * b
sol <- c(n, m)
`
Question
========
Calculate the results of the following tasks:
`r a` + `r b` = ##ANSWER1##
`r a` * `r b` = ##ANSWER2##
Solution
========
The solution is:
`r a` + `r b` = `r n`
`r a` * `r b` = `r m`
Meta-information
================
extype: cloze
exsolution: `r paste(sol, collapse = "|")`
exclozetype: num|num
extol: 0.01
【问题讨论】: