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
2905ac7c
Commit
2905ac7c
authored
Apr 17, 2012
by
David Ormsbee
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #20 from MITx/weighted_defaults
Fixed zero-score-possible bug.
parents
84ba2168
da3424f6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
djangoapps/courseware/grades.py
+4
-2
No files found.
djangoapps/courseware/grades.py
View file @
2905ac7c
...
...
@@ -131,6 +131,8 @@ def grade_sheet(student):
}
def
aggregate_scores
(
scores
):
scores
=
filter
(
lambda
score
:
score
.
possible
>
0
,
scores
)
total_correct_graded
=
sum
((
score
.
earned
*
1.0
/
score
.
possible
)
*
score
.
weight
for
score
in
scores
if
score
.
graded
)
total_possible_graded
=
sum
(
score
.
weight
for
score
in
scores
if
score
.
graded
)
total_correct
=
sum
((
score
.
earned
*
1.0
/
score
.
possible
)
*
score
.
weight
for
score
in
scores
)
...
...
@@ -225,10 +227,10 @@ def grade_summary_6002x(totaled_scores):
final_percentage
=
final_score
.
earned
*
1.0
/
final_score
.
possible
if
'Final'
in
totaled_scores
else
0
if
settings
.
GENERATE_PROFILE_SCORES
:
midterm_score
=
Score
(
random
.
randrange
(
50
,
150
),
150
,
True
,
"?"
)
midterm_score
=
Score
(
random
.
randrange
(
50
,
150
),
150
,
150
,
True
,
"?"
)
midterm_percentage
=
midterm_score
.
earned
/
float
(
midterm_score
.
possible
)
final_score
=
Score
(
random
.
randrange
(
100
,
300
),
300
,
True
,
"?"
)
final_score
=
Score
(
random
.
randrange
(
100
,
300
),
300
,
300
,
True
,
"?"
)
final_percentage
=
final_score
.
earned
/
float
(
final_score
.
possible
)
...
...
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