public StatisticResult generateStatisticResult(UserRequest ureq, ICourse course, long courseRepositoryEntryKey) {
DBQuery dbQuery = DBFactory.getInstance().createQuery("select businessPath,hour,value from org.olat.course.statistic.hourofday.HourOfDayStat sv "
+ "where sv.resId=:resId");
dbQuery.setLong("resId", courseRepositoryEntryKey);
StatisticResult statisticResult = new StatisticResult(course, dbQuery.list());
List<String> columnHeaders = statisticResult.getColumnHeaders();
if (columnHeaders!=null && columnHeaders.size()>1) {
try{
int start = Integer.parseInt(columnHeaders.get(0));
int end = Integer.parseInt(columnHeaders.get(columnHeaders.size()-1));