Commit 289dcd7d by Diana Huang

Add discussion data back in.

parent 0112bd7b
...@@ -61,6 +61,7 @@ from openedx.features.course_experience import course_home_page_title ...@@ -61,6 +61,7 @@ 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>
......
...@@ -20,6 +20,7 @@ from lms.djangoapps.courseware.courses import get_course_with_access ...@@ -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.discussion.views import create_user_profile_context
from lms.djangoapps.grades.course_grade_factory import CourseGradeFactory from lms.djangoapps.grades.course_grade_factory import CourseGradeFactory
from openedx.features.course_experience import default_course_url_name from openedx.features.course_experience import default_course_url_name
from student.models import CourseEnrollment
from xmodule.modulestore.django import modulestore from xmodule.modulestore.django import modulestore
from util.views import ensure_valid_course_key from util.views import ensure_valid_course_key
...@@ -52,10 +53,11 @@ class LearnerAnalyticsView(View): ...@@ -52,10 +53,11 @@ 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,
'is_verified': CourseEnrollment.is_enrolled_as_verified(request.user, course_key),
'grading_policy': grading_policy, 'grading_policy': grading_policy,
'assignment_grades': self.get_grade_data(request.user, course_key, grading_policy['GRADE_CUTOFFS']), '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)
...@@ -93,8 +95,12 @@ class LearnerAnalyticsView(View): ...@@ -93,8 +95,12 @@ class LearnerAnalyticsView(View):
user: User user: User
course_key: CourseKey course_key: CourseKey
""" """
discussion_data = create_user_profile_context(request, course_key, request.user.id) profile_context = create_user_profile_context(request, course_key, request.user.id)
return json.dumps(discussion_data) 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): def get_schedule(self, request, course_key):
""" """
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment