Exemplo n.º 1
0
 public List<StatisticDetailsBean> getRegisterStatisticData(Date from, Date to) {
   List<StatisticDetailsBean> results = new ArrayList<StatisticDetailsBean>();
   List<User> users = userRepo.findInDateRange(from, to);
   StatisticDetailsBean registerDetailsBean = null;
   for (User u : users) {
     registerDetailsBean =
         new StatisticDetailsBean(
             u.getUserId(), u.getUserName(), u.getUserEmail(), u.getDateCreated());
     results.add(registerDetailsBean);
   }
   return results;
 }
Exemplo n.º 2
0
 public TUserTest updateScoreAndCorrectCountTest(User currentUser, TestTrackingBean testBean) {
   int correctCount = testBean.getCorrectCount();
   int score = correctCount * SCORE_PER_QUESTION;
   // find TUserTest current
   TUserTest tUserTest =
       findByUserIdAndTestId(currentUser.getUserId(), testBean.gettTest().getTestId());
   tUserTest.setCorrectCount(correctCount);
   tUserTest.setScore(score);
   tUserTest.setFinishedDated(new Date(System.currentTimeMillis()));
   tUserTest = updateUserTest(tUserTest);
   return tUserTest;
 }