/* (non-Javadoc)
* @see org.cast.isi.service.IISIResponseService#saveSingleSelectResponse(org.apache.wicket.model.IModel, java.lang.String, boolean, java.lang.String)
*/
public void saveSingleSelectResponse(IModel<Response> mResponse, String text, boolean correct, String pageName) {
Response r = mResponse.getObject();
int score = correct ? 1 : 0;
// Number of tries counts up until a correct response is recorded, then stops.
if (!r.isCorrect()) {
Set<ResponseData> previousResponses = r.getAllResponseData();
r.setTries(previousResponses==null ? 1 : previousResponses.size()+1);
}
// New score is recorded if it is better than previous tries
if (r.getScore()==null || score > r.getScore())
r.setScore(score);
// Multiple choice always has total points = 1
r.setTotal(1);
super.genericSaveResponse(mResponse, text, score, 1, 1, null, pageName);
}