diff --git a/cms/templates/widgets/problem-edit.html b/cms/templates/widgets/problem-edit.html index d37d605971..f6baae4d2d 100644 --- a/cms/templates/widgets/problem-edit.html +++ b/cms/templates/widgets/problem-edit.html @@ -1,9 +1,6 @@ <%include file="metadata-edit.html" />
- <% - markdown = 'foo' - %> %if markdown != '' or data == '':
    @@ -24,7 +21,7 @@
  • ?
- + %endif
diff --git a/common/lib/xmodule/xmodule/capa_module.py b/common/lib/xmodule/xmodule/capa_module.py index ff717acdf6..8f01bbccec 100644 --- a/common/lib/xmodule/xmodule/capa_module.py +++ b/common/lib/xmodule/xmodule/capa_module.py @@ -651,8 +651,9 @@ class CapaDescriptor(RawDescriptor): has_score = True template_dir_name = 'problem' mako_template = "widgets/problem-edit.html" - js = {'coffee': [resource_string(__name__, 'js/src/problem/markdown.coffee')]} + js = {'coffee': [resource_string(__name__, 'js/src/problem/edit.coffee')]} js_module_name = "MarkdownEditingDescriptor" + css = {'scss': [resource_string(__name__, 'css/problem/edit.scss')]} # Capa modules have some additional metadata: # TODO (vshnayder): do problems have any other metadata? Do they diff --git a/common/lib/xmodule/xmodule/js/src/problem/edit.coffee b/common/lib/xmodule/xmodule/js/src/problem/edit.coffee index d938cb0bd3..ce2871fae0 100644 --- a/common/lib/xmodule/xmodule/js/src/problem/edit.coffee +++ b/common/lib/xmodule/xmodule/js/src/problem/edit.coffee @@ -6,11 +6,12 @@ class @MarkdownEditingDescriptor extends XModule.Descriptor lineWrapping: true }) - @markdown_editor = CodeMirror.fromTextArea($(".edit-box", @element)[0], { - lineWrapping: true - mode: null - onChange: @onMarkdownEditorUpdate - }) + if $(".markdown-box", @element).length != 0 + @markdown_editor = CodeMirror.fromTextArea($(".markdown-box", @element)[0], { + lineWrapping: true + mode: null + onChange: @onMarkdownEditorUpdate + }) onMarkdownEditorUpdate: -> console.log('update')