Commit cc5a5e29 by cahrens

Fix multiple choice checkbox.

#117
parent ebca3af7
...@@ -316,15 +316,15 @@ describe 'MarkdownEditingDescriptor', -> ...@@ -316,15 +316,15 @@ describe 'MarkdownEditingDescriptor', ->
</multiplechoiceresponse> </multiplechoiceresponse>
<p>Choice checks</p> <p>Choice checks</p>
<multiplechoiceresponse> <choiceresponse>
<choicegroup type="MultipleChoiceChecks"> <checkboxgroup direction="vertical">
<choice correct="false">option1 [x]</choice> <choice correct="false">option1 [x]</choice>
<choice correct="true">correct</choice> <choice correct="true">correct</choice>
<choice correct="true">redundant</choice> <choice correct="true">redundant</choice>
<choice correct="false">distractor</choice> <choice correct="false">distractor</choice>
<choice correct="false">no space</choice> <choice correct="false">no space</choice>
</choicegroup> </checkboxgroup>
</multiplechoiceresponse> </choiceresponse>
<p>Option with multiple correct ones</p> <p>Option with multiple correct ones</p>
......
...@@ -213,8 +213,8 @@ class @MarkdownEditingDescriptor extends XModule.Descriptor ...@@ -213,8 +213,8 @@ class @MarkdownEditingDescriptor extends XModule.Descriptor
// group check answers // group check answers
xml = xml.replace(/(^\s*\[.?\].*?$\n*)+/gm, function(match, p) { xml = xml.replace(/(^\s*\[.?\].*?$\n*)+/gm, function(match, p) {
var groupString = '<multiplechoiceresponse>\n'; var groupString = '<choiceresponse>\n';
groupString += ' <choicegroup type="MultipleChoiceChecks">\n'; groupString += ' <checkboxgroup direction="vertical">\n';
var options = match.split('\n'); var options = match.split('\n');
for(var i = 0; i < options.length; i++) { for(var i = 0; i < options.length; i++) {
if(options[i].length > 0) { if(options[i].length > 0) {
...@@ -223,8 +223,8 @@ class @MarkdownEditingDescriptor extends XModule.Descriptor ...@@ -223,8 +223,8 @@ class @MarkdownEditingDescriptor extends XModule.Descriptor
groupString += ' <choice correct="' + correct + '">' + value + '</choice>\n'; groupString += ' <choice correct="' + correct + '">' + value + '</choice>\n';
} }
} }
groupString += ' </choicegroup>\n'; groupString += ' </checkboxgroup>\n';
groupString += '</multiplechoiceresponse>\n\n'; groupString += '</choiceresponse>\n\n';
return groupString; 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