From d6984cced8682d98d11658338aae6d166cf6059d Mon Sep 17 00:00:00 2001 From: jmvt Date: Mon, 4 Feb 2013 16:08:37 -0500 Subject: [PATCH] Updated code to handle new analytics result format. --- .../courseware/instructor_dashboard.html | 58 ++++++++++--------- 1 file changed, 30 insertions(+), 28 deletions(-) diff --git a/lms/templates/courseware/instructor_dashboard.html b/lms/templates/courseware/instructor_dashboard.html index 967088de19..8053f67a88 100644 --- a/lms/templates/courseware/instructor_dashboard.html +++ b/lms/templates/courseware/instructor_dashboard.html @@ -345,10 +345,10 @@ function goto( mode) %if modeflag.get('Analytics'):

- Number of students enrolled: + Number of students enrolled for ${students_enrolled_json['data'][0]['course_id']}: % if students_enrolled_json is not None: % if students_enrolled_json['status'] == 'success': - ${students_enrolled_json['data']['value']} as of ${students_enrolled_json['time']} + ${students_enrolled_json['data'][0]['count']} as of ${students_enrolled_json['time']} % else: ${students_enrolled_json['error']} % endif @@ -358,10 +358,10 @@ function goto( mode)

- Number of active students for the past 7 days: + Number of students active for ${students_active_json['data'][0]['course_id']} for the past 7 days: % if students_active_json is not None: % if students_active_json['status'] == 'success': - ${students_active_json['data']['value']} as of ${students_active_json['time']} + ${students_active_json['data'][0]['count']} as of ${students_active_json['time']} % else: ${students_active_json['error']} % endif @@ -407,8 +407,8 @@ function goto( mode)

- % for k,v in students_per_problem_correct_json['data'].items(): - + % for row in students_per_problem_correct_json['data']: + % endfor
ProblemNumber of students
${k} ${v}
${row['module_id']} ${row['count']}
@@ -420,6 +420,7 @@ function goto( mode) % endif

+

Students per module who attempted at least one problem @@ -429,8 +430,8 @@ function goto( mode)

- % for k,v in attempted_problems['data'].items(): - + % for row in attempted_problems['data']: + % endfor
ModuleNumber of students
${k} ${v}
${row['module_id']} ${row['count']}
@@ -444,6 +445,27 @@ function goto( mode)

+

+

Grade distribution:

+ + % if overall_grade_distribution is not None: + % if overall_grade_distribution['status'] == 'success': +
+ + + % for row in overall_grade_distribution['data']: + + % endfor +
GradeNumber of students
${row['overall_grade']} ${row['count']}
+
+ % else: + ${dropoff_per_day['error']} + % endif + % else: + null data + % endif +

+ ##

Number of students who dropped off per day before becoming inactive:

## ## % if dropoff_per_day is not None: @@ -464,26 +486,6 @@ function goto( mode) ## % endif ##

## -##

-##

Grade distribution:

-## -## % if overall_grade_distribution is not None: -## % if overall_grade_distribution['status'] == 'success': -##
-## -## -## % for k,v in overall_grade_distribution['data'].items(): -## -## % endfor -##
GradeNumber of students
${k} ${v}
-##
-## % else: -## ${dropoff_per_day['error']} -## % endif -## % else: -## null data -## % endif -##

##