diff --git a/lms/djangoapps/courseware/module_render.py b/lms/djangoapps/courseware/module_render.py index 6e6f3c9..9b9c621 100644 --- a/lms/djangoapps/courseware/module_render.py +++ b/lms/djangoapps/courseware/module_render.py @@ -384,10 +384,20 @@ def xqueue_callback(request, course_id, userid, id, dispatch): if instance_module.grade != oldgrade or instance_module.state != old_instance_state: instance_module.save() - course_split=course_id.split("/") + score_bucket=0 + if(instance_module.grade>0 and instance_module.grade<instance_module.max_grade): + score_bucket=1 + elif(instance_module.grade==instance_module.max_grade): + score_bucket=2 + + org, course_num, run=course_id.split("/") if(instance_module.state=="correct" or instance_module.state=="incorrect"): - statsd.increment("lms.user.question_answered",tags=["org:" + str(course_split[0]),"course:" + str(course_split[1]), "run:" + str(course_split[2]), "answer:" + str(instance_module.state), "score:" + str(instance_module.grade), "type:xqueue"]) - + statsd.increment("lms.user.question_answered", + tags=["org:{0}".format(org), + "course:{0}".format(course_num), + "run:{0}".format(run), + "score_bucket:{0}".format(score_bucket)), + "type:xqueue"]) return HttpResponse("") @@ -472,9 +482,20 @@ def modx_dispatch(request, dispatch, location, course_id): instance_module.max_grade != old_instance_max_grade): instance_module.save() - course_split=course_id.split("/") + score_bucket=0 + if(instance_module.grade>0 and instance_module.grade<instance_module.max_grade): + score_bucket=1 + elif(instance_module.grade==instance_module.max_grade): + score_bucket=2 + + org, course_num, run=course_id.split("/") if(instance_module.state=="correct" or instance_module.state=="incorrect"): - statsd.increment("lms.user.question_answered",tags=["org:" + str(course_split[0]),"course:" + str(course_split[1]), "run:" + str(course_split[2]), "answer:" + str(instance_module.state), "score:" + str(instance_module.grade), "type:ajax"]) + statsd.increment("lms.user.question_answered", + tags=["org:{0}".format(org), + "course:{0}".format(course_num), + "run:{0}".format(run), + "score_bucket:{0}".format(score_bucket)), + "type:ajax"]) if shared_module is not None: