added docstrings
This commit is contained in:
@@ -384,6 +384,7 @@ def xqueue_callback(request, course_id, userid, id, dispatch):
|
||||
if instance_module.grade != oldgrade or instance_module.state != old_instance_state:
|
||||
instance_module.save()
|
||||
|
||||
#Bin score into range and increment stats
|
||||
score_bucket=get_score_bucket(instance_module.grade, instance_module.max_grade)
|
||||
org, course_num, run=course_id.split("/")
|
||||
statsd.increment("lms.courseware.question_answered",
|
||||
@@ -476,6 +477,7 @@ def modx_dispatch(request, dispatch, location, course_id):
|
||||
instance_module.max_grade != old_instance_max_grade):
|
||||
instance_module.save()
|
||||
|
||||
#Bin score into range and increment stats
|
||||
score_bucket=get_score_bucket(instance_module.grade, instance_module.max_grade)
|
||||
org, course_num, run=course_id.split("/")
|
||||
statsd.increment("lms.courseware.question_answered",
|
||||
@@ -530,9 +532,12 @@ def preview_chemcalc(request):
|
||||
|
||||
return HttpResponse(json.dumps(result))
|
||||
|
||||
#Function to split arbitrary score ranges into 3 buckets.
|
||||
#Used with statsd tracking.
|
||||
|
||||
def get_score_bucket(grade,max_grade):
|
||||
"""
|
||||
Function to split arbitrary score ranges into 3 buckets.
|
||||
Used with statsd tracking.
|
||||
"""
|
||||
score_bucket="incorrect"
|
||||
if(grade>0 and grade<max_grade):
|
||||
score_bucket="partial"
|
||||
|
||||
Reference in New Issue
Block a user