Search in sources :

Example 1 with AssessmentToolContainer

use of org.olat.modules.assessment.ui.AssessmentToolContainer in project openolat by klemens.

the class STIdentityListCourseNodeController method loadModel.

@Override
protected void loadModel(UserRequest ureq) {
    Map<Long, Date> initialLaunchDates = userInfosMgr.getInitialLaunchDates(getCourseRepositoryEntry().getOlatResource());
    super.loadModel(ureq);
    List<AssessedIdentityElementRow> rows = usersTableModel.getObjects();
    for (AssessedIdentityElementRow row : rows) {
        Date initialLaunchDate = initialLaunchDates.get(row.getIdentityKey());
        row.setInitialCourseLaunchDate(initialLaunchDate);
    }
    AssessmentToolContainer toolContainer = getToolContainer();
    if (toolContainer.getCertificateMap() == null) {
        List<CertificateLight> certificates = certificatesManager.getLastCertificates(getCourseRepositoryEntry().getOlatResource());
        ConcurrentMap<Long, CertificateLight> certificateMap = new ConcurrentHashMap<>();
        for (CertificateLight certificate : certificates) {
            certificateMap.put(certificate.getIdentityKey(), certificate);
        }
        toolContainer.setCertificateMap(certificateMap);
    }
    usersTableModel.setCertificateMap(toolContainer.getCertificateMap());
}
Also used : AssessmentToolContainer(org.olat.modules.assessment.ui.AssessmentToolContainer) AssessedIdentityElementRow(org.olat.modules.assessment.ui.AssessedIdentityElementRow) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) Date(java.util.Date) CertificateLight(org.olat.course.certificate.CertificateLight)

Example 2 with AssessmentToolContainer

use of org.olat.modules.assessment.ui.AssessmentToolContainer in project OpenOLAT by OpenOLAT.

the class STIdentityListCourseNodeController method loadModel.

@Override
protected void loadModel(UserRequest ureq) {
    Map<Long, Date> initialLaunchDates = userInfosMgr.getInitialLaunchDates(getCourseRepositoryEntry().getOlatResource());
    super.loadModel(ureq);
    List<AssessedIdentityElementRow> rows = usersTableModel.getObjects();
    for (AssessedIdentityElementRow row : rows) {
        Date initialLaunchDate = initialLaunchDates.get(row.getIdentityKey());
        row.setInitialCourseLaunchDate(initialLaunchDate);
    }
    AssessmentToolContainer toolContainer = getToolContainer();
    if (toolContainer.getCertificateMap() == null) {
        List<CertificateLight> certificates = certificatesManager.getLastCertificates(getCourseRepositoryEntry().getOlatResource());
        ConcurrentMap<Long, CertificateLight> certificateMap = new ConcurrentHashMap<>();
        for (CertificateLight certificate : certificates) {
            certificateMap.put(certificate.getIdentityKey(), certificate);
        }
        toolContainer.setCertificateMap(certificateMap);
    }
    usersTableModel.setCertificateMap(toolContainer.getCertificateMap());
}
Also used : AssessmentToolContainer(org.olat.modules.assessment.ui.AssessmentToolContainer) AssessedIdentityElementRow(org.olat.modules.assessment.ui.AssessedIdentityElementRow) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) Date(java.util.Date) CertificateLight(org.olat.course.certificate.CertificateLight)

Aggregations

Date (java.util.Date)2 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)2 CertificateLight (org.olat.course.certificate.CertificateLight)2 AssessedIdentityElementRow (org.olat.modules.assessment.ui.AssessedIdentityElementRow)2 AssessmentToolContainer (org.olat.modules.assessment.ui.AssessmentToolContainer)2