Merge pull request #1264 from MITx/feature/cas/speed-editor

Cheat sheet for heading and explanation.
This commit is contained in:
Christina Roberts
2013-01-11 06:53:26 -08:00
5 changed files with 24 additions and 13 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

View File

@@ -29,6 +29,17 @@
<script type="text/template" id="simple-editor-cheatsheet">
<article class="simple-editor-cheatsheet">
<div class="cheatsheet-wrapper">
<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>
<div class="col sample">
@@ -78,6 +89,18 @@
<pre><code>[[wrong, (right)]]</code></pre>
</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>
</article>
</script>

View File

@@ -257,8 +257,6 @@ describe 'MarkdownEditingDescriptor', ->
[(] distractor
[] no space
{{video abcd1s}}
Option with multiple correct ones
[[one option, (correct one), (should not be correct)]]
@@ -312,8 +310,6 @@ describe 'MarkdownEditingDescriptor', ->
</choicegroup>
</multiplechoiceresponse>
<video youtube="1.0:abcd1s" />
<p>Option with multiple correct ones</p>
<optionresponse>

View File

@@ -165,7 +165,7 @@ class @MarkdownEditingDescriptor extends XModule.Descriptor
else
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() {
# var selection = simpleEditor.getSelection();
# var revisedSelection = selection + '\n';
@@ -174,11 +174,6 @@ class @MarkdownEditingDescriptor extends XModule.Descriptor
# }
# simpleEditor.replaceSelection(revisedSelection);
#}
#
#function makeVideo() {
#var selection = simpleEditor.getSelection();
#simpleEditor.replaceSelection('{{video ' + selection + '}}');
#}
#
@markdownToXml: (markdown)->
toXml = `function(markdown) {
@@ -222,9 +217,6 @@ class @MarkdownEditingDescriptor extends XModule.Descriptor
return groupString;
});
// replace videos
xml = xml.replace(/\{\{video\s(.*?)\}\}/g, '<video youtube="1.0:$1" />\n\n');
// replace string and numerical
xml = xml.replace(/^\=\s*(.*?$)/gm, function(match, p) {
var string;