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());
}
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);
}
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;
}
}
}
}
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);
}
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);
}
Aggregations