From 405b18618cbd5a88dc59945cbca2418b54988872 Mon Sep 17 00:00:00 2001 From: "Mark L. Chang" Date: Thu, 4 Apr 2013 00:49:09 -0400 Subject: [PATCH] instrumented checklists --- cms/static/js/views/checklists_view.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cms/static/js/views/checklists_view.js b/cms/static/js/views/checklists_view.js index e553c7a2ca..85c0f5242b 100644 --- a/cms/static/js/views/checklists_view.js +++ b/cms/static/js/views/checklists_view.js @@ -77,11 +77,18 @@ CMS.Views.Checklists = Backbone.View.extend({ var task_index = $checkbox.data('task'); var model = this.collection.at(checklist_index); model.attributes.items[task_index].is_checked = $task.hasClass(completed); + model.save({}, { success : function() { var updatedTemplate = self.renderTemplate(model, checklist_index); self.$el.find('#course-checklist'+checklist_index).first().replaceWith(updatedTemplate); + + analytics.track('Toggled a Checklist Task', { + 'course': course_location_analytics, + 'task': model.attributes.items[task_index].short_description, + 'state': model.attributes.items[task_index].is_checked + }); }, error : CMS.ServerError });