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
8e364e6d
Commit
8e364e6d
authored
Aug 09, 2012
by
Victor Shnayder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ensure float when computing module score
parent
c9fd7b22
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
lms/djangoapps/courseware/grades.py
+2
-2
No files found.
lms/djangoapps/courseware/grades.py
View file @
8e364e6d
...
@@ -179,7 +179,7 @@ def progress_summary(student, course, grader, student_module_cache):
...
@@ -179,7 +179,7 @@ def progress_summary(student, course, grader, student_module_cache):
def
get_score
(
user
,
problem
,
student_module_cache
):
def
get_score
(
user
,
problem
,
student_module_cache
):
"""
"""
Return the score for a user on a problem
Return the score for a user on a problem
, as a tuple (correct, total).
user: a Student object
user: a Student object
problem: an XModule
problem: an XModule
...
@@ -219,7 +219,7 @@ def get_score(user, problem, student_module_cache):
...
@@ -219,7 +219,7 @@ def get_score(user, problem, student_module_cache):
if
total
==
0
:
if
total
==
0
:
log
.
exception
(
"Cannot reweight a problem with zero weight. Problem: "
+
str
(
instance_module
))
log
.
exception
(
"Cannot reweight a problem with zero weight. Problem: "
+
str
(
instance_module
))
return
(
correct
,
total
)
return
(
correct
,
total
)
correct
=
correct
*
weight
/
total
correct
=
float
(
correct
)
*
weight
/
total
total
=
weight
total
=
weight
return
(
correct
,
total
)
return
(
correct
,
total
)
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