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
6579364f
Commit
6579364f
authored
May 05, 2014
by
Han Su Kim
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3593 from edx/han/cert-report
Certificate report improvements
parents
5cef9f7a
8bcb70b8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
5 deletions
+15
-5
lms/djangoapps/certificates/management/commands/gen_cert_report.py
+15
-5
No files found.
lms/djangoapps/certificates/management/commands/gen_cert_report.py
View file @
6579364f
...
@@ -58,19 +58,29 @@ class Command(BaseCommand):
...
@@ -58,19 +58,29 @@ class Command(BaseCommand):
for
course_id
in
ended_courses
:
for
course_id
in
ended_courses
:
# find students who are enrolled
# find students who are active
# enrolled students are always downloable + notpassing
print
"Looking up certificate states for {0}"
.
format
(
course_id
)
print
"Looking up certificate states for {0}"
.
format
(
course_id
)
enrolled
_students
=
User
.
objects
.
filter
(
active
_students
=
User
.
objects
.
filter
(
courseenrollment__course_id
=
course_id
,
courseenrollment__course_id
=
course_id
,
courseenrollment__is_active
=
True
)
courseenrollment__is_active
=
True
)
cert_data
[
course_id
]
=
{
'enrolled'
:
enrolled_students
.
count
()}
tallies
=
GeneratedCertificate
.
objects
.
filter
(
cert_data
[
course_id
]
=
{
'active'
:
active_students
.
count
()}
status_tally
=
GeneratedCertificate
.
objects
.
filter
(
course_id__exact
=
course_id
)
.
values
(
'status'
)
.
annotate
(
course_id__exact
=
course_id
)
.
values
(
'status'
)
.
annotate
(
dcount
=
Count
(
'status'
))
dcount
=
Count
(
'status'
))
cert_data
[
course_id
]
.
update
(
cert_data
[
course_id
]
.
update
(
{
status
[
'status'
]:
status
[
'dcount'
]
{
status
[
'status'
]:
status
[
'dcount'
]
for
status
in
tallies
})
for
status
in
status_tally
})
mode_tally
=
GeneratedCertificate
.
objects
.
filter
(
course_id__exact
=
course_id
,
status__exact
=
'downloadable'
)
.
values
(
'mode'
)
.
annotate
(
dcount
=
Count
(
'mode'
))
cert_data
[
course_id
]
.
update
(
{
mode
[
'mode'
]:
mode
[
'dcount'
]
for
mode
in
mode_tally
})
# all states we have seen far all courses
# all states we have seen far all courses
status_headings
=
set
(
status_headings
=
set
(
...
...
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