def list_problem_responses(course_key, problem_location):
 problem_key = UsageKey.from_string(problem_location)
 run = problem_key.run
 if (not run):
  problem_key = course_key.make_usage_key_from_deprecated_string(problem_location)
 if (problem_key.course_key != course_key):
  return []
 smdat = StudentModule.objects.filter(course_id=course_key, module_state_key=problem_key)
 smdat = smdat.order_by('student')
 return [{'username': response.student.username, 'state': response.state} for response in smdat]

def list_problem_responses ( course_key , problem_location ) : problem_key = UsageKey . from_string ( problem_location ) run = problem_key . run if ( not run ) : problem_key = course_key . make_usage_key_from_deprecated_string ( problem_location ) if ( problem_key . course_key != course_key ) : return [ ] smdat = StudentModule . objects . filter ( course_id = course_key , module_state_key = problem_key ) smdat = smdat . order_by ( 'student' ) return [ { 'username' : response . student . username , 'state' : response . state } for response in smdat ]
return responses to a given problem as a dict .