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
24f23176
Commit
24f23176
authored
Jan 22, 2013
by
Diana Huang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add the ability to set up custom text for short form and
and long form results.
parent
9a53c375
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
8 deletions
+21
-8
common/lib/xmodule/xmodule/js/src/collapsible.coffee
+19
-5
lms/templates/open_ended_feedback.html
+2
-3
No files found.
common/lib/xmodule/xmodule/js/src/collapsible.coffee
View file @
24f23176
...
...
@@ -9,20 +9,34 @@ class @Collapsible
###
el: container
###
# standard longform + shortfom pattern
el
.
find
(
'.longform'
).
hide
()
el
.
find
(
'.shortform'
).
append
(
'<a href="#" class="full">See full output</a>'
)
# custom longform + shortform text pattern
short_custom
=
el
.
find
(
'.shortform-custom'
)
# set up each one individually
short_custom
.
each
(
index
,
elt
)
=>
open_text
=
$
(
elt
).
data
(
'open-text'
)
close_text
=
$
(
elt
).
data
(
'close-text'
)
$
(
elt
).
append
(
"<a href='#' class='full-custom'>"
+
open_text
+
"</a>"
)
$
(
elt
).
find
(
'.full-custom'
).
click
(
event
)
=>
@
toggleFull
(
event
,
open_text
,
close_text
)
# collapsible pattern
el
.
find
(
'.collapsible header + section'
).
hide
()
el
.
find
(
'.full'
).
click
@
toggleFull
# set up triggers
el
.
find
(
'.full'
).
click
(
event
)
=>
@
toggleFull
(
event
,
"See full output"
,
"Hide output"
)
el
.
find
(
'.collapsible header a'
).
click
@
toggleHint
@
toggleFull
:
(
event
)
=>
@
toggleFull
:
(
event
,
open_text
,
close_text
)
=>
event
.
preventDefault
()
$
(
event
.
target
).
parent
().
siblings
().
slideToggle
()
$
(
event
.
target
).
parent
().
parent
().
toggleClass
(
'open'
)
if
$
(
event
.
target
).
text
()
==
'See full output'
new_text
=
'Hide output'
if
$
(
event
.
target
).
text
()
==
open_text
new_text
=
close_text
else
new_text
=
'See full output'
new_text
=
open_text
$
(
event
.
target
).
text
(
new_text
)
@
toggleHint
:
(
event
)
=>
...
...
lms/templates/open_ended_feedback.html
View file @
24f23176
<section>
<header>
Feedback
</header>
<div
class=
"shortform
"
>
<div
class=
"shortform
-custom"
data-open-text=
'Show detailed results'
data-close-text=
'Hide detailed results'
>
<div
class=
"result-output"
>
<p>
Score: ${score}
</p>
% if grader_type == "ML":
...
...
@@ -14,4 +14,4 @@
</div>
${rubric_feedback | n}
</div>
</section>
\ No newline at end of file
</section>
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