I created quizzes in r/exams that contain "num" and "string" Answer fields which I am using in Moodle. I would like to give negative points (e.g. -0.25% of the possible points for that answer) for incorrect answers. In theory there are functions in r/exams that allow this (exams_eval), but for me they only work in choice questions, not in numeric questions.
I also tried different "rule" settings and variations of the r/exams command but did not got it working. Are negative points not possible for numeric exams?
R/exams Command:
exams2moodle("example.Rmd", cloze = list(eval = list(partial = TRUE, rule = "false", negative = -0.25)))
Rmd Code (actual code is more complicated, this is just an example for numeric answers):
`{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
This is a good question. Indeed exams2moodle()
should be improved to throw a warning in case of such an eval
specification. (Incidentally we just discussed this among the authors earlier this week.)
To the best of my knowledge it is not possible to assign negative points to num
or string
elements within cloze
exercises. If you look at the official documentation at https://docs.moodle.org/310/en/Embedded_Answers_(Cloze)_question_type#Syntax_for_numerical_Cloze_questions you see that it is discussed how to provide a feedback text in case of a wrong answer. But this is always associated with 0%. If you just enter something like -25% in the corresponding embedded answer, this can be imported into Moodle but is actually ignored.
The only parameter that might be useful is the penalty
argument - but I'm not sure how this works in Moodle. It is easy to specify in exams2moodle()
and in the Moodle XML code but I couldn't find examples for the effects this has in a Moodle quiz.