From e135a4052b68d86846f458cef847a1bbffec7f14 Mon Sep 17 00:00:00 2001 From: David Ormsbee Date: Wed, 13 Mar 2013 15:16:36 -0400 Subject: [PATCH] Better error checking with Analytics are unavailable. --- lms/djangoapps/instructor/views.py | 2 +- lms/templates/courseware/instructor_dashboard.html | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lms/djangoapps/instructor/views.py b/lms/djangoapps/instructor/views.py index 24d29c9f2f..e5bef24902 100644 --- a/lms/djangoapps/instructor/views.py +++ b/lms/djangoapps/instructor/views.py @@ -605,7 +605,7 @@ def instructor_dashboard(request, course_id): return json.loads(res.content, object_pairs_hook=OrderedDict) else: log.error("Error fetching %s, code: %s, msg: %s", - (url, res.status_code, res.content)) + url, res.status_code, res.content) return None analytics_results = {} diff --git a/lms/templates/courseware/instructor_dashboard.html b/lms/templates/courseware/instructor_dashboard.html index 24ceade496..eda8c8a391 100644 --- a/lms/templates/courseware/instructor_dashboard.html +++ b/lms/templates/courseware/instructor_dashboard.html @@ -371,6 +371,10 @@ function goto( mode) %if modeflag.get('Analytics'): + %if not any(analytics_results.values()): +

No Analytics are available at this time.

+ %endif + %if analytics_results.get("StudentsEnrolled"):

Students enrolled: