Package org.olat.course.statistic

Examples of org.olat.course.statistic.StatisticResult


  public StatisticResult generateStatisticResult(UserRequest ureq, ICourse course, long courseRepositoryEntryKey) {
    DBQuery dbQuery = DBFactory.getInstance().createQuery("select businessPath,day,value from org.olat.course.statistic.dayofweek.DayOfWeekStat sv "
        + "where sv.resId=:resId");
    dbQuery.setLong("resId", courseRepositoryEntryKey);

    StatisticResult result = new StatisticResult(course, dbQuery.list());
   
    // now sort by user's preferred firstDayOfWeek
    Calendar c = Calendar.getInstance(ureq.getLocale());
    int firstDayOfWeek = c.getFirstDayOfWeek();
   
    List<String> columnHeaders = new ArrayList<String>(7);
    for(int i=firstDayOfWeek; i<firstDayOfWeek+7; i++) {
      int mod = i%7;
      if (mod==0) {
        // jdk calendar calculations don't start at 0 - they start at 1
        mod = 7;
      }
      columnHeaders.add(String.valueOf(mod));
    }
   
    result.setColumnHeaders(columnHeaders);
    return result;
  }
View Full Code Here


  public StatisticResult generateStatisticResult(UserRequest ureq, ICourse course, long courseRepositoryEntryKey) {
    DBQuery dbQuery = DBFactory.getInstance().createQuery("select businessPath,orgType,value from org.olat.course.statistic.orgtype.OrgTypeStat sv "
        + "where sv.resId=:resId");
    dbQuery.setLong("resId", courseRepositoryEntryKey);

    return new StatisticResult(course, dbQuery.list());
  }
View Full Code Here

TOP

Related Classes of org.olat.course.statistic.StatisticResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.