Added conditions to not take the survey if it is not published or if it is closed.