use of org.olat.modules.assessment.ui.AssessedIdentityElementRow in project openolat by klemens.
the class IdentityListCourseNodeTableModel method filter.
@Override
public void filter(List<FlexiTableFilter> filters) {
String key = filters == null || filters.isEmpty() || filters.get(0) == null ? null : filters.get(0).getFilter();
if (StringHelper.containsNonWhitespace(key)) {
List<AssessedIdentityElementRow> filteredRows = new ArrayList<>();
if ("passed".equals(key)) {
for (AssessedIdentityElementRow row : backups) {
if (row.getPassed() != null && row.getPassed().booleanValue()) {
filteredRows.add(row);
}
}
} else if ("failed".equals(key)) {
for (AssessedIdentityElementRow row : backups) {
if (row.getPassed() != null && !row.getPassed().booleanValue()) {
filteredRows.add(row);
}
}
} else if (AssessmentEntryStatus.isValueOf(key)) {
for (AssessedIdentityElementRow row : backups) {
if (row.getAssessmentStatus() != null && key.equals(row.getAssessmentStatus().name())) {
filteredRows.add(row);
}
}
} else {
filteredRows.addAll(backups);
}
super.setObjects(filteredRows);
} else {
super.setObjects(backups);
}
}
use of org.olat.modules.assessment.ui.AssessedIdentityElementRow in project openolat by klemens.
the class GTAIdentityListCourseNodeController method loadTasksInModel.
private void loadTasksInModel(TaskList taskList) {
List<Task> tasks = gtaManager.getTasks(taskList, (GTACourseNode) courseNode);
Map<Long, Task> identityToTask = new HashMap<>();
for (Task task : tasks) {
if (task.getIdentity() != null) {
identityToTask.put(task.getIdentity().getKey(), task);
}
}
List<AssessedIdentityElementRow> rows = usersTableModel.getObjects();
for (AssessedIdentityElementRow row : rows) {
Task task = identityToTask.get(row.getIdentityKey());
if (task != null && StringHelper.containsNonWhitespace(task.getTaskName())) {
row.setDetails(task.getTaskName());
}
}
}
use of org.olat.modules.assessment.ui.AssessedIdentityElementRow in project openolat by klemens.
the class STIdentityListCourseNodeController method loadModel.
@Override
protected void loadModel(UserRequest ureq) {
Map<Long, Date> initialLaunchDates = userInfosMgr.getInitialLaunchDates(getCourseRepositoryEntry().getOlatResource());
super.loadModel(ureq);
List<AssessedIdentityElementRow> rows = usersTableModel.getObjects();
for (AssessedIdentityElementRow row : rows) {
Date initialLaunchDate = initialLaunchDates.get(row.getIdentityKey());
row.setInitialCourseLaunchDate(initialLaunchDate);
}
AssessmentToolContainer toolContainer = getToolContainer();
if (toolContainer.getCertificateMap() == null) {
List<CertificateLight> certificates = certificatesManager.getLastCertificates(getCourseRepositoryEntry().getOlatResource());
ConcurrentMap<Long, CertificateLight> certificateMap = new ConcurrentHashMap<>();
for (CertificateLight certificate : certificates) {
certificateMap.put(certificate.getIdentityKey(), certificate);
}
toolContainer.setCertificateMap(certificateMap);
}
usersTableModel.setCertificateMap(toolContainer.getCertificateMap());
}
use of org.olat.modules.assessment.ui.AssessedIdentityElementRow in project OpenOLAT by OpenOLAT.
the class IdentityListCourseNodeController method activate.
@Override
public void activate(UserRequest ureq, List<ContextEntry> entries, StateEntry state) {
String filter = null;
List<FlexiTableFilter> extendedFilters = null;
if (state instanceof AssessedIdentityListState) {
AssessedIdentityListState listState = (AssessedIdentityListState) state;
if (StringHelper.containsNonWhitespace(listState.getFilter())) {
filter = listState.getFilter();
}
extendedFilters = listState.getExtendedFilters();
}
tableEl.setSelectedFilterKey(filter);
if (extendedFilters != null) {
tableEl.setSelectedExtendedFilters(extendedFilters);
}
loadModel(ureq);
if (entries != null && entries.size() > 0) {
ContextEntry entry = entries.get(0);
String resourceType = entry.getOLATResourceable().getResourceableTypeName();
if ("Identity".equals(resourceType)) {
Long identityKey = entries.get(0).getOLATResourceable().getResourceableId();
for (int i = usersTableModel.getRowCount(); i-- > 0; ) {
AssessedIdentityElementRow row = usersTableModel.getObject(i);
if (row.getIdentityKey().equals(identityKey)) {
Controller ctrl = doSelect(ureq, row);
if (ctrl instanceof Activateable2) {
List<ContextEntry> subEntries = entries.subList(1, entries.size());
((Activateable2) ctrl).activate(ureq, subEntries, entry.getTransientState());
}
}
}
}
}
}
use of org.olat.modules.assessment.ui.AssessedIdentityElementRow in project OpenOLAT by OpenOLAT.
the class IdentityListCourseNodeController method doConfirmVisible.
private void doConfirmVisible(UserRequest ureq) {
Set<Integer> selections = tableEl.getMultiSelectedIndex();
List<AssessedIdentityElementRow> rows = new ArrayList<>(selections.size());
for (Integer i : selections) {
AssessedIdentityElementRow row = usersTableModel.getObject(i.intValue());
if (row != null) {
rows.add(row);
}
}
if (rows == null || rows.isEmpty()) {
showWarning("warning.bulk.done");
} else {
changeUserVisibilityCtrl = new ConfirmUserVisibilityController(ureq, getWindowControl(), rows);
listenTo(changeUserVisibilityCtrl);
String title = translate("change.visibility.title");
cmc = new CloseableModalController(getWindowControl(), "close", changeUserVisibilityCtrl.getInitialComponent(), true, title);
listenTo(cmc);
cmc.activate();
}
}
Aggregations