Search in sources :

Example 36 with StudentStatEntry

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

the class CoachingLargeTest method getUsersStatistics.

@Test
public void getUsersStatistics() {
    SearchCoachedIdentityParams params = new SearchCoachedIdentityParams();
    params.setLogin(aStudent.getName());
    List<StudentStatEntry> statEntries = coachingService.getUsersStatistics(params, userPropertyHandlers);
    Assert.assertNotNull(statEntries);
    Assert.assertEquals(1, statEntries.size());
    StudentStatEntry statEntry = statEntries.get(0);
    Assert.assertEquals(aStudent.getKey(), statEntry.getIdentityKey());
    Assert.assertEquals(studentToCourseMap.get(aStudent).size(), statEntry.getCountRepo());
}
Also used : SearchCoachedIdentityParams(org.olat.modules.coach.model.SearchCoachedIdentityParams) StudentStatEntry(org.olat.modules.coach.model.StudentStatEntry) Test(org.junit.Test)

Example 37 with StudentStatEntry

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

the class StudentListController method formInnerEvent.

@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
    if (tableEl == source) {
        if (event instanceof SelectionEvent) {
            SelectionEvent se = (SelectionEvent) event;
            String cmd = se.getCommand();
            StudentStatEntry selectedRow = model.getObject(se.getIndex());
            if ("select".equals(cmd)) {
                selectStudent(ureq, selectedRow);
            }
        } else if (event instanceof FlexiTableSearchEvent) {
            FlexiTableSearchEvent ftse = (FlexiTableSearchEvent) event;
            String searchString = ftse.getSearch();
            model.search(searchString);
            tableEl.reset();
            tableEl.reloadData();
        }
    }
    super.formInnerEvent(ureq, source, event);
}
Also used : SelectionEvent(org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent) FlexiTableSearchEvent(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableSearchEvent) StudentStatEntry(org.olat.modules.coach.model.StudentStatEntry)

Example 38 with StudentStatEntry

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

the class StudentListController 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 (StudentStatEntry entry : model.getObjects()) {
            if (identityKey.equals(entry.getIdentityKey())) {
                selectStudent(ureq, entry).activate(ureq, entries.subList(1, entries.size()), ce.getTransientState());
                break;
            }
        }
    }
}
Also used : OLATResourceable(org.olat.core.id.OLATResourceable) ContextEntry(org.olat.core.id.context.ContextEntry) StudentStatEntry(org.olat.modules.coach.model.StudentStatEntry)

Example 39 with StudentStatEntry

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

the class StudentListController method previousStudent.

protected void previousStudent(UserRequest ureq) {
    StudentStatEntry currentEntry = studentCtrl.getEntry();
    int previousIndex = model.getObjects().indexOf(currentEntry) - 1;
    if (previousIndex < 0 || previousIndex >= model.getRowCount()) {
        previousIndex = model.getRowCount() - 1;
    }
    StudentStatEntry previousEntry = model.getObject(previousIndex);
    selectStudent(ureq, previousEntry);
}
Also used : StudentStatEntry(org.olat.modules.coach.model.StudentStatEntry)

Example 40 with StudentStatEntry

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

the class UserListController method previousStudent.

protected void previousStudent(UserRequest ureq) {
    StudentStatEntry currentEntry = studentCtrl.getEntry();
    int previousIndex = model.getObjects().indexOf(currentEntry) - 1;
    if (previousIndex < 0 || previousIndex >= model.getRowCount()) {
        previousIndex = model.getRowCount() - 1;
    }
    StudentStatEntry previousEntry = model.getObject(previousIndex);
    selectStudent(ureq, previousEntry);
}
Also used : StudentStatEntry(org.olat.modules.coach.model.StudentStatEntry)

Aggregations

StudentStatEntry (org.olat.modules.coach.model.StudentStatEntry)46 Test (org.junit.Test)16 File (java.io.File)14 URL (java.net.URL)14 Identity (org.olat.core.id.Identity)14 BusinessGroup (org.olat.group.BusinessGroup)14 CoachingLargeTest (org.olat.modules.coach.CoachingLargeTest)14 RepositoryEntry (org.olat.repository.RepositoryEntry)14 UserPropertyHandler (org.olat.user.propertyhandlers.UserPropertyHandler)14 CourseStatEntry (org.olat.modules.coach.model.CourseStatEntry)12 GroupStatEntry (org.olat.modules.coach.model.GroupStatEntry)12 Date (java.util.Date)10 HashMap (java.util.HashMap)10 NativeQueryBuilder (org.olat.core.commons.persistence.NativeQueryBuilder)10 Map (java.util.Map)4 Query (javax.persistence.Query)4 SelectionEvent (org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent)4 SearchCoachedIdentityParams (org.olat.modules.coach.model.SearchCoachedIdentityParams)4 ArrayList (java.util.ArrayList)2 FlexiTableSearchEvent (org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableSearchEvent)2