if (progress.getCurrentQuestionIndex() == progress.getQuestionary().getQuestions().size() - 1) {
PercentileScore ps = new PercentileScore();
Score score = ps.evaluate(progress.getQuestionary(), progress.getAnswers());
User user = (User) session.getAttribute("user");
QuestionaryResult result = new QuestionaryResult();
result.setUserId(user.getId());
result.setDate(new Date());
result.setQuestionaryName(progress.getQuestionary().getName());
result.setResult(score.getValue());
resultsService.addResult(result);