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
8597cc0e
Commit
8597cc0e
authored
Nov 04, 2014
by
Dennis Jen
Committed by
Zia Fazal
Apr 07, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Feature flagged enrollment counts on instructor dashboard.
* enrollments counts removed from legacy dashboard
parent
c27c75fb
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
65 additions
and
56 deletions
+65
-56
lms/djangoapps/instructor/views/instructor_dashboard.py
+28
-13
lms/djangoapps/instructor/views/legacy.py
+3
-4
lms/envs/common.py
+5
-1
lms/templates/courseware/instructor_dashboard.html
+0
-16
lms/templates/instructor/instructor_dashboard_2/course_info.html
+29
-22
No files found.
lms/djangoapps/instructor/views/instructor_dashboard.py
View file @
8597cc0e
...
...
@@ -91,11 +91,7 @@ def instructor_dashboard_2(request, course_id):
if
course_mode_has_price
:
sections
.
append
(
_section_e_commerce
(
course
,
access
))
enrollment_count
=
sections
[
0
][
'enrollment_count'
][
'total'
]
disable_buttons
=
False
max_enrollment_for_buttons
=
settings
.
FEATURES
.
get
(
"MAX_ENROLLMENT_INSTR_BUTTONS"
)
if
max_enrollment_for_buttons
is
not
None
:
disable_buttons
=
enrollment_count
>
max_enrollment_for_buttons
disable_buttons
=
not
_is_small_course
(
course_key
)
analytics_dashboard_message
=
None
if
settings
.
ANALYTICS_DASHBOARD_URL
:
...
...
@@ -217,12 +213,19 @@ def _section_course_info(course, access):
'access'
:
access
,
'course_id'
:
course_key
,
'course_display_name'
:
course
.
display_name
,
'enrollment_count'
:
CourseEnrollment
.
enrollment_counts
(
course_key
),
'has_started'
:
course
.
has_started
(),
'has_ended'
:
course
.
has_ended
(),
'list_instructor_tasks_url'
:
reverse
(
'list_instructor_tasks'
,
kwargs
=
{
'course_id'
:
course_key
.
to_deprecated_string
()}),
}
if
settings
.
FEATURES
.
get
(
'DISPLAY_ANALYTICS_ENROLLMENTS'
):
section_data
[
'enrollment_count'
]
=
CourseEnrollment
.
enrollment_counts
(
course_key
)
if
settings
.
ANALYTICS_DASHBOARD_URL
:
dashboard_link
=
_get_dashboard_link
(
course_key
)
message
=
_
(
"Enrollment data is now available in {dashboard_link}."
)
.
format
(
dashboard_link
=
dashboard_link
)
section_data
[
'enrollment_message'
]
=
message
try
:
advance
=
lambda
memo
,
(
letter
,
score
):
"{}: {}, "
.
format
(
letter
,
score
)
+
memo
section_data
[
'grade_cutoffs'
]
=
reduce
(
advance
,
course
.
grade_cutoffs
.
items
(),
""
)[:
-
2
]
...
...
@@ -259,14 +262,19 @@ def _section_membership(course, access):
return
section_data
def
_section_student_admin
(
course
,
access
):
""" Provide data for the corresponding dashboard section """
course_key
=
course
.
id
def
_is_small_course
(
course_key
):
is_small_course
=
False
enrollment_count
=
CourseEnrollment
.
num_enrolled_in
(
course_key
)
max_enrollment_for_buttons
=
settings
.
FEATURES
.
get
(
"MAX_ENROLLMENT_INSTR_BUTTONS"
)
if
max_enrollment_for_buttons
is
not
None
:
is_small_course
=
enrollment_count
<=
max_enrollment_for_buttons
return
is_small_course
def
_section_student_admin
(
course
,
access
):
""" Provide data for the corresponding dashboard section """
course_key
=
course
.
id
is_small_course
=
_is_small_course
(
course_key
)
section_data
=
{
'section_key'
:
'student_admin'
,
...
...
@@ -354,6 +362,16 @@ def _section_send_email(course, access):
return
section_data
def
_get_dashboard_link
(
course_key
):
# Construct a URL to the external analytics dashboard
link
=
None
if
settings
.
ANALYTICS_DASHBOARD_URL
:
analytics_dashboard_url
=
'{0}/courses/{1}'
.
format
(
settings
.
ANALYTICS_DASHBOARD_URL
,
unicode
(
course_key
))
link
=
"<a href=
\"
{0}
\"
target=
\"
_blank
\"
>{1}</a>"
.
format
(
analytics_dashboard_url
,
settings
.
ANALYTICS_DASHBOARD_NAME
)
return
link
def
_section_analytics
(
course
,
access
):
""" Provide data for the corresponding dashboard section """
course_key
=
course
.
id
...
...
@@ -366,10 +384,7 @@ def _section_analytics(course, access):
}
if
settings
.
ANALYTICS_DASHBOARD_URL
:
# Construct a URL to the external analytics dashboard
analytics_dashboard_url
=
'{0}/courses/{1}'
.
format
(
settings
.
ANALYTICS_DASHBOARD_URL
,
unicode
(
course_key
))
dashboard_link
=
"<a href=
\"
{0}
\"
target=
\"
_blank
\"
>{1}</a>"
.
format
(
analytics_dashboard_url
,
settings
.
ANALYTICS_DASHBOARD_NAME
)
dashboard_link
=
_get_dashboard_link
(
course_key
)
message
=
_
(
"Demographic data is now available in {dashboard_link}."
)
.
format
(
dashboard_link
=
dashboard_link
)
section_data
[
'demographic_message'
]
=
message
...
...
lms/djangoapps/instructor/views/legacy.py
View file @
8597cc0e
...
...
@@ -134,8 +134,8 @@ def instructor_dashboard(request, course_id):
'header'
:
[
'Statistic'
,
'Value'
],
'title'
:
_
(
'Course Statistics At A Glance'
),
}
data
=
[[
'# Enrolled'
,
enrollment_number
]]
data
+
=
[[
'Date'
,
timezone
.
now
()
.
isoformat
()]]
data
=
[[
'Date'
,
timezone
.
now
()
.
isoformat
()]]
data
+=
compute_course_stats
(
course
)
.
items
()
if
request
.
user
.
is_staff
:
for
field
in
course
.
fields
.
values
():
...
...
@@ -938,11 +938,10 @@ def instructor_dashboard(request, course_id):
"StudentsDailyActivity"
,
# active students by day
"StudentsDropoffPerDay"
,
# active students dropoff by day
# "OverallGradeDistribution", # overall point distribution for course
"StudentsActive"
,
# num students active in time period (default = 1wk)
"StudentsEnrolled"
,
# num students enrolled
# "StudentsPerProblemCorrect", # foreach problem, num students correct
"ProblemGradeDistribution"
,
# foreach problem, grade distribution
]
for
analytic_name
in
DASHBOARD_ANALYTICS
:
analytics_results
[
analytic_name
]
=
get_analytics_result
(
analytic_name
)
...
...
lms/envs/common.py
View file @
8597cc0e
...
...
@@ -306,7 +306,11 @@ FEATURES = {
'ALLOW_AUTOMATED_SIGNUPS'
:
False
,
# Display demographic data on the analytics tab in the instructor dashboard.
'DISPLAY_ANALYTICS_DEMOGRAPHICS'
:
True
'DISPLAY_ANALYTICS_DEMOGRAPHICS'
:
True
,
# Enable display of enrollment counts in instructor and legacy analytics dashboard
'DISPLAY_ANALYTICS_ENROLLMENTS'
:
True
,
# Whether an xBlock publishing a 'grade' event should be considered a 'progress' event as well
'MARK_PROGRESS_ON_GRADING_EVENT'
:
False
,
...
...
lms/templates/courseware/instructor_dashboard.html
View file @
8597cc0e
...
...
@@ -609,22 +609,6 @@ function goto( mode)
<p>
${_("No Analytics are available at this time.")}
</p>
%endif
%if analytics_results.get("StudentsEnrolled"):
<p>
${_("Students enrolled (historical count, includes those who have since unenrolled):")}
${analytics_results["StudentsEnrolled"]['data'][0]['students']}
(${analytics_results["StudentsEnrolled"]['time']})
</p>
%endif
%if analytics_results.get("StudentsActive"):
<p>
${_("Students active in the last week:")}
${analytics_results["StudentsActive"]['data'][0]['active']}
(${analytics_results["StudentsActive"]['time']})
</p>
%endif
%if analytics_results.get("StudentsDropoffPerDay"):
<p>
${_("Student activity day by day")}
...
...
lms/templates/instructor/instructor_dashboard_2/course_info.html
View file @
8597cc0e
<
%!
from
django
.
utils
.
translation
import
ugettext
as
_
%
>
<
%
page
args=
"section_data"
/>
<div
class=
"enrollment-wrapper"
>
<h2>
${_("Enrollment Information")}
</h2>
## Translators: 'track' refers to the enrollment type ('honor', 'verified', or 'audit')
<span
class=
"tip"
>
${_("Number of enrollees (instructors, staff members, and students) by track")}
</span>
<br/><br/>
<
%
modes =
section_data['enrollment_count']
%
>
<table>
<tr>
<td>
${_("Verified")}
</td><td>
${modes['verified']}
</td>
</tr>
<tr>
<td>
${_("Audit")}
</td><td>
${modes['audit']}
</td>
</tr>
<tr>
<td>
${_("Honor")}
</td><td>
${modes['honor']}
</td>
</tr>
<tr
style=
"color:green;border-top:1px solid #000"
>
<td
style=
"padding-top:10px;"
><b>
${_("Total")}
</b></td><td
style=
"padding-top:10px;"
><b>
${modes['total']}
</b></td>
</tr>
</table>
</div>
<hr>
%if settings.FEATURES.get('DISPLAY_ANALYTICS_ENROLLMENTS') or section_data.get('enrollment_message'):
<div
class=
"enrollment-wrapper"
>
<h2>
${_("Enrollment Information")}
</h2>
%if settings.FEATURES.get('DISPLAY_ANALYTICS_ENROLLMENTS'):
## Translators: 'track' refers to the enrollment type ('honor', 'verified', or 'audit')
<span
class=
"tip"
>
${_("Number of enrollees (instructors, staff members, and students) by track")}
</span>
<br/><br/>
<
%
modes =
section_data['enrollment_count']
%
>
<table>
<tr>
<td>
${_("Verified")}
</td><td>
${modes['verified']}
</td>
</tr>
<tr>
<td>
${_("Audit")}
</td><td>
${modes['audit']}
</td>
</tr>
<tr>
<td>
${_("Honor")}
</td><td>
${modes['honor']}
</td>
</tr>
<tr
style=
"color:green;border-top:1px solid #000"
>
<td
style=
"padding-top:10px;"
><b>
${_("Total")}
</b></td><td
style=
"padding-top:10px;"
><b>
${modes['total']}
</b></td>
</tr>
</table>
%elif section_data.get('enrollment_message'):
<p>
${section_data['enrollment_message']}
</p>
%endif
</div>
<hr>
%endif
<div
class=
"basic-wrapper"
>
<h2>
${_("Basic Course Information")}
</h2>
...
...
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