use of org.olat.course.nodes.iq.QTI21IdentityListCourseNodeToolsController.AssessmentTestSessionDetailsComparator in project OpenOLAT by OpenOLAT.
the class IQIdentityListCourseNodeController method doConfirmExtraTime.
private void doConfirmExtraTime(UserRequest ureq) {
List<IdentityRef> identities = getSelectedIdentities();
if (identities == null || identities.isEmpty()) {
showWarning("warning.users.extra.time");
return;
}
List<AssessmentTestSession> testSessions = new ArrayList<>(identities.size());
for (IdentityRef identity : identities) {
List<AssessmentTestSessionStatistics> sessionsStatistics = qtiService.getAssessmentTestSessionsStatistics(getCourseRepositoryEntry(), courseNode.getIdent(), identity);
if (!sessionsStatistics.isEmpty()) {
if (sessionsStatistics.size() > 1) {
Collections.sort(sessionsStatistics, new AssessmentTestSessionDetailsComparator());
}
AssessmentTestSession lastSession = sessionsStatistics.get(0).getTestSession();
if (lastSession != null && lastSession.getFinishTime() == null) {
testSessions.add(lastSession);
}
}
}
if (testSessions == null || testSessions.isEmpty()) {
showWarning("warning.users.extra.time");
return;
}
extraTimeCtrl = new ConfirmExtraTimeController(ureq, getWindowControl(), getCourseRepositoryEntry(), testSessions);
listenTo(extraTimeCtrl);
String title = translate("extra.time");
cmc = new CloseableModalController(getWindowControl(), null, extraTimeCtrl.getInitialComponent(), true, title, true);
listenTo(cmc);
cmc.activate();
}
use of org.olat.course.nodes.iq.QTI21IdentityListCourseNodeToolsController.AssessmentTestSessionDetailsComparator in project openolat by klemens.
the class IQIdentityListCourseNodeController method doConfirmExtraTime.
private void doConfirmExtraTime(UserRequest ureq) {
List<IdentityRef> identities = getSelectedIdentities();
if (identities == null || identities.isEmpty()) {
showWarning("warning.users.extra.time");
return;
}
List<AssessmentTestSession> testSessions = new ArrayList<>(identities.size());
for (IdentityRef identity : identities) {
List<AssessmentTestSessionStatistics> sessionsStatistics = qtiService.getAssessmentTestSessionsStatistics(getCourseRepositoryEntry(), courseNode.getIdent(), identity);
if (!sessionsStatistics.isEmpty()) {
if (sessionsStatistics.size() > 1) {
Collections.sort(sessionsStatistics, new AssessmentTestSessionDetailsComparator());
}
AssessmentTestSession lastSession = sessionsStatistics.get(0).getTestSession();
if (lastSession != null && lastSession.getFinishTime() == null) {
testSessions.add(lastSession);
}
}
}
if (testSessions == null || testSessions.isEmpty()) {
showWarning("warning.users.extra.time");
return;
}
extraTimeCtrl = new ConfirmExtraTimeController(ureq, getWindowControl(), getCourseRepositoryEntry(), testSessions);
listenTo(extraTimeCtrl);
String title = translate("extra.time");
cmc = new CloseableModalController(getWindowControl(), null, extraTimeCtrl.getInitialComponent(), true, title, true);
listenTo(cmc);
cmc.activate();
}
Aggregations