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
fd4963c5
Commit
fd4963c5
authored
Sep 16, 2014
by
Matt Drayer
Committed by
Jonathan Piacenti
Aug 20, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mattdrayer/api: Reworked proforma grade algorithm
parent
cc8e929d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
lms/djangoapps/api_manager/courseware_access.py
+8
-6
No files found.
lms/djangoapps/api_manager/courseware_access.py
View file @
fd4963c5
...
...
@@ -170,23 +170,25 @@ def calculate_proforma_grade(grade_summary, grading_policy):
- Remaining Weight: 0.15 (unscored Lab section), assume 100
%
, of 15
%
=> 0.150
- Proforma Grade = 0.105 + 0.240 + 0.380 + 0.150 = 0.875 (87.5
%
)
"""
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
section_score
=
0.00
section_count
=
0.00
# totaled_scores is a collection of currently-recored scores for a given section
# we need to iterate through and combine the scores to create an overall score for the section
# This loop does not take into account dropped assignments (eg, homeworks)
for
score
in
totaled_scores
[
section
]:
# Only count grades where points have been scored, or where the due date has passed
if
score
.
earned
or
(
score
.
due
and
score
.
due
<
timezone
.
now
()):
points_earned
=
points_earned
+
score
.
earned
points_possible
=
points_possible
+
score
.
possible
if
points_possible
:
grade
=
points_earned
/
points_possible
score_percentage
=
score
.
earned
/
score
.
possible
section_score
+=
score_percentage
section_count
+=
1
if
section_score
:
grade
=
section_score
/
section_count
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