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
31cd7afc
Commit
31cd7afc
authored
Mar 15, 2016
by
M. Rehan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #11811 from edx/mrehan/tnl-4219-progress-detail-not-shown
render progress status while problem content rendering
parents
415c0ea6
167efea6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
1 deletions
+18
-1
common/lib/xmodule/xmodule/js/spec/capa/display_spec.coffee
+17
-1
common/lib/xmodule/xmodule/js/src/capa/display.coffee
+1
-0
No files found.
common/lib/xmodule/xmodule/js/spec/capa/display_spec.coffee
View file @
31cd7afc
describe
'Problem'
,
->
describe
'Problem'
,
->
problem_content_default
=
readFixtures
(
'problem_content.html'
)
beforeEach
->
beforeEach
->
# Stub MathJax
# Stub MathJax
window
.
MathJax
=
window
.
MathJax
=
...
@@ -20,7 +22,7 @@ describe 'Problem', ->
...
@@ -20,7 +22,7 @@ describe 'Problem', ->
spyOn
Logger
,
'log'
spyOn
Logger
,
'log'
spyOn
(
$
.
fn
,
'load'
).
andCallFake
(
url
,
callback
)
->
spyOn
(
$
.
fn
,
'load'
).
andCallFake
(
url
,
callback
)
->
$
(
@
).
html
readFixtures
(
'problem_content.html'
)
$
(
@
).
html
problem_content_default
callback
()
callback
()
describe
'constructor'
,
->
describe
'constructor'
,
->
...
@@ -96,6 +98,13 @@ describe 'Problem', ->
...
@@ -96,6 +98,13 @@ describe 'Problem', ->
@
problem
.
renderProgressState
()
@
problem
.
renderProgressState
()
expect
(
@
problem
.
$
(
'.problem-progress'
).
html
()).
toEqual
"(1 point possible)"
expect
(
@
problem
.
$
(
'.problem-progress'
).
html
()).
toEqual
"(1 point possible)"
it
'displays the number of points possible when rendering happens with the content'
,
->
@
problem
.
el
.
data
(
'progress_status'
,
'none'
)
@
problem
.
el
.
data
(
'progress_detail'
,
'0/2'
)
expect
(
@
problem
.
$
(
'.problem-progress'
).
html
()).
toEqual
""
@
problem
.
render
(
problem_content_default
)
expect
(
@
problem
.
$
(
'.problem-progress'
).
html
()).
toEqual
"(2 points possible)"
describe
'with any other valid status'
,
->
describe
'with any other valid status'
,
->
it
'reports the current score'
,
->
it
'reports the current score'
,
->
@
problem
.
el
.
data
(
'progress_status'
,
'foo'
)
@
problem
.
el
.
data
(
'progress_status'
,
'foo'
)
...
@@ -103,6 +112,13 @@ describe 'Problem', ->
...
@@ -103,6 +112,13 @@ describe 'Problem', ->
@
problem
.
renderProgressState
()
@
problem
.
renderProgressState
()
expect
(
@
problem
.
$
(
'.problem-progress'
).
html
()).
toEqual
"(1/1 point)"
expect
(
@
problem
.
$
(
'.problem-progress'
).
html
()).
toEqual
"(1/1 point)"
it
'shows current score when rendering happens with the content'
,
->
@
problem
.
el
.
data
(
'progress_status'
,
'test status'
)
@
problem
.
el
.
data
(
'progress_detail'
,
'2/2'
)
expect
(
@
problem
.
$
(
'.problem-progress'
).
html
()).
toEqual
""
@
problem
.
render
(
problem_content_default
)
expect
(
@
problem
.
$
(
'.problem-progress'
).
html
()).
toEqual
"(2/2 points)"
describe
'render'
,
->
describe
'render'
,
->
beforeEach
->
beforeEach
->
@
problem
=
new
Problem
(
$
(
'.xblock-student_view'
))
@
problem
=
new
Problem
(
$
(
'.xblock-student_view'
))
...
...
common/lib/xmodule/xmodule/js/src/capa/display.coffee
View file @
31cd7afc
...
@@ -159,6 +159,7 @@ class @Problem
...
@@ -159,6 +159,7 @@ class @Problem
@
setupInputTypes
()
@
setupInputTypes
()
@
bind
()
@
bind
()
@
queueing
()
@
queueing
()
@
renderProgressState
()
@
el
.
attr
(
'aria-busy'
,
'false'
)
@
el
.
attr
(
'aria-busy'
,
'false'
)
else
else
$
.
postWithPrefix
"
#{
@
url
}
/problem_get"
,
(
response
)
=>
$
.
postWithPrefix
"
#{
@
url
}
/problem_get"
,
(
response
)
=>
...
...
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