assertTrue(q1.isVisible());
}
@Test
public void hasBeenAnswered() throws Exception {
Survey m = new Survey(new XMLSurveyReader(new File("src\\test\\org\\jsurveylib\\model\\question\\questionfiles\\hasbeenanswered.xml")));
Question q1 = m.getQuestionByID("X");
assertFalse(q1.isAnswered());
assertTrue(q1.isAnswerable());
q1.setAnswer("yes");
assertTrue(q1.isAnswered());
assertTrue(q1.isAnswerable());
Question hidden = m.getQuestionByID("Y"); //NOTE: we haven't set an answer on this
assertFalse(hidden.isAnswerable());
assertFalse(hidden.isAnswered());
hidden.setAnswer("yes");
assertFalse(hidden.isAnswerable());
assertTrue(hidden.isAnswered());
Question disabled = m.getQuestionByID("Z");
assertFalse(disabled.isEnabled());
assertFalse(disabled.isAnswerable());
m.getQuestionByID("W").setAnswer("yes");
assertTrue(disabled.isEnabled());
assertTrue(disabled.isAnswerable());
}