[[invalidgrade]] Moodle xml import to Question bank

[[invalidgrade]] Moodle xml import to Question bank

av Robert Snyder -
Antall svar: 1

I am getting this error on several of the tests I have converted with the Nash XML converter (Bb to Moodle). This occurs often. This is the code for one of the tests that returns this error.

<?xml version="1.0" encoding="UTF-8"?>
<!-- ******************** Nash Community College ******************* -->
<!-- ********************* Rocky Mount, NC, USA ******************** -->
<!-- ********************* Moodle XML Builder ******************** -->
<!-- ****************** Developer: Gary Blackburn ****************** -->
<quiz>

    <!-- Quiz Category  -->
    <question type="category">
        <category>
            <text>$course$/01.08 Game Skill 3</text>
        </category>
    </question>

    <!-- Multichoice Question -->
    <question type="multichoice">
        <name>
            <text><![CDATA[q01 Which of the following symbols is not used by QBasic to do arithmetic? (1 po]]></text>
        </name>
        <questiontext format="html">
            <text><![CDATA[<p>Which of the following symbols is not used by QBasic to do arithmetic? (1 points)</p>]]></text>
        </questiontext>
        <defaultgrade>1.0</defaultgrade>
        <penalty>0.33</penalty>
        <hidden>0</hidden>
        <single>true</single>
        <answernumbering>abc</answernumbering>
        <answer fraction="0.0" format="html">
            <text><![CDATA[*]]></text>
        </answer>
        <answer fraction="0.0" format="html">
            <text><![CDATA[+]]></text>
        </answer>
        <answer fraction="100.0" format="html">
            <text><![CDATA[$]]></text>
        </answer>
        <answer fraction="0.0" format="html">
            <text><![CDATA[/]]></text>
        </answer>
        <answer fraction="0.0" format="html">
            <text><![CDATA[-]]></text>
        </answer>
        <answer fraction="0.0" format="html">
            <text><![CDATA[^]]></text>
        </answer>
    </question>

    <!-- Multichoice Question -->
    <question type="multichoice">
        <name>
            <text><![CDATA[q02 Which of the following is a valid QBasic statement to perform arithmetic? (1]]></text>
        </name>
        <questiontext format="html">
            <text><![CDATA[<p>Which of the following is a valid QBasic statement to perform arithmetic? (1 points)</p>]]></text>
        </questiontext>
        <defaultgrade>1.0</defaultgrade>
        <penalty>0.33</penalty>
        <hidden>0</hidden>
        <single>true</single>
        <answernumbering>abc</answernumbering>
        <answer fraction="0.0" format="html">
            <text><![CDATA[PRINT]]></text>
        </answer>
        <answer fraction="100.0" format="html">
            <text><![CDATA[PRINT 14+3*6/2^2-(7*3/2)]]></text>
        </answer>
        <answer fraction="0.0" format="html">
            <text><![CDATA[14+3*6/2^2-(7*3/2)]]></text>
        </answer>
        <answer fraction="0.0" format="html">
            <text><![CDATA[none of the above are valid]]></text>
        </answer>
    </question>


    <!-- TrueFalse Question -->
    <question type="truefalse">
        <name>
            <text><![CDATA[q03 QBasic uses the Order of Operations to calculate the answer to mathematical ]]></text>
        </name>
        <questiontext format="html">
            <text><![CDATA[<p>QBasic uses the Order of Operations to calculate the answer to mathematical expressions. (1 points)</p>]]></text>
        </questiontext>
        <defaultgrade>1.0</defaultgrade>
        <penalty>1.0</penalty>
        <hidden>0</hidden>
        <answer fraction="100.0" format="moodle_auto_format">
            <text>true</text>
        </answer>
        <answer fraction="0.0" format="moodle_auto_format">
            <text>false</text>
        </answer>
    </question>

    <!-- Multichoice Question -->
    <question type="multichoice">
        <name>
            <text><![CDATA[q04 What was the answer to the first expression in the easymath.bas program you ]]></text>
        </name>
        <questiontext format="html">
            <text><![CDATA[<p>What was the answer to the first expression in the easymath.bas program you wrote? (1 points)</p>]]></text>
        </questiontext>
        <defaultgrade>1.0</defaultgrade>
        <penalty>0.33</penalty>
        <hidden>0</hidden>
        <single>true</single>
        <answernumbering>abc</answernumbering>
        <answer fraction="0.0" format="html">
            <text><![CDATA[149]]></text>
        </answer>
        <answer fraction="0.0" format="html">
            <text><![CDATA[277.75]]></text>
        </answer>
        <answer fraction="100.0" format="html">
            <text><![CDATA[6]]></text>
        </answer>
        <answer fraction="0.0" format="html">
            <text><![CDATA[16]]></text>
        </answer>
        <answer fraction="0.0" format="html">
            <text><![CDATA[23]]></text>
        </answer>
    </question>

    <!-- Multichoice Question -->
    <question type="multichoice">
        <name>
            <text><![CDATA[q05 What was the answer to the third expression in the easymath.bas program you ]]></text>
        </name>
        <questiontext format="html">
            <text><![CDATA[<p>What was the answer to the third expression in the easymath.bas program you wrote? (1 points)</p>]]></text>
        </questiontext>
        <defaultgrade>1.0</defaultgrade>
        <penalty>0.33</penalty>
        <hidden>0</hidden>
        <single>true</single>
        <answernumbering>abc</answernumbering>
        <answer fraction="0.0" format="html">
            <text><![CDATA[21.05263]]></text>
        </answer>
        <answer fraction="0.0" format="html">
            <text><![CDATA[43]]></text>
        </answer>
        <answer fraction="0.0" format="html">
            <text><![CDATA[6]]></text>
        </answer>
        <answer fraction="0.0" format="html">
            <text><![CDATA[149]]></text>
        </answer>
        <answer fraction="100.0" format="html">
            <text><![CDATA[100]]></text>
        </answer>
    </question>

    <!-- Multichoice Question -->
    <question type="multichoice">
        <name>
            <text><![CDATA[q06 What was the answer to the fifth expression in the easymath.bas program you ]]></text>
        </name>
        <questiontext format="html">
            <text><![CDATA[<p>What was the answer to the fifth expression in the easymath.bas program you wrote? (1 points)</p>]]></text>
        </questiontext>
        <defaultgrade>1.0</defaultgrade>
        <penalty>0.33</penalty>
        <hidden>0</hidden>
        <single>true</single>
        <answernumbering>abc</answernumbering>
        <answer fraction="0.0" format="html">
            <text><![CDATA[149]]></text>
        </answer>
        <answer fraction="100.0" format="html">
            <text><![CDATA[16]]></text>
        </answer>
        <answer fraction="0.0" format="html">
            <text><![CDATA[100]]></text>
        </answer>
        <answer fraction="0.0" format="html">
            <text><![CDATA[277.75]]></text>
        </answer>
        <answer fraction="0.0" format="html">
            <text><![CDATA[-2]]></text>
        </answer>
    </question>

    <!-- Multichoice Question -->
    <question type="multichoice">
        <name>
            <text><![CDATA[q07 What was the answer to the seventh expression in the easymath.bas program yo]]></text>
        </name>
        <questiontext format="html">
            <text><![CDATA[<p>What was the answer to the seventh expression in the easymath.bas program you wrote? (1 points)</p>]]></text>
        </questiontext>
        <defaultgrade>1.0</defaultgrade>
        <penalty>0.33</penalty>
        <hidden>0</hidden>
        <single>true</single>
        <answernumbering>abc</answernumbering>
        <answer fraction="0.0" format="html">
            <text><![CDATA[3.14]]></text>
        </answer>
        <answer fraction="0.0" format="html">
            <text><![CDATA[6]]></text>
        </answer>
        <answer fraction="100.0" format="html">
            <text><![CDATA[277.75]]></text>
        </answer>
        <answer fraction="0.0" format="html">
            <text><![CDATA[100]]></text>
        </answer>
        <answer fraction="0.0" format="html">
            <text><![CDATA[21.05263]]></text>
        </answer>
    </question>

    <!-- Multichoice Question -->
    <question type="multichoice">
        <name>
            <text><![CDATA[q08 What was the answer to the eighth expression in the easymath.bas program you]]></text>
        </name>
        <questiontext format="html">
            <text><![CDATA[<p>What was the answer to the eighth expression in the easymath.bas program you wrote? (1 points)</p>]]></text>
        </questiontext>
        <defaultgrade>1.0</defaultgrade>
        <penalty>0.33</penalty>
        <hidden>0</hidden>
        <single>true</single>
        <answernumbering>abc</answernumbering>
        <answer fraction="0.0" format="html">
            <text><![CDATA[600]]></text>
        </answer>
        <answer fraction="100.0" format="html">
            <text><![CDATA[149]]></text>
        </answer>
        <answer fraction="0.0" format="html">
            <text><![CDATA[97]]></text>
        </answer>
        <answer fraction="0.0" format="html">
            <text><![CDATA[-12]]></text>
        </answer>
        <answer fraction="0.0" format="html">
            <text><![CDATA[0]]></text>
        </answer>
    </question>

    <!-- Multichoice Question -->
    <question type="multichoice">
        <name>
            <text><![CDATA[q09 What would be printed (if anything) when the following statement is executed]]></text>
        </name>
        <questiontext format="html">
            <text><![CDATA[<p>What would be printed (if anything) when the following statement is executed in a QBasic program?
<br />PRINT 12*3 (1 points)</p>]]></text>
        </questiontext>
        <defaultgrade>1.0</defaultgrade>
        <penalty>0.33</penalty>
        <hidden>0</hidden>
        <single>true</single>
        <answernumbering>abc</answernumbering>
        <answer fraction="0.0" format="html">
            <text><![CDATA[nothing would be printed]]></text>
        </answer>
        <answer fraction="0.0" format="html">
            <text><![CDATA[9]]></text>
        </answer>
        <answer fraction="0.0" format="html">
            <text><![CDATA[4]]></text>
        </answer>
        <answer fraction="0.0" format="html">
            <text><![CDATA[12*3]]></text>
        </answer>
        <answer fraction="100.0" format="html">
            <text><![CDATA[36]]></text>
        </answer>
    </question>

    <!-- Multichoice Question -->
    <question type="multichoice">
        <name>
            <text><![CDATA[q10 Which of the following QBasic statements would print 24 on the screen? (Ther]]></text>
        </name>
        <questiontext format="html">
            <text><![CDATA[<p>Which of the following QBasic statements would print 24 on the screen? (There could be more than one answer.) (1 points)</p>]]></text>
        </questiontext>
        <defaultgrade>1.0</defaultgrade>
        <penalty>0.33</penalty>
        <hidden>0</hidden>
        <single>false</single>
        <answernumbering>abc</answernumbering>
        <answer fraction="33.33" format="html">
            <text><![CDATA[PRINT &quot;24&quot;]]></text>
        </answer>
        <answer fraction="33.33" format="html">
            <text><![CDATA[PRINT 6*4]]></text>
        </answer>
        <answer fraction="0.0" format="html">
            <text><![CDATA[PRINT 12^2]]></text>
        </answer>
        <answer fraction="33.33" format="html">
            <text><![CDATA[PRINT 30-6]]></text>
        </answer>
        <answer fraction="0.0" format="html">
            <text><![CDATA[PRINT 80/4]]></text>
        </answer>
    </question>

</quiz>

We are using Moodle 2.2

Gjennomsnittlig vurdering: -
Som svar til Robert Snyder

Re: [[invalidgrade]] Moodle xml import to Question bank

av Tim Hunt -
Bilde av Core developers Bilde av Documentation writers Bilde av Particularly helpful Moodlers Bilde av Peer reviewers Bilde av Plugin developers

Around the time of Moodle 2.0, the code was made more consistent in the way it handled grades like 0.3333333. The new consistent standard is to use 7 decimal places.

So, it should be fraciton = '33.33333' in the file above, not '33.33'. Similarly, the penalty of 0.33 is 'wrong'.

The import has an option 'error if grade not listed' or soemthing like that. If you turn that off, then the file should import OK.

However, really what needs to happen is that Nash XML converter should be upgraded to get this right.