def must_answer_survey(course_descriptor, user):
 if (not is_survey_required_for_course(course_descriptor)):
  return False
 survey = SurveyForm.get(course_descriptor.course_survey_name)
 has_staff_access = has_access(user, 'staff', course_descriptor)
 answered_survey = SurveyAnswer.do_survey_answers_exist(survey, user)
 return ((not answered_survey) and (not has_staff_access))

def must_answer_survey ( course_descriptor , user ) : if ( not is_survey_required_for_course ( course_descriptor ) ) : return False survey = SurveyForm . get ( course_descriptor . course_survey_name ) has_staff_access = has_access ( user , 'staff' , course_descriptor ) answered_survey = SurveyAnswer . do_survey_answers_exist ( survey , user ) return ( ( not answered_survey ) and ( not has_staff_access ) )
returns whether a user needs to answer a required survey .