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
b66810c8
Commit
b66810c8
authored
Dec 18, 2017
by
AlasdairSwan
Browse files
Options
Browse Files
Download
Plain Diff
Merge Dianna's update
parents
8a5e86ea
73312210
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
3 deletions
+44
-3
openedx/features/learner_analytics/templates/learner_analytics/dashboard.html
+5
-1
openedx/features/learner_analytics/views.py
+39
-2
No files found.
openedx/features/learner_analytics/templates/learner_analytics/dashboard.html
View file @
b66810c8
...
...
@@ -46,6 +46,7 @@ from openedx.features.course_experience import course_home_page_title
</span>
<span
class=
"icon fa fa-angle-right"
aria-hidden=
"true"
></span>
<span
class=
"nav-item"
>
${_('Learner Analytics')}
</span>
</div>
</div>
</nav>
...
...
@@ -57,10 +58,13 @@ from openedx.features.course_experience import course_home_page_title
component="LearnerAnalyticsDashboard",
id="react-learner-analytics-dashboard",
props={
'data': 'data'
'data': 'data',
'schedule': assignment_schedule,
'grading_policy': grading_policy,
}
)}
</div>
<p>
${assignment_grades}
</p>
</div>
</div>
</
%
block>
...
...
openedx/features/learner_analytics/views.py
View file @
b66810c8
"""
Learner analytics dashboard views
"""
import
json
from
django.contrib.auth.decorators
import
login_required
from
django.template.context_processors
import
csrf
...
...
@@ -8,15 +9,17 @@ from django.core.urlresolvers import reverse
from
django.shortcuts
import
render_to_response
from
django.template.loader
import
render_to_string
from
django.utils.decorators
import
method_decorator
from
django.utils.translation
import
ugettext
as
_
from
django.views.decorators.cache
import
cache_control
from
django.views.decorators.csrf
import
ensure_csrf_cookie
from
django.views.generic
import
View
from
opaque_keys.edx.keys
import
CourseKey
from
courseware.courses
import
get_course_with_access
from
lms.djangoapps.course_api.blocks.api
import
get_blocks
from
lms.djangoapps.courseware.courses
import
get_course_with_access
from
lms.djangoapps.grades.course_grade_factory
import
CourseGradeFactory
from
openedx.core.djangoapps.plugin_api.views
import
EdxFragmentView
from
openedx.features.course_experience
import
default_course_url_name
from
xmodule.modulestore.django
import
modulestore
from
util.views
import
ensure_valid_course_key
...
...
@@ -46,5 +49,39 @@ class LearnerAnalyticsView(View):
'course_url'
:
course_url
,
'disable_courseware_js'
:
True
,
'uses_pattern_library'
:
True
,
'grading_policy'
:
course
.
grading_policy
,
'assignment_grades'
:
self
.
get_grade_data
(
request
.
user
,
course_key
),
'assignment_schedule'
:
self
.
get_schedule
(
request
,
course_key
)
}
return
render_to_response
(
'learner_analytics/dashboard.html'
,
context
)
def
get_grade_data
(
self
,
user
,
course_key
):
"""
Collects and formats the grade data to be piped to the front end.
Args:
user: User
course_key: CourseKey
"""
course_grade
=
CourseGradeFactory
()
.
read
(
user
,
course_key
=
course_key
)
return
course_grade
.
subsection_grades
def
get_schedule
(
self
,
request
,
course_key
):
"""
Get the schedule of graded assignments in the course.
Args:
request: HttpRequest
course_key: CourseKey
"""
course_usage_key
=
modulestore
()
.
make_course_usage_key
(
course_key
)
all_blocks
=
get_blocks
(
request
,
course_usage_key
,
user
=
request
.
user
,
nav_depth
=
3
,
requested_fields
=
[
'display_name'
,
'due'
,
'graded'
,
'format'
],
block_types_filter
=
[
'sequential'
]
)
return
all_blocks
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