def _get_track_function_for_task(student, xmodule_instance_args=None, source_page='x_module_task'):
 request_info = (xmodule_instance_args.get('request_info', {}) if (xmodule_instance_args is not None) else {})
 task_info = {'student': student.username, 'task_id': _get_task_id_from_xmodule_args(xmodule_instance_args)}
 return (lambda event_type, event: task_track(request_info, task_info, event_type, event, page=source_page))

def _get_track_function_for_task ( student , xmodule_instance_args = None , source_page = 'x_module_task' ) : request_info = ( xmodule_instance_args . get ( 'request_info' , { } ) if ( xmodule_instance_args is not None ) else { } ) task_info = { 'student' : student . username , 'task_id' : _get_task_id_from_xmodule_args ( xmodule_instance_args ) } return ( lambda event_type , event : task_track ( request_info , task_info , event_type , event , page = source_page ) )
make a tracking function that logs what happened .