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
cb93060f
Commit
cb93060f
authored
May 15, 2012
by
Prem Sichanugrist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make show answer button toggleable
parent
bdeed6db
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
templates/coffee/src/modules/problem.coffee
+6
-4
No files found.
templates/coffee/src/modules/problem.coffee
View file @
cb93060f
...
...
@@ -42,16 +42,18 @@ class @Problem
Logger
.
log
'problem_show'
,
problem
:
@
id
$
.
postWithPrefix
"/modx/problem/
#{
@
id
}
/problem_show"
,
(
response
)
=>
$
.
each
response
,
(
key
,
value
)
=>
if
$
.
isArray
(
data
[
key
]
)
$
.
each
data
[
key
]
,
(
index
,
answer_index
)
=>
@
$
(
"#label[for='input_
#{
key
}
_
#{
data
[
key
]
[
answer_index
]
}
']"
).
attr
if
$
.
isArray
(
value
)
$
.
each
value
,
(
index
,
answer_index
)
=>
@
$
(
"#label[for='input_
#{
key
}
_
#{
value
[
answer_index
]
}
']"
).
attr
correct_answer
:
'true'
@
$
(
"#answer_
#{
key
}
"
).
text
(
value
)
@
$
(
'.show'
).
val
'Hide Answer'
@
element
.
addClass
'showed'
else
@
$
(
'[id^=answer_]'
).
text
(
''
)
@
$
(
'[correct_answer]'
).
attr
(
correct_answer
:
null
)
@
element
.
removeClass
'showed'
@
$
(
'.show'
).
val
'Show Answer'
save
:
=>
Logger
.
log
'problem_save'
,
@
answers
...
...
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