'Deletes student state for a problem. requesting_user may be kept as an audit trail.
Takes some of the following query parameters
- student_identifier is an email or username
- content_id is a url-name of a problem
- course_id is the id for the course'

def delete_student_attempt(self, student_identifier, course_id, content_id, requesting_user):

    course_id = CourseKey.from_string(course_id)
    try:
        student = get_student_from_identifier(student_identifier)
    except ObjectDoesNotExist:
        err_msg = 'Error    occurred    while    attempting    to    reset    student    attempts    for    user    {student_identifier}    for    content_id    {content_id}.    User    does    not    exist!'.format(student_identifier=student_identifier, content_id=content_id)
        log.error(err_msg)
        return
    try:
        module_state_key = UsageKey.from_string(content_id)
    except InvalidKeyError:
        err_msg = 'Invalid    content_id    {content_id}!'.format(content_id=content_id)
        log.error(err_msg)
        return
    if student:
        try:
            enrollment.reset_student_attempts(course_id, student, module_state_key, requesting_user=requesting_user, delete_module=True)
        except (StudentModule.DoesNotExist, enrollment.sub_api.SubmissionError):
            err_msg = 'Error    occurred    while    attempting    to    reset    student    attempts    for    user    {student_identifier}    for    content_id    {content_id}.'.format(student_identifier=student_identifier, content_id=content_id)
            log.error(err_msg)
