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
289dcd7d
Commit
289dcd7d
authored
Dec 20, 2017
by
Diana Huang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add discussion data back in.
parent
0112bd7b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
3 deletions
+10
-3
openedx/features/learner_analytics/templates/learner_analytics/dashboard.html
+1
-0
openedx/features/learner_analytics/views.py
+9
-3
No files found.
openedx/features/learner_analytics/templates/learner_analytics/dashboard.html
View file @
289dcd7d
...
...
@@ -61,6 +61,7 @@ from openedx.features.course_experience import course_home_page_title
'schedule': assignment_schedule,
'grading_policy': grading_policy,
'grades': assignment_grades,
'discussion_info': discussion_info
}
)}
</div>
...
...
openedx/features/learner_analytics/views.py
View file @
289dcd7d
...
...
@@ -20,6 +20,7 @@ from lms.djangoapps.courseware.courses import get_course_with_access
from
lms.djangoapps.discussion.views
import
create_user_profile_context
from
lms.djangoapps.grades.course_grade_factory
import
CourseGradeFactory
from
openedx.features.course_experience
import
default_course_url_name
from
student.models
import
CourseEnrollment
from
xmodule.modulestore.django
import
modulestore
from
util.views
import
ensure_valid_course_key
...
...
@@ -52,10 +53,11 @@ class LearnerAnalyticsView(View):
'course_url'
:
course_url
,
'disable_courseware_js'
:
True
,
'uses_pattern_library'
:
True
,
'is_verified'
:
CourseEnrollment
.
is_enrolled_as_verified
(
request
.
user
,
course_key
),
'grading_policy'
:
grading_policy
,
'assignment_grades'
:
self
.
get_grade_data
(
request
.
user
,
course_key
,
grading_policy
[
'GRADE_CUTOFFS'
]),
'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
)
...
...
@@ -93,8 +95,12 @@ class LearnerAnalyticsView(View):
user: User
course_key: CourseKey
"""
discussion_data
=
create_user_profile_context
(
request
,
course_key
,
request
.
user
.
id
)
return
json
.
dumps
(
discussion_data
)
profile_context
=
create_user_profile_context
(
request
,
course_key
,
request
.
user
.
id
)
discussion_data
=
{
'threads_authored'
:
len
(
profile_context
[
'threads'
]),
'subscribed_threads'
:
len
(
profile_context
[
'user_info'
][
'subscribed_thread_ids'
]),
}
return
discussion_data
def
get_schedule
(
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