if (idMap.get(question.getId()) != null) {
throw new IllegalArgumentException("Attempted to insert a question with an id that already exists: " + question.getId());
}
try {
Page p = pages.get(pageNum);
p.insertQuestion(question, row);
idMap.put(question.getId(), question);
fireQuestionInserted(question, pageNum, row);
} catch (IndexOutOfBoundsException e) {
IllegalArgumentException i = new IllegalArgumentException("Attempted to insert a question to an invalid page number.");
i.initCause(e);