use of org.olat.modules.coach.model.EfficiencyStatementEntry in project OpenOLAT by OpenOLAT.
the class StudentCoursesController 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 ("RepositoryEntry".equals(ores.getResourceableTypeName())) {
Long entryKey = ores.getResourceableId();
for (EfficiencyStatementEntry entry : model.getObjects()) {
if (entryKey.equals(entry.getCourse().getKey())) {
selectDetails(ureq, entry);
statementCtrl.activate(ureq, entries.subList(1, entries.size()), ce.getTransientState());
break;
}
}
}
}
use of org.olat.modules.coach.model.EfficiencyStatementEntry in project OpenOLAT by OpenOLAT.
the class StudentCoursesController method nextEntry.
private void nextEntry(UserRequest ureq) {
EfficiencyStatementEntry currentEntry = statementCtrl.getEntry();
int nextIndex = model.getObjects().indexOf(currentEntry) + 1;
if (nextIndex < 0 || nextIndex >= model.getRowCount()) {
nextIndex = 0;
}
EfficiencyStatementEntry nextEntry = model.getObject(nextIndex);
selectDetails(ureq, nextEntry);
}
use of org.olat.modules.coach.model.EfficiencyStatementEntry in project OpenOLAT by OpenOLAT.
the class StudentCoursesController 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();
EfficiencyStatementEntry selectedRow = model.getObject(se.getIndex());
if ("select".equals(cmd)) {
selectDetails(ureq, selectedRow);
}
}
}
super.formInnerEvent(ureq, source, event);
}
use of org.olat.modules.coach.model.EfficiencyStatementEntry in project OpenOLAT by OpenOLAT.
the class CoachingServiceImpl method getCourse.
@Override
public List<EfficiencyStatementEntry> getCourse(Identity coach, RepositoryEntry entry, List<UserPropertyHandler> userPropertyHandlers, Locale locale) {
List<Identity> students = coachingDao.getStudents(coach, entry);
List<UserEfficiencyStatement> statements = efficiencyStatementManager.getUserEfficiencyStatementLight(entry);
Map<Identity, UserEfficiencyStatement> identityToStatements = new HashMap<>();
for (UserEfficiencyStatement statement : statements) {
identityToStatements.put(statement.getIdentity(), statement);
}
List<EfficiencyStatementEntry> entries = new ArrayList<>(students.size());
for (Identity student : students) {
UserEfficiencyStatement statement = identityToStatements.get(student);
entries.add(new EfficiencyStatementEntry(student, entry, statement, userPropertyHandlers, locale));
}
return entries;
}
use of org.olat.modules.coach.model.EfficiencyStatementEntry in project OpenOLAT by OpenOLAT.
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;
}
Aggregations