New tab (Metrics) in instructor dashboard

Metrics tab shows student data:
  -Count of students opened a subsection
  -Grade distribution per problem

for each section/subsection of the course.

Implemented for both the old and beta dashboard
Controlled by a feature flag 'CLASS_DASHBOARD'
Data is aggregated across all students
Aggregate data computed from courseware_studentmodule
This commit is contained in:
Kristin Stephens
2013-08-02 14:41:42 -07:00
committed by David Adams
parent 9a23be5379
commit 3881ffdc0d
23 changed files with 1765 additions and 51 deletions

View File

@@ -23,7 +23,7 @@ from django_comment_client.utils import has_forum_access
from django_comment_common.models import FORUM_ROLE_ADMINISTRATOR
from student.models import CourseEnrollment
from bulk_email.models import CourseAuthorization
from class_dashboard.dashboard_data import get_section_display_name, get_array_section_has_problem
from .tools import get_units_with_due_date, title_or_url
@@ -31,7 +31,7 @@ from .tools import get_units_with_due_date, title_or_url
@ensure_csrf_cookie
@cache_control(no_cache=True, no_store=True, must_revalidate=True)
def instructor_dashboard_2(request, course_id):
"""Display the instructor dashboard for a course."""
""" Display the instructor dashboard for a course. """
course = get_course_by_id(course_id, depth=None)
is_studio_course = (modulestore().get_modulestore_type(course_id) != XML_MODULESTORE_TYPE)
@@ -64,6 +64,10 @@ def instructor_dashboard_2(request, course_id):
is_studio_course and CourseAuthorization.instructor_email_enabled(course_id):
sections.append(_section_send_email(course_id, access, course))
# Gate access to Metrics tab by featue flag and staff authorization
if settings.FEATURES['CLASS_DASHBOARD'] and access['staff']:
sections.append(_section_metrics(course_id, access))
studio_url = None
if is_studio_course:
studio_url = get_cms_course_link(course)
@@ -228,3 +232,15 @@ def _section_analytics(course_id, access):
'proxy_legacy_analytics_url': reverse('proxy_legacy_analytics', kwargs={'course_id': course_id}),
}
return section_data
def _section_metrics(course_id, access):
"""Provide data for the corresponding dashboard section """
section_data = {
'section_key': 'metrics',
'section_display_name': ('Metrics'),
'access': access,
'sub_section_display_name': get_section_display_name(course_id),
'section_has_problem': get_array_section_has_problem(course_id)
}
return section_data

View File

@@ -53,6 +53,7 @@ from instructor_task.api import (
)
from instructor_task.views import get_task_completion_info
from edxmako.shortcuts import render_to_response, render_to_string
from class_dashboard import dashboard_data
from psychometrics import psychoanalyze
from student.models import CourseEnrollment, CourseEnrollmentAllowed, unique_id_for_user
from student.views import course_from_id
@@ -817,6 +818,14 @@ def instructor_dashboard(request, course_id):
for analytic_name in DASHBOARD_ANALYTICS:
analytics_results[analytic_name] = get_analytics_result(analytic_name)
#----------------------------------------
# Metrics
metrics_results = {}
if settings.FEATURES.get('CLASS_DASHBOARD') and idash_mode == 'Metrics':
metrics_results['section_display_name'] = dashboard_data.get_section_display_name(course_id)
metrics_results['section_has_problem'] = dashboard_data.get_array_section_has_problem(course_id)
#----------------------------------------
# offline grades?
@@ -900,7 +909,8 @@ def instructor_dashboard(request, course_id):
'cohorts_ajax_url': reverse('cohorts', kwargs={'course_id': course_id}),
'analytics_results': analytics_results,
'disable_buttons': disable_buttons
'disable_buttons': disable_buttons,
'metrics_results': metrics_results,
}
if settings.FEATURES.get('ENABLE_INSTRUCTOR_BETA_DASHBOARD'):