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
8040cd80
Commit
8040cd80
authored
Sep 11, 2014
by
Matt Drayer
Committed by
Jonathan Piacenti
Aug 20, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mattdrayer/api-points-possible-zero-check: Addressed divide by zero case
parent
a7d3d9d4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletions
+3
-1
lms/djangoapps/api_manager/courseware_access.py
+3
-1
No files found.
lms/djangoapps/api_manager/courseware_access.py
View file @
8040cd80
...
...
@@ -161,6 +161,7 @@ def calculate_proforma_grade(grade_summary, grading_policy):
remaining_weight
=
1.00
proforma_grade
=
0.00
totaled_scores
=
grade_summary
[
'totaled_scores'
]
grade
=
0.00
for
section
in
totaled_scores
:
points_earned
=
0.00
points_possible
=
0.00
...
...
@@ -172,7 +173,8 @@ def calculate_proforma_grade(grade_summary, grading_policy):
if
score
.
earned
or
(
score
.
due
and
score
.
due
<
timezone
.
now
()):
points_earned
=
points_earned
+
score
.
earned
points_possible
=
points_possible
+
score
.
possible
grade
=
points_earned
/
points_possible
if
points_possible
:
grade
=
points_earned
/
points_possible
section_policy
=
next
((
policy
for
policy
in
grading_policy
[
'GRADER'
]
if
policy
[
'type'
]
==
section
),
None
)
if
section_policy
is
not
None
:
section_weight
=
section_policy
[
'weight'
]
...
...
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