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
1a0055ae
Commit
1a0055ae
authored
Jul 24, 2013
by
Renzo Lucioni
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Blank common and advanced problems now display an inline score of '0 points' upon creation.
parent
a569a5f6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
common/lib/xmodule/xmodule/progress.py
+2
-2
common/lib/xmodule/xmodule/tests/test_progress.py
+3
-3
No files found.
common/lib/xmodule/xmodule/progress.py
View file @
1a0055ae
...
...
@@ -146,7 +146,7 @@ class Progress(object):
sending Progress objects to js to limit dependencies.
'''
if
progress
is
None
:
return
"
NA
"
return
"
0
"
return
progress
.
ternary_str
()
@staticmethod
...
...
@@ -157,5 +157,5 @@ class Progress(object):
passing Progress objects to js to limit dependencies.
'''
if
progress
is
None
:
return
"
NA
"
return
"
0
"
return
str
(
progress
)
common/lib/xmodule/xmodule/tests/test_progress.py
View file @
1a0055ae
...
...
@@ -90,15 +90,15 @@ class ProgressTest(unittest.TestCase):
self
.
assertEqual
(
Progress
.
to_js_status_str
(
self
.
not_started
),
"none"
)
self
.
assertEqual
(
Progress
.
to_js_status_str
(
self
.
half_done
),
"in_progress"
)
self
.
assertEqual
(
Progress
.
to_js_status_str
(
self
.
done
),
"done"
)
self
.
assertEqual
(
Progress
.
to_js_status_str
(
None
),
"
NA
"
)
self
.
assertEqual
(
Progress
.
to_js_status_str
(
None
),
"
0
"
)
def
test_to_js_detail_str
(
self
):
'''Test the Progress.to_js_detail_str() method'''
f
=
Progress
.
to_js_detail_str
for
p
in
(
self
.
not_started
,
self
.
half_done
,
self
.
done
):
self
.
assertEqual
(
f
(
p
),
str
(
p
))
# But None should be encoded as
NA
self
.
assertEqual
(
f
(
None
),
"
NA
"
)
# But None should be encoded as
0
self
.
assertEqual
(
f
(
None
),
"
0
"
)
def
test_add
(
self
):
'''Test the Progress.add_counts() method'''
...
...
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