Commit 26e55f34 by Don Mitchell

Merge branch 'feature/cas/speed-editor' of github.com:MITx/mitx into feature/cas/speed-editor

parents 5e28e598 d53ca05d
...@@ -30,6 +30,17 @@ ...@@ -30,6 +30,17 @@
<article class="simple-editor-cheatsheet"> <article class="simple-editor-cheatsheet">
<div class="cheatsheet-wrapper"> <div class="cheatsheet-wrapper">
<div class="row"> <div class="row">
<h6>Header</h6>
<div class="col sample">
<img src="/static/img/header-example.png" />
</div>
<div class="col">
<pre><code>H1
=====
</pre>
</div>
</div>
<div class="row">
<h6>Multiple Choice</h6> <h6>Multiple Choice</h6>
<div class="col sample"> <div class="col sample">
<img src="/static/img/choice-example.png" /> <img src="/static/img/choice-example.png" />
...@@ -78,6 +89,18 @@ ...@@ -78,6 +89,18 @@
<pre><code>[[wrong, (right)]]</code></pre> <pre><code>[[wrong, (right)]]</code></pre>
</div> </div>
</div> </div>
<div class="row">
<h6>Explanation</h6>
<div class="col sample">
<img src="/static/img/explanation-example.png" />
</div>
<div class="col">
<pre><code>[explanation]
A short explanation of the answer.
[explanation]
</code></pre>
</div>
</div>
</div> </div>
</article> </article>
</script> </script>
...@@ -257,8 +257,6 @@ describe 'MarkdownEditingDescriptor', -> ...@@ -257,8 +257,6 @@ describe 'MarkdownEditingDescriptor', ->
[(] distractor [(] distractor
[] no space [] no space
{{video abcd1s}}
Option with multiple correct ones Option with multiple correct ones
[[one option, (correct one), (should not be correct)]] [[one option, (correct one), (should not be correct)]]
...@@ -312,8 +310,6 @@ describe 'MarkdownEditingDescriptor', -> ...@@ -312,8 +310,6 @@ describe 'MarkdownEditingDescriptor', ->
</choicegroup> </choicegroup>
</multiplechoiceresponse> </multiplechoiceresponse>
<video youtube="1.0:abcd1s" />
<p>Option with multiple correct ones</p> <p>Option with multiple correct ones</p>
<optionresponse> <optionresponse>
......
...@@ -165,7 +165,7 @@ class @MarkdownEditingDescriptor extends XModule.Descriptor ...@@ -165,7 +165,7 @@ class @MarkdownEditingDescriptor extends XModule.Descriptor
else else
return template return template
# We may wish to add insertHeader and insertVideo. Here is Tom's code. # We may wish to add insertHeader. Here is Tom's code.
# function makeHeader() { # function makeHeader() {
# var selection = simpleEditor.getSelection(); # var selection = simpleEditor.getSelection();
# var revisedSelection = selection + '\n'; # var revisedSelection = selection + '\n';
...@@ -175,11 +175,6 @@ class @MarkdownEditingDescriptor extends XModule.Descriptor ...@@ -175,11 +175,6 @@ class @MarkdownEditingDescriptor extends XModule.Descriptor
# simpleEditor.replaceSelection(revisedSelection); # simpleEditor.replaceSelection(revisedSelection);
#} #}
# #
#function makeVideo() {
#var selection = simpleEditor.getSelection();
#simpleEditor.replaceSelection('{{video ' + selection + '}}');
#}
#
@markdownToXml: (markdown)-> @markdownToXml: (markdown)->
toXml = `function(markdown) { toXml = `function(markdown) {
var xml = markdown; var xml = markdown;
...@@ -222,9 +217,6 @@ class @MarkdownEditingDescriptor extends XModule.Descriptor ...@@ -222,9 +217,6 @@ class @MarkdownEditingDescriptor extends XModule.Descriptor
return groupString; return groupString;
}); });
// replace videos
xml = xml.replace(/\{\{video\s(.*?)\}\}/g, '<video youtube="1.0:$1" />\n\n');
// replace string and numerical // replace string and numerical
xml = xml.replace(/^\=\s*(.*?$)/gm, function(match, p) { xml = xml.replace(/^\=\s*(.*?$)/gm, function(match, p) {
var string; var string;
......
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