'Given an expected answer string, a given (student-produced) answer
string, and a samples string, return whether the given answer is
"correct" or "incorrect".'

def check_formula(self, expected, given, samples):

    var_dict_list = self.randomize_variables(samples)
    student_result = self.tupleize_answers(given, var_dict_list)
    instructor_result = self.tupleize_answers(expected, var_dict_list)
    correct = all((compare_with_tolerance(student, instructor, self.tolerance) for (student, instructor) in zip(student_result, instructor_result)))
    if correct:
        return 'correct'
    else:
        return 'incorrect'
