Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
64507bd5
Commit
64507bd5
authored
Jan 11, 2013
by
Don Mitchell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Drop down for markup done but w/o new icons
parent
26e55f34
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
0 deletions
+15
-0
cms/templates/widgets/problem-edit.html
+4
-0
common/lib/xmodule/xmodule/js/src/problem/edit.coffee
+11
-0
No files found.
cms/templates/widgets/problem-edit.html
View file @
64507bd5
...
...
@@ -14,6 +14,10 @@
class=
"problem-editor-icon number"
></span></a></li>
<li><a
href=
"#"
class=
"dropdown-button"
data-tooltip=
"Option Response"
><span
class=
"problem-editor-icon dropdown"
></span></a></li>
<li><a
href=
"#"
class=
"header-button"
data-tooltip=
"Header"
><span
class=
"problem-editor-icon dropdown"
></span></a></li>
<li><a
href=
"#"
class=
"explanation-button"
data-tooltip=
"Explanation (aka Solution)"
><span
class=
"problem-editor-icon dropdown"
></span></a></li>
</ul>
<ul
class=
"editor-tabs"
>
<li><a
href=
"#"
class=
"xml-tab tab"
data-tab=
"xml"
>
Use Advanced Editor
</a></li>
...
...
common/lib/xmodule/xmodule/js/src/problem/edit.coffee
View file @
64507bd5
class
@
MarkdownEditingDescriptor
extends
XModule
.
Descriptor
# TODO really, these templates should come from or also feed the cheatsheet
@
multipleChoiceTemplate
:
"( ) incorrect
\n
( ) incorrect
\n
(x) correct
\n
"
@
checkboxChoiceTemplate
:
"[x] correct
\n
[ ] incorrect
\n
[x] correct
\n
"
@
stringInputTemplate
:
"= answer
\n
"
@
numberInputTemplate
:
"= answer +- x%
\n
"
@
selectTemplate
:
"[[incorrect, (correct), incorrect]]
\n
"
@
headerTemplate
:
"Header
\n
=====
\n
"
@
explanationTemplate
:
"[explanation]
\n
Short explanation
\n
[explanation]
\n
"
constructor
:
(
element
)
->
@
element
=
element
...
...
@@ -74,6 +77,8 @@ class @MarkdownEditingDescriptor extends XModule.Descriptor
when
"number-button"
then
revisedSelection
=
MarkdownEditingDescriptor
.
insertNumberInput
(
selection
)
when
"checks-button"
then
revisedSelection
=
MarkdownEditingDescriptor
.
insertCheckboxChoice
(
selection
)
when
"dropdown-button"
then
revisedSelection
=
MarkdownEditingDescriptor
.
insertSelect
(
selection
)
when
"header-button"
then
revisedSelection
=
MarkdownEditingDescriptor
.
insertHeader
(
selection
)
when
"explanation-button"
then
revisedSelection
=
MarkdownEditingDescriptor
.
insertExplanation
(
selection
)
else
# ignore click
if
revisedSelection
!=
null
...
...
@@ -158,6 +163,12 @@ class @MarkdownEditingDescriptor extends XModule.Descriptor
@
insertSelect
:
(
selectedText
)
->
return
MarkdownEditingDescriptor
.
insertGenericInput
(
selectedText
,
'[['
,
']]'
,
MarkdownEditingDescriptor
.
selectTemplate
)
@
insertHeader
:
(
selectedText
)
->
return
MarkdownEditingDescriptor
.
insertGenericInput
(
selectedText
,
''
,
'
\n
====
\n
'
,
MarkdownEditingDescriptor
.
headerTemplate
)
@
insertExplanation
:
(
selectedText
)
->
return
MarkdownEditingDescriptor
.
insertGenericInput
(
selectedText
,
'[explanation]
\n
'
,
'
\n
[explanation]'
,
MarkdownEditingDescriptor
.
explanationTemplate
)
@
insertGenericInput
:
(
selectedText
,
lineStart
,
lineEnd
,
template
)
->
if
selectedText
.
length
>
0
# TODO: should this insert a newline afterwards?
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment