use of com.cas.sim.tis.entity.LibraryAnswer in project TeachingInSimulation by ScOrPiOzzy.
the class ExamController method checkAnswer.
/**
* @param o
*/
private void checkAnswer(ToggleButton button) {
if (current == null) {
return;
}
LibraryAnswer answer = current.getAnswer();
if (answer == null) {
return;
}
String answerStr = answer.getAnswer();
if (StringUtils.isEmpty(answerStr)) {
answer.setCorrected(AnswerState.ANSWER_STATE_UNDO.getType());
if (button.getStyleClass().contains("undo")) {
return;
} else {
button.getStyleClass().remove("done");
button.getStyleClass().add("undo");
}
} else if (StringUtils.isEmpty(answerStr.replaceAll("\\|", ""))) {
answer.setCorrected(AnswerState.ANSWER_STATE_UNDO.getType());
if (button.getStyleClass().contains("undo")) {
return;
} else {
button.getStyleClass().remove("done");
button.getStyleClass().add("undo");
}
} else {
answers.put((Integer) button.getUserData(), answer);
if (button.getStyleClass().contains("done")) {
return;
} else {
button.getStyleClass().add("done");
button.getStyleClass().remove("undo");
}
}
}
Aggregations