Moodle XML 编写方法参考(合并步骤)

来自汉语教学技术研究与应用
跳转到导航 跳转到搜索


新建文本文件

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

</quiz>

保存为UTF-8编码,在<quiz></quiz>中添加题目

只需要创建一次

选择题型;添加题目类型;添加题干

简答题

<question type="essay">
	<name>
      <text>题目类型</text>
    </name>
	<questiontext format="moodle_auto_format">
      <text>【题目类型】</text>
    </questiontext>	
</question>

判断题

<question type="truefalse">
	<name>
      <text>题目类型</text>
    </name>
	<questiontext format="moodle_auto_format">
      <text>【题目类型】</text>
    </questiontext>   
</question>

填空题

<question type="shortanswer">
	<name>
      <text>题目类型</text>
    </name>
	<questiontext format="moodle_auto_format">
      <text>【题目类型】</text>
    </questiontext>   
</question>

匹配题

<question type="matching">
	<name>
      <text>题目类型</text>
    </name>
	<questiontext format="moodle_auto_format">
      <text>【题目类型】</text>
    </questiontext>   
</question>

选择题(单选题、多选题)

<question type="multichoice">
	<name>
      <text>题目类型</text>
    </name>
	<questiontext format="moodle_auto_format">
      <text>【题目类型】</text>
    </questiontext>   
</question>

(复杂题型)完形填空(内嵌答案)

<question type="cloze">
	<name>
      <text>题目类型</text>
    </name>
	<questiontext format="moodle_auto_format">
      <text>【题目类型】</text>
    </questiontext>   
</question>

设置分数

    <defaultgrade>1.0000000</defaultgrade>

完形填空(内嵌答案)不需要设置


设置答案

简答题

需要输入文本;文本框行数

	<responserequired>1</responserequired>
	<responsefieldlines>5</responsefieldlines>

判断题

答案为true

    <answer fraction="100" format="moodle_auto_format">
      <text>true</text>
    </answer>
    <answer fraction="0" format="moodle_auto_format">
      <text>false</text>
    </answer>


答案为false

    <answer fraction="0" format="moodle_auto_format">
      <text>true</text>
    </answer>
    <answer fraction="100" format="moodle_auto_format">
      <text>false</text>
    </answer>

填空题

所有选项都是正确答案,得分比例都是100

    <answer fraction="100" format="moodle_auto_format">
      <text>正确答案1</text>
    </answer>
    <answer fraction="100" format="moodle_auto_format">
      <text>正确答案2</text>
    </answer>

匹配题

随机排列选项

	<shuffleanswers>true</shuffleanswers>

匹配选项(至少3项)

    <subquestion format="moodle_auto_format">
      <text>选项1</text>
      <answer>
        <text>对应项/答案1</text>
      </answer>
    </subquestion>
    <subquestion format="moodle_auto_format">
      <text>选项2</text>
      <answer>
        <text>对应项/答案2</text>
      </answer>
    </subquestion>
    <subquestion format="moodle_auto_format">
      <text>选项3</text>
      <answer>
        <text>对应项/答案3</text>
      </answer>
    </subquestion>

选择题(单选)

只有1个正确选项

	<single>true</single>

随机排列选项

	<shuffleanswers>true</shuffleanswers>

选项(只能有一个得分项)

    <answer fraction="100" format="moodle_auto_format">
      <text>正确选项</text>
    </answer>
	<answer fraction="0" format="moodle_auto_format">
      <text>错误选项1</text>
    </answer>

判断题(多选)

有多个得分选项

	<single>false</single>

随机排列选项

	<shuffleanswers>true</shuffleanswers>

选项(得分项合计为100,错误选项每个都是-100,必须使用规定的比例,如0、10、20……100,33.33333、66.66667、0.8333333……)

    <answer fraction="33.33333" format="moodle_auto_format">
      <text>得分选项1</text>
    </answer>
	<answer fraction="33.33333" format="moodle_auto_format">
      <text>得分选项2</text>
    </answer>
	<answer fraction="33.33333" format="moodle_auto_format">
      <text>得分选项3</text>
    </answer>
	<answer fraction="-100" format="moodle_auto_format">
      <text>错误选项</text>
    </answer>

内嵌答案(完形填空)

直接写在<questiontext></questiontext>的<text></text>里面

(可选)设置反馈

完形填空(内嵌答案)不需要设置

通用/整题反馈

    <generalfeedback format="moodle_auto_format">
      <text></text>
    </generalfeedback>

正确反馈

    <correctfeedback format="moodle_auto_format">
      <text></text>
    </correctfeedback>

部分正确反馈

    <partiallycorrectfeedback format="moodle_auto_format">
      <text></text>
    </partiallycorrectfeedback>

错误反馈

    <incorrectfeedback format="moodle_auto_format">
      <text></text>
    </incorrectfeedback>

某一选项的反馈 放在<answer></answer>之间

	<feedback format="moodle_auto_format">
	  <text></text>
	</feedback>