r 考试控制错误答案的分数

r exams controlling the points for incorrect answers

我正在检查一些单选和多选的例子,例如 swisscapital.Rmd 和 switzerland.Rmd。当 运行 exams2moodle() 并检查一些参数时,我发现不正确的答案会受到负分的惩罚(例如 swisscapital.Rmd 中的 <answer fraction="-25" format="html">)。有没有办法将此更改为错误答案的 0 分?

的输出
exams2moodle("swisscapital.Rmd", n = 1, name = "swiss_test",
             encoding = "UTF-8",
             dir = "output",
             edir = "exercises")

是具有此内容的 swiss_test.xml 文件

<?xml version="1.0" encoding="UTF-8"?>
<quiz>


<question type="category">
<category>
<text>$course$/swiss_test/Exercise 1</text>
</category>
</question>


<question type="multichoice">
<name>
<text> Q1 : swisscapital </text>
</name>
<questiontext format="html">
<text><![CDATA[<p>
<p>What is the seat of the federal authorities in Switzerland (i.e., the de facto capital)?</p>
</p>]]></text>
</questiontext>
<generalfeedback format="html">
<text><![CDATA[<p>
<p>There is no de jure capital but the de facto capital and seat of the federal authorities is Bern.</p>
<ol type = "a">
<li> False </li>
<li> False </li>
<li> False </li>
<li> True </li>
<li> False </li>
</ol>
</p>]]></text>
</generalfeedback>
<penalty>0</penalty>
<defaultgrade>1</defaultgrade>
<shuffleanswers>false</shuffleanswers>
<single>true</single>
<answernumbering>abc</answernumbering>
<answer fraction="-25" format="html">
<text><![CDATA[<p>
Lausanne
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False
</p>]]></text>
</feedback>
</answer>
<answer fraction="-25" format="html">
<text><![CDATA[<p>
Basel
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False
</p>]]></text>
</feedback>
</answer>
<answer fraction="-25" format="html">
<text><![CDATA[<p>
St. Gallen
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False
</p>]]></text>
</feedback>
</answer>
<answer fraction="100" format="html">
<text><![CDATA[<p>
Bern
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
True
</p>]]></text>
</feedback>
</answer>
<answer fraction="-25" format="html">
<text><![CDATA[<p>
Geneva
</p>]]></text>
<feedback format="html">
<text><![CDATA[<p>
False
</p>]]></text>
</feedback>
</answer>
</question>

</quiz>

您可以查看 help of exams2moodle:

rule: character specifying which rule to use for negative partial credits. see function exams_eval

exams_eval中:

and "none" uses 0 (so that wrong selections have no effect at all)

所以你应该这样做:

exams2moodle(..., schoice = list(eval = exams_eval(rule = "none")))

有关详细信息,另请参阅