Commit cc5a5e29 by cahrens

Fix multiple choice checkbox.

#117
parent ebca3af7
......@@ -316,15 +316,15 @@ describe 'MarkdownEditingDescriptor', ->
</multiplechoiceresponse>
<p>Choice checks</p>
<multiplechoiceresponse>
<choicegroup type="MultipleChoiceChecks">
<choiceresponse>
<checkboxgroup direction="vertical">
<choice correct="false">option1 [x]</choice>
<choice correct="true">correct</choice>
<choice correct="true">redundant</choice>
<choice correct="false">distractor</choice>
<choice correct="false">no space</choice>
</choicegroup>
</multiplechoiceresponse>
</checkboxgroup>
</choiceresponse>
<p>Option with multiple correct ones</p>
......
......@@ -213,8 +213,8 @@ class @MarkdownEditingDescriptor extends XModule.Descriptor
// group check answers
xml = xml.replace(/(^\s*\[.?\].*?$\n*)+/gm, function(match, p) {
var groupString = '<multiplechoiceresponse>\n';
groupString += ' <choicegroup type="MultipleChoiceChecks">\n';
var groupString = '<choiceresponse>\n';
groupString += ' <checkboxgroup direction="vertical">\n';
var options = match.split('\n');
for(var i = 0; i < options.length; i++) {
if(options[i].length > 0) {
......@@ -223,8 +223,8 @@ class @MarkdownEditingDescriptor extends XModule.Descriptor
groupString += ' <choice correct="' + correct + '">' + value + '</choice>\n';
}
}
groupString += ' </choicegroup>\n';
groupString += '</multiplechoiceresponse>\n\n';
groupString += ' </checkboxgroup>\n';
groupString += '</choiceresponse>\n\n';
return groupString;
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment