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
28a502ea
Commit
28a502ea
authored
Mar 01, 2013
by
Will Daly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed a bug in CorrectMaps.get_npoints(), which would return 1
when npoints=0.
parent
d6df7e2d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletions
+7
-1
common/lib/capa/capa/correctmap.py
+1
-1
common/lib/capa/capa/tests/test_correctmap.py
+6
-0
No files found.
common/lib/capa/capa/correctmap.py
View file @
28a502ea
...
...
@@ -117,7 +117,7 @@ class CorrectMap(object):
Otherwise, return 0 points """
if
self
.
is_correct
(
answer_id
):
npoints
=
self
.
get_property
(
answer_id
,
'npoints'
)
return
npoints
if
npoints
else
1
return
npoints
if
npoints
is
not
None
else
1
else
:
return
0
...
...
common/lib/capa/capa/tests/test_correctmap.py
View file @
28a502ea
...
...
@@ -69,6 +69,7 @@ class CorrectMapTest(unittest.TestCase):
# 2) correct, None points
# 3) incorrect, 5 points
# 4) incorrect, None points
# 5) correct, 0 points
self
.
cmap
.
set
(
answer_id
=
'1_2_1'
,
correctness
=
'correct'
,
npoints
=
5
)
...
...
@@ -85,6 +86,10 @@ class CorrectMapTest(unittest.TestCase):
correctness
=
'incorrect'
,
npoints
=
None
)
self
.
cmap
.
set
(
answer_id
=
'5_2_1'
,
correctness
=
'correct'
,
npoints
=
0
)
# Assert that we get the expected points
# If points assigned and correct --> npoints
# If no points assigned and correct --> 1 point
...
...
@@ -93,6 +98,7 @@ class CorrectMapTest(unittest.TestCase):
self
.
assertEqual
(
self
.
cmap
.
get_npoints
(
'2_2_1'
),
1
)
self
.
assertEqual
(
self
.
cmap
.
get_npoints
(
'3_2_1'
),
0
)
self
.
assertEqual
(
self
.
cmap
.
get_npoints
(
'4_2_1'
),
0
)
self
.
assertEqual
(
self
.
cmap
.
get_npoints
(
'5_2_1'
),
0
)
def
test_set_overall_message
(
self
):
...
...
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