2

I was checking some examples of single choice and multiple choice for example swisscapital.Rmd and switzerland.Rmd. When running exams2moodle() and checking some parameters I found that incorrect answers are penalized with negative points (<answer fraction="-25" format="html"> in swisscapital.Rmd for example). Is there a way to change this to 0 points for incorrect answers?

outoput of

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

is the swiss_test.xml file with this content

<?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>
Nicolas Molano
  • 693
  • 4
  • 15

1 Answers1

3

You can check the help of exams2moodle:

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

In the exams_eval:

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

So you should do:

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

See also Grading multiple choice and cloze questions created with exams2moodle() for more details.

Achim Zeileis
  • 15,710
  • 1
  • 39
  • 49
uzsolt
  • 5,832
  • 2
  • 20
  • 32
  • I got ```Error in rmarkdown::pandoc_convert(input = infile, output = outfile, from = from, : unused argument (eval = list("none"))``` i think the correct sintax is ```exams2moodle(...,rule="none")``` since in fact ```eval``` is not a parameter of ```exams2moodle``` – Nicolas Molano Aug 05 '20 at 20:07
  • I have read the help, however it is not clear for me how to use ```exams_eval``` in ```exams2moodle``` – Nicolas Molano Aug 05 '20 at 20:42
  • The `eval` argument needs to be passed to `schoice` only, it's not a direct argument for `exams2moodle()`. I've also added a link to a more detailed discussion of grading in `exams2moodle()` which covers this among other stuff. – Achim Zeileis Aug 06 '20 at 01:06
  • Sorry, I didn't test it, I hurried it. – uzsolt Aug 06 '20 at 04:40