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
b69d526a
Commit
b69d526a
authored
Aug 12, 2014
by
Matt Drayer
Committed by
Jonathan Piacenti
Aug 20, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mattdrayer/api-null-points-check: Ensure aggregate operation result
parent
59970d3f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
lms/djangoapps/api_manager/courses/views.py
+4
-3
No files found.
lms/djangoapps/api_manager/courses/views.py
View file @
b69d526a
...
...
@@ -1561,9 +1561,10 @@ class CoursesLeadersList(SecureListAPIView):
data
[
'points'
]
=
user_points
points
=
queryset
.
aggregate
(
total
=
Sum
(
'grade'
))
users_total
=
CourseEnrollment
.
users_enrolled_in
(
course_key
)
.
exclude
(
id__in
=
exclude_users
)
.
count
()
if
users_total
:
course_avg
=
round
(
points
[
'total'
]
/
float
(
users_total
),
1
)
if
points
and
points
[
'total'
]
is
not
None
:
users_total
=
CourseEnrollment
.
users_enrolled_in
(
course_key
)
.
exclude
(
id__in
=
exclude_users
)
.
count
()
if
users_total
:
course_avg
=
round
(
points
[
'total'
]
/
float
(
users_total
),
1
)
data
[
'course_avg'
]
=
course_avg
queryset
=
queryset
.
filter
(
student__is_active
=
True
)
.
values
(
'student__id'
,
'student__username'
,
'student__profile__title'
,
...
...
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