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
0112bd7b
Commit
0112bd7b
authored
Dec 20, 2017
by
Diana Huang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up data.
Hide discussion information for now.
parent
ca6da2db
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
13 deletions
+22
-13
openedx/features/learner_analytics/templates/learner_analytics/dashboard.html
+0
-1
openedx/features/learner_analytics/views.py
+22
-12
No files found.
openedx/features/learner_analytics/templates/learner_analytics/dashboard.html
View file @
0112bd7b
...
@@ -61,7 +61,6 @@ from openedx.features.course_experience import course_home_page_title
...
@@ -61,7 +61,6 @@ from openedx.features.course_experience import course_home_page_title
'schedule': assignment_schedule,
'schedule': assignment_schedule,
'grading_policy': grading_policy,
'grading_policy': grading_policy,
'grades': assignment_grades,
'grades': assignment_grades,
'discussion_info': discussion_info,
}
}
)}
)}
</div>
</div>
...
...
openedx/features/learner_analytics/views.py
View file @
0112bd7b
"""
"""
Learner analytics dashboard views
Learner analytics dashboard views
"""
"""
import
math
import
json
import
json
from
django.contrib.auth.decorators
import
login_required
from
django.contrib.auth.decorators
import
login_required
...
@@ -42,6 +43,8 @@ class LearnerAnalyticsView(View):
...
@@ -42,6 +43,8 @@ class LearnerAnalyticsView(View):
course_url_name
=
default_course_url_name
(
course
.
id
)
course_url_name
=
default_course_url_name
(
course
.
id
)
course_url
=
reverse
(
course_url_name
,
kwargs
=
{
'course_id'
:
unicode
(
course
.
id
)})
course_url
=
reverse
(
course_url_name
,
kwargs
=
{
'course_id'
:
unicode
(
course
.
id
)})
grading_policy
=
course
.
grading_policy
# Render the course bookmarks page
# Render the course bookmarks page
context
=
{
context
=
{
'csrf'
:
csrf
(
request
)[
'csrf_token'
],
'csrf'
:
csrf
(
request
)[
'csrf_token'
],
...
@@ -49,15 +52,14 @@ class LearnerAnalyticsView(View):
...
@@ -49,15 +52,14 @@ class LearnerAnalyticsView(View):
'course_url'
:
course_url
,
'course_url'
:
course_url
,
'disable_courseware_js'
:
True
,
'disable_courseware_js'
:
True
,
'uses_pattern_library'
:
True
,
'uses_pattern_library'
:
True
,
'grading_policy'
:
course
.
grading_policy
,
'grading_policy'
:
grading_policy
,
'assignment_grades'
:
self
.
get_grade_data
(
request
.
user
,
course_key
),
'assignment_grades'
:
self
.
get_grade_data
(
request
.
user
,
course_key
,
grading_policy
[
'GRADE_CUTOFFS'
]
),
'assignment_schedule'
:
self
.
get_schedule
(
request
,
course_key
),
'assignment_schedule'
:
self
.
get_schedule
(
request
,
course_key
),
'discussion_info'
:
self
.
get_discussion_data
(
request
,
course_key
)
#
'discussion_info': self.get_discussion_data(request, course_key)
}
}
return
render_to_response
(
'learner_analytics/dashboard.html'
,
context
)
return
render_to_response
(
'learner_analytics/dashboard.html'
,
context
)
def
get_grade_data
(
self
,
user
,
course_key
,
grade_cutoffs
):
def
get_grade_data
(
self
,
user
,
course_key
):
"""
"""
Collects and formats the grades data for a particular user and course.
Collects and formats the grades data for a particular user and course.
...
@@ -66,13 +68,21 @@ class LearnerAnalyticsView(View):
...
@@ -66,13 +68,21 @@ class LearnerAnalyticsView(View):
course_key: CourseKey
course_key: CourseKey
"""
"""
course_grade
=
CourseGradeFactory
()
.
read
(
user
,
course_key
=
course_key
)
course_grade
=
CourseGradeFactory
()
.
read
(
user
,
course_key
=
course_key
)
grades
=
{}
grades
=
[]
for
(
subsection
,
subsection_grade
)
in
course_grade
.
subsection_grades
.
iteritems
():
for
(
location
,
subsection_grade
)
in
course_grade
.
subsection_grades
.
iteritems
():
grades
[
unicode
(
subsection
)]
=
{
if
subsection_grade
.
format
is
not
None
:
'assignment_type'
:
subsection_grade
.
format
,
possible
=
subsection_grade
.
graded_total
.
possible
'total_earned'
:
subsection_grade
.
graded_total
.
earned
,
passing_grade
=
math
.
ceil
(
possible
*
grade_cutoffs
[
'Pass'
])
'total_possible'
:
subsection_grade
.
graded_total
.
possible
,
grades
.
append
({
}
'assignment_type'
:
subsection_grade
.
format
,
'total_earned'
:
subsection_grade
.
graded_total
.
earned
,
'total_possible'
:
possible
,
'passing_grade'
:
passing_grade
,
'assigment_url'
:
reverse
(
'jump_to_id'
,
kwargs
=
{
'course_id'
:
unicode
(
course_key
),
'module_id'
:
unicode
(
location
),
})
})
return
json
.
dumps
(
grades
)
return
json
.
dumps
(
grades
)
def
get_discussion_data
(
self
,
request
,
course_key
):
def
get_discussion_data
(
self
,
request
,
course_key
):
...
...
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