Search in sources :

Example 36 with EfficiencyStatementEntry

use of org.olat.modules.coach.model.EfficiencyStatementEntry in project openolat by klemens.

the class GroupController method activate.

@Override
public void activate(UserRequest ureq, List<ContextEntry> entries, StateEntry state) {
    if (entries == null || entries.isEmpty())
        return;
    ContextEntry ce = entries.get(0);
    OLATResourceable ores = ce.getOLATResourceable();
    if ("Identity".equals(ores.getResourceableTypeName())) {
        Long identityKey = ores.getResourceableId();
        for (EfficiencyStatementEntry row : model.getObjects()) {
            if (identityKey.equals(row.getIdentityKey())) {
                selectDetails(ureq, row);
                statementCtrl.activate(ureq, entries.subList(1, entries.size()), ce.getTransientState());
                break;
            }
        }
    }
}
Also used : OLATResourceable(org.olat.core.id.OLATResourceable) EfficiencyStatementEntry(org.olat.modules.coach.model.EfficiencyStatementEntry) ContextEntry(org.olat.core.id.context.ContextEntry)

Example 37 with EfficiencyStatementEntry

use of org.olat.modules.coach.model.EfficiencyStatementEntry in project openolat by klemens.

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 38 with EfficiencyStatementEntry

use of org.olat.modules.coach.model.EfficiencyStatementEntry in project openolat by klemens.

the class CourseController method previousEntry.

private void previousEntry(UserRequest ureq) {
    EfficiencyStatementEntry currentEntry = statementCtrl.getEntry();
    int previousIndex = model.getObjects().indexOf(currentEntry) - 1;
    if (previousIndex < 0 || previousIndex >= model.getRowCount()) {
        previousIndex = model.getRowCount() - 1;
    }
    EfficiencyStatementEntry previousEntry = model.getObject(previousIndex);
    doSelectDetails(ureq, previousEntry);
}
Also used : EfficiencyStatementEntry(org.olat.modules.coach.model.EfficiencyStatementEntry)

Example 39 with EfficiencyStatementEntry

use of org.olat.modules.coach.model.EfficiencyStatementEntry in project openolat by klemens.

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 40 with EfficiencyStatementEntry

use of org.olat.modules.coach.model.EfficiencyStatementEntry in project openolat by klemens.

the class CoachingServiceImpl method getEfficencyStatements.

@Override
public List<EfficiencyStatementEntry> getEfficencyStatements(Identity student, List<RepositoryEntry> courses, List<UserPropertyHandler> userPropertyHandlers, Locale locale) {
    List<UserEfficiencyStatement> statements = efficiencyStatementManager.getUserEfficiencyStatementLight(student, courses);
    Map<Long, UserEfficiencyStatement> courseKeyToStatements = new HashMap<>();
    for (UserEfficiencyStatement statement : statements) {
        courseKeyToStatements.put(statement.getCourseRepoKey(), statement);
    }
    List<EfficiencyStatementEntry> entries = new ArrayList<>(courses.size());
    for (RepositoryEntry course : courses) {
        UserEfficiencyStatement statement = courseKeyToStatements.get(course.getKey());
        entries.add(new EfficiencyStatementEntry(student, course, statement, userPropertyHandlers, locale));
    }
    return entries;
}
Also used : HashMap(java.util.HashMap) UserEfficiencyStatement(org.olat.course.assessment.UserEfficiencyStatement) ArrayList(java.util.ArrayList) RepositoryEntry(org.olat.repository.RepositoryEntry) EfficiencyStatementEntry(org.olat.modules.coach.model.EfficiencyStatementEntry)

Aggregations

EfficiencyStatementEntry (org.olat.modules.coach.model.EfficiencyStatementEntry)40 RepositoryEntry (org.olat.repository.RepositoryEntry)8 ArrayList (java.util.ArrayList)6 HashMap (java.util.HashMap)6 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)6 SelectionEvent (org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent)6 Identity (org.olat.core.id.Identity)6 OLATResourceable (org.olat.core.id.OLATResourceable)6 ContextEntry (org.olat.core.id.context.ContextEntry)6 UserEfficiencyStatement (org.olat.course.assessment.UserEfficiencyStatement)6 CertificateLight (org.olat.course.certificate.CertificateLight)6 IdentityResourceKey (org.olat.modules.coach.model.IdentityResourceKey)6 Test (org.junit.Test)2 IdentityRepositoryEntryKey (org.olat.modules.coach.model.IdentityRepositoryEntryKey)2 LectureBlockStatistics (org.olat.modules.lecture.model.LectureBlockStatistics)2