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
6e92666a
Commit
6e92666a
authored
Mar 11, 2013
by
Julian Arni
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed score order.
Less is more.
parent
588b27c9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
lms/djangoapps/foldit/tests.py
+10
-5
No files found.
lms/djangoapps/foldit/tests.py
View file @
6e92666a
...
...
@@ -143,11 +143,12 @@ class FolditTestCase(TestCase):
def
test_SetPlayerPuzzleScores_manyplayers
(
self
):
"""
Check that when we send scores from multiple users, the correct order
of scores is displayed.
of scores is displayed. Note that, before being processed by
display_score, lower scores are better.
"""
puzzle_id
=
[
'1'
]
player1_score
=
0.0
7
player2_score
=
0.0
8
player1_score
=
0.0
8
player2_score
=
0.0
2
response1
=
self
.
make_puzzle_score_request
(
puzzle_id
,
player1_score
,
self
.
user
)
...
...
@@ -164,8 +165,12 @@ class FolditTestCase(TestCase):
self
.
assertEqual
(
len
(
top_10
),
2
)
# Top score should be player2_score. Second should be player1_score
self
.
assertEqual
(
top_10
[
0
][
'score'
],
Score
.
display_score
(
player2_score
))
self
.
assertEqual
(
top_10
[
1
][
'score'
],
Score
.
display_score
(
player1_score
))
self
.
assertAlmostEqual
(
top_10
[
0
][
'score'
],
Score
.
display_score
(
player2_score
),
delta
=
0.5
)
self
.
assertAlmostEqual
(
top_10
[
1
][
'score'
],
Score
.
display_score
(
player1_score
),
delta
=
0.5
)
# Top score user should be self.user2.username
self
.
assertEqual
(
top_10
[
0
][
'username'
],
self
.
user2
.
username
)
...
...
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