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
4f2be41a
Commit
4f2be41a
authored
Mar 17, 2015
by
Sarina Canelake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add messaging about Insights to Analytics instructor tab
parent
9b905ae7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
43 deletions
+27
-43
lms/djangoapps/instructor/views/instructor_dashboard.py
+24
-18
lms/templates/instructor/instructor_dashboard_2/instructor_analytics.html
+3
-25
No files found.
lms/djangoapps/instructor/views/instructor_dashboard.py
View file @
4f2be41a
...
@@ -97,10 +97,24 @@ def instructor_dashboard_2(request, course_id):
...
@@ -97,10 +97,24 @@ def instructor_dashboard_2(request, course_id):
_section_cohort_management
(
course
,
access
),
_section_cohort_management
(
course
,
access
),
_section_student_admin
(
course
,
access
),
_section_student_admin
(
course
,
access
),
_section_data_download
(
course
,
access
),
_section_data_download
(
course
,
access
),
_section_analytics
(
course
,
access
),
]
]
#check if there is corresponding entry in the CourseMode Table related to the Instructor Dashboard course
analytics_dashboard_message
=
None
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
))
link_start
=
"<a href=
\"
{}
\"
target=
\"
_blank
\"
>"
.
format
(
analytics_dashboard_url
)
analytics_dashboard_message
=
_
(
"To gain insights into student enrollment and participation {link_start}"
"visit {analytics_dashboard_name}, our new course analytics product{link_end}."
)
analytics_dashboard_message
=
analytics_dashboard_message
.
format
(
link_start
=
link_start
,
link_end
=
"</a>"
,
analytics_dashboard_name
=
settings
.
ANALYTICS_DASHBOARD_NAME
)
# Temporarily show the "Analytics" section until we have a better way of linking to Insights
sections
.
append
(
_section_analytics
(
course
,
access
))
# Check if there is corresponding entry in the CourseMode Table related to the Instructor Dashboard course
course_mode_has_price
=
False
course_mode_has_price
=
False
paid_modes
=
CourseMode
.
paid_modes_for_course
(
course_key
)
paid_modes
=
CourseMode
.
paid_modes_for_course
(
course_key
)
if
len
(
paid_modes
)
==
1
:
if
len
(
paid_modes
)
==
1
:
...
@@ -136,15 +150,6 @@ def instructor_dashboard_2(request, course_id):
...
@@ -136,15 +150,6 @@ def instructor_dashboard_2(request, course_id):
disable_buttons
=
not
_is_small_course
(
course_key
)
disable_buttons
=
not
_is_small_course
(
course_key
)
analytics_dashboard_message
=
None
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
))
link_start
=
"<a href=
\"
{}
\"
target=
\"
_blank
\"
>"
.
format
(
analytics_dashboard_url
)
analytics_dashboard_message
=
_
(
"To gain insights into student enrollment and participation {link_start}visit {analytics_dashboard_name}, our new course analytics product{link_end}."
)
analytics_dashboard_message
=
analytics_dashboard_message
.
format
(
link_start
=
link_start
,
link_end
=
"</a>"
,
analytics_dashboard_name
=
settings
.
ANALYTICS_DASHBOARD_NAME
)
context
=
{
context
=
{
'course'
:
course
,
'course'
:
course
,
'old_dashboard_url'
:
reverse
(
'instructor_dashboard_legacy'
,
kwargs
=
{
'course_id'
:
unicode
(
course_key
)}),
'old_dashboard_url'
:
reverse
(
'instructor_dashboard_legacy'
,
kwargs
=
{
'course_id'
:
unicode
(
course_key
)}),
...
@@ -530,19 +535,20 @@ def _get_dashboard_link(course_key):
...
@@ -530,19 +535,20 @@ def _get_dashboard_link(course_key):
def
_section_analytics
(
course
,
access
):
def
_section_analytics
(
course
,
access
):
""" Provide data for the corresponding dashboard section """
""" Provide data for the corresponding dashboard section """
course_key
=
course
.
id
course_key
=
course
.
id
analytics_dashboard_url
=
'{0}/courses/{1}'
.
format
(
settings
.
ANALYTICS_DASHBOARD_URL
,
unicode
(
course_key
))
link_start
=
"<a href=
\"
{}
\"
target=
\"
_blank
\"
>"
.
format
(
analytics_dashboard_url
)
insights_message
=
_
(
"For analytics about your course, go to {analytics_dashboard_name}."
)
insights_message
=
insights_message
.
format
(
analytics_dashboard_name
=
'{0}{1}</a>'
.
format
(
link_start
,
settings
.
ANALYTICS_DASHBOARD_NAME
)
)
section_data
=
{
section_data
=
{
'section_key'
:
'instructor_analytics'
,
'section_key'
:
'instructor_analytics'
,
'section_display_name'
:
_
(
'Analytics'
),
'section_display_name'
:
_
(
'Analytics'
),
'access'
:
access
,
'access'
:
access
,
'get_distribution_url'
:
reverse
(
'get_distribution'
,
kwargs
=
{
'course_id'
:
unicode
(
course_key
)}),
'insights_message'
:
insights_message
,
'proxy_legacy_analytics_url'
:
reverse
(
'proxy_legacy_analytics'
,
kwargs
=
{
'course_id'
:
unicode
(
course_key
)}),
}
}
if
settings
.
ANALYTICS_DASHBOARD_URL
:
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
return
section_data
return
section_data
...
...
lms/templates/instructor/instructor_dashboard_2/instructor_analytics.html
View file @
4f2be41a
<
%!
from
django
.
utils
.
translation
import
ugettext
as
_
%
>
<
%!
from
django
.
utils
.
translation
import
ugettext
as
_
%
>
<
%
page
args=
"section_data"
/>
<
%
page
args=
"section_data"
/>
%if settings.FEATURES['DISPLAY_ANALYTICS_DEMOGRAPHICS']:
<div>
<div
class=
"profile-distribution-widget-container"
<p><em>
${section_data['insights_message']}
</em></p>
data-title=
"${_("
Year
of
Birth
")}"
</div>
data-feature=
"year_of_birth"
data-endpoint=
"${ section_data['get_distribution_url'] }"
></div>
<hr>
<div
class=
"profile-distribution-widget-container"
data-title=
"${_("
Gender
Distribution
")}"
data-feature=
"gender"
data-endpoint=
"${ section_data['get_distribution_url'] }"
></div>
<hr>
<div
class=
"profile-distribution-widget-container"
data-title=
"${_("
Level
of
Education
")}"
data-feature=
"level_of_education"
data-endpoint=
"${ section_data['get_distribution_url'] }"
></div>
%elif section_data['demographic_message']:
<p><em>
${section_data['demographic_message']}
</em></p>
%endif
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