Search in sources :

Example 11 with CertificateLight

use of org.olat.course.certificate.CertificateLight 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)

Example 12 with CertificateLight

use of org.olat.course.certificate.CertificateLight in project OpenOLAT by OpenOLAT.

the class CourseController method loadModel.

public List<EfficiencyStatementEntry> loadModel() {
    List<EfficiencyStatementEntry> entries = coachingService.getCourse(getIdentity(), course, userPropertyHandlers, getLocale());
    Long resourceKey = course.getOlatResource().getKey();
    List<CertificateLight> certificates = certificatesManager.getLastCertificates(course.getOlatResource());
    ConcurrentMap<IdentityResourceKey, CertificateLight> certificateMap = new ConcurrentHashMap<>();
    for (CertificateLight certificate : certificates) {
        IdentityResourceKey key = new IdentityResourceKey(certificate.getIdentityKey(), resourceKey);
        certificateMap.put(key, certificate);
    }
    model.setObjects(entries, certificateMap);
    tableEl.reloadData();
    tableEl.reset();
    return entries;
}
Also used : EfficiencyStatementEntry(org.olat.modules.coach.model.EfficiencyStatementEntry) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) CertificateLight(org.olat.course.certificate.CertificateLight) IdentityResourceKey(org.olat.modules.coach.model.IdentityResourceKey)

Example 13 with CertificateLight

use of org.olat.course.certificate.CertificateLight in project OpenOLAT by OpenOLAT.

the class CourseController method updateCertificate.

private void updateCertificate(Long certificateKey) {
    CertificateLight certificate = certificatesManager.getCertificateLightById(certificateKey);
    model.putCertificate(certificate);
}
Also used : CertificateLight(org.olat.course.certificate.CertificateLight)

Example 14 with CertificateLight

use of org.olat.course.certificate.CertificateLight in project OpenOLAT by OpenOLAT.

the class StudentCoursesController method loadModel.

private List<EfficiencyStatementEntry> loadModel() {
    List<RepositoryEntry> courses = fullAccess ? coachingService.getUserCourses(student) : coachingService.getStudentsCourses(getIdentity(), student);
    List<EfficiencyStatementEntry> statements = coachingService.getEfficencyStatements(student, courses, userPropertyHandlers, getLocale());
    List<CertificateLight> certificates = certificatesManager.getLastCertificates(student);
    ConcurrentMap<IdentityResourceKey, CertificateLight> certificateMap = new ConcurrentHashMap<>();
    for (CertificateLight certificate : certificates) {
        IdentityResourceKey key = new IdentityResourceKey(student.getKey(), certificate.getOlatResourceKey());
        certificateMap.put(key, certificate);
    }
    ConcurrentMap<IdentityRepositoryEntryKey, LectureBlockStatistics> lecturesMap = new ConcurrentHashMap<>();
    if (lectureModule.isEnabled()) {
        List<LectureBlockStatistics> lectureStats = lectureService.getParticipantLecturesStatistics(student);
        for (LectureBlockStatistics lectureStat : lectureStats) {
            IdentityRepositoryEntryKey key = new IdentityRepositoryEntryKey(student.getKey(), lectureStat.getRepoKey());
            lecturesMap.put(key, lectureStat);
        }
    }
    model.setObjects(statements, certificateMap, lecturesMap);
    tableEl.reset();
    tableEl.reloadData();
    return statements;
}
Also used : RepositoryEntry(org.olat.repository.RepositoryEntry) EfficiencyStatementEntry(org.olat.modules.coach.model.EfficiencyStatementEntry) LectureBlockStatistics(org.olat.modules.lecture.model.LectureBlockStatistics) CertificateLight(org.olat.course.certificate.CertificateLight) IdentityResourceKey(org.olat.modules.coach.model.IdentityResourceKey) IdentityRepositoryEntryKey(org.olat.modules.coach.model.IdentityRepositoryEntryKey) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap)

Example 15 with CertificateLight

use of org.olat.course.certificate.CertificateLight in project OpenOLAT by OpenOLAT.

the class StudentCoursesController method updateCertificate.

private void updateCertificate(Long certificateKey) {
    CertificateLight certificate = certificatesManager.getCertificateLightById(certificateKey);
    model.putCertificate(certificate);
}
Also used : CertificateLight(org.olat.course.certificate.CertificateLight)

Aggregations

CertificateLight (org.olat.course.certificate.CertificateLight)24 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)8 EfficiencyStatementEntry (org.olat.modules.coach.model.EfficiencyStatementEntry)6 IdentityResourceKey (org.olat.modules.coach.model.IdentityResourceKey)6 RepositoryEntry (org.olat.repository.RepositoryEntry)6 Test (org.junit.Test)4 Identity (org.olat.core.id.Identity)4 Certificate (org.olat.course.certificate.Certificate)4 CertificateInfos (org.olat.course.certificate.model.CertificateInfos)4 CertificateAndEfficiencyStatement (org.olat.course.certificate.ui.CertificateAndEfficiencyStatementListModel.CertificateAndEfficiencyStatement)4 ArrayList (java.util.ArrayList)2 Date (java.util.Date)2 HashMap (java.util.HashMap)2 IdentityRef (org.olat.basesecurity.IdentityRef)2 IdentityRefImpl (org.olat.basesecurity.model.IdentityRefImpl)2 UserEfficiencyStatementLight (org.olat.course.assessment.model.UserEfficiencyStatementLight)2 CertificateLightPack (org.olat.course.certificate.model.CertificateLightPack)2 AssessedIdentityElementRow (org.olat.modules.assessment.ui.AssessedIdentityElementRow)2 AssessmentToolContainer (org.olat.modules.assessment.ui.AssessmentToolContainer)2 IdentityRepositoryEntryKey (org.olat.modules.coach.model.IdentityRepositoryEntryKey)2