use of org.olat.course.assessment.model.SearchAssessedIdentityParams in project OpenOLAT by OpenOLAT.
the class AssessmentToReviewSmallController method loadModel.
private void loadModel() {
SearchAssessedIdentityParams params = new SearchAssessedIdentityParams(courseEntry, null, null, assessmentCallback);
List<AssessmentEntry> entries = assessmentToolManager.getAssessmentEntries(getIdentity(), params, AssessmentEntryStatus.inReview);
List<UserToReviewRow> rows = new ArrayList<>();
Map<Long, UserToReviewRow> identityKeyToRow = new HashMap<>();
for (AssessmentEntry entry : entries) {
Identity assessedIdentity = entry.getIdentity();
if (identityKeyToRow.containsKey(assessedIdentity.getKey())) {
identityKeyToRow.get(assessedIdentity.getKey()).getSubIndents().add(entry.getSubIdent());
} else {
UserToReviewRow row = new UserToReviewRow(entry.getIdentity(), userPropertyHandlers, getLocale());
row.getSubIndents().add(entry.getSubIdent());
rows.add(row);
identityKeyToRow.put(assessedIdentity.getKey(), row);
}
}
usersTableModel.setObjects(rows);
tableEl.reset();
}
use of org.olat.course.assessment.model.SearchAssessedIdentityParams in project OpenOLAT by OpenOLAT.
the class IdentityListCourseNodeController method getSearchParameters.
protected SearchAssessedIdentityParams getSearchParameters() {
SearchAssessedIdentityParams params = new SearchAssessedIdentityParams(courseEntry, courseNode.getIdent(), referenceEntry, assessmentCallback);
List<FlexiTableFilter> filters = tableEl.getSelectedFilters();
List<FlexiTableFilter> extendedFilters = tableEl.getSelectedExtendedFilters();
List<AssessmentEntryStatus> assessmentStatus = null;
if (filters != null && filters.size() > 0) {
assessmentStatus = new ArrayList<>(filters.size());
for (FlexiTableFilter filter : filters) {
if ("passed".equals(filter.getFilter())) {
params.setPassed(true);
} else if ("failed".equals(filter.getFilter())) {
params.setFailed(true);
} else if (AssessmentEntryStatus.isValueOf(filter.getFilter())) {
assessmentStatus.add(AssessmentEntryStatus.valueOf(filter.getFilter()));
}
}
}
params.setAssessmentStatus(assessmentStatus);
List<Long> businessGroupKeys = null;
if (group != null) {
businessGroupKeys = Collections.singletonList(group.getKey());
} else if (extendedFilters != null && extendedFilters.size() > 0) {
businessGroupKeys = new ArrayList<>(extendedFilters.size());
for (FlexiTableFilter extendedFilter : extendedFilters) {
if (StringHelper.isLong(extendedFilter.getFilter())) {
businessGroupKeys.add(Long.parseLong(extendedFilter.getFilter()));
}
}
}
params.setBusinessGroupKeys(businessGroupKeys);
params.setSearchString(tableEl.getQuickSearchString());
return params;
}
use of org.olat.course.assessment.model.SearchAssessedIdentityParams in project OpenOLAT by OpenOLAT.
the class IdentityListCourseNodeController method getOptions.
protected AssessmentToolOptions getOptions() {
SearchAssessedIdentityParams params = getSearchParameters();
AssessmentToolOptions options = new AssessmentToolOptions();
options.setAdmin(assessmentCallback.isAdmin());
if (group == null) {
if (assessmentCallback.isAdmin()) {
options.setNonMembers(params.isNonMembers());
} else {
List<Identity> assessedIdentities = assessmentToolManager.getAssessedIdentities(getIdentity(), params);
options.setIdentities(assessedIdentities);
fillAlternativeToAssessableIdentityList(options, params);
}
} else {
options.setGroup(group);
}
return options;
}
use of org.olat.course.assessment.model.SearchAssessedIdentityParams in project OpenOLAT by OpenOLAT.
the class AssessedBusinessGroupCourseNodeListController method loadModel.
protected void loadModel() {
if (assessmentCallback.canAssessBusinessGoupMembers()) {
RepositoryEntry testEntry = null;
if (courseNode.needsReferenceToARepositoryEntry()) {
testEntry = courseNode.getReferencedRepositoryEntry();
}
SearchAssessedIdentityParams params = new SearchAssessedIdentityParams(courseEntry, courseNode.getIdent(), testEntry, assessmentCallback);
if (assessmentCallback.getCoachedGroups() != null) {
List<Long> groupKeys = assessmentCallback.getCoachedGroups().stream().map(c -> c.getKey()).collect(Collectors.toList());
params.setBusinessGroupKeys(groupKeys);
}
List<AssessedBusinessGroup> rows = assessmentToolManager.getBusinessGroupStatistics(getIdentity(), params);
Set<Long> keys = rows.stream().map(c -> c.getKey()).collect(Collectors.toSet());
List<BusinessGroup> groups;
if (assessmentCallback.isAdmin()) {
CourseEnvironment courseEnv = CourseFactory.loadCourse(courseEntry).getCourseEnvironment();
groups = courseEnv.getCourseGroupManager().getAllBusinessGroups();
} else if (assessmentCallback.getCoachedGroups() != null) {
groups = assessmentCallback.getCoachedGroups();
} else {
groups = Collections.emptyList();
}
for (BusinessGroup group : groups) {
if (!keys.contains(group.getKey())) {
rows.add(new AssessedBusinessGroup(group.getKey(), group.getName(), 0.0d, 0, 0, 0, 0));
}
}
tableModel.setObjects(rows);
tableEl.reset();
tableEl.reloadData();
}
}
use of org.olat.course.assessment.model.SearchAssessedIdentityParams in project OpenOLAT by OpenOLAT.
the class AssessedIdentityListProvider method getResult.
@Override
public void getResult(String searchValue, ListReceiver receiver) {
SearchAssessedIdentityParams params = new SearchAssessedIdentityParams(courseEntry, subIdent, referenceEntry, assessmentCallback);
params.setSearchString(searchValue);
int maxEntries = MAX_ENTRIES;
List<IdentityShort> res = assessmentToolManager.getShortAssessedIdentities(coach, params, maxEntries);
boolean hasMore = false;
for (Iterator<IdentityShort> it_res = res.iterator(); (hasMore = it_res.hasNext()) && maxEntries > 0; ) {
maxEntries--;
IdentityShort ident = it_res.next();
String key = ident.getKey().toString();
String displayKey = ident.getName();
String displayText = userManager.getUserDisplayName(ident);
receiver.addEntry(key, displayKey, displayText, CSSHelper.CSS_CLASS_USER);
}
if (hasMore) {
receiver.addEntry(".....", ".....");
}
}
Aggregations