use of org.olat.course.assessment.model.SearchAssessedIdentityParams in project OpenOLAT by OpenOLAT.
the class AssessmentStatisticsSmallController method updateStatistics.
public void updateStatistics() {
SearchAssessedIdentityParams params = new SearchAssessedIdentityParams(testEntry, null, testEntry, assessmentCallback);
numOfAssessedIdentities = assessmentToolManager.getNumberOfAssessedIdentities(getIdentity(), params);
mainVC.contextPut("numOfAssessedIdentities", numOfAssessedIdentities);
membersStatistics = assessmentToolManager.getNumberOfParticipants(getIdentity(), params);
mainVC.contextPut("numOfParticipants", membersStatistics.getNumOfParticipants());
if (assessmentCallback.canAssessNonMembers()) {
mainVC.contextPut("numOfOtherUsers", membersStatistics.getNumOfOtherUsers());
}
AssessmentStatistics stats = assessmentToolManager.getStatistics(getIdentity(), params);
mainVC.contextPut("scoreAverage", AssessmentHelper.getRoundedScore(stats.getAverageScore()));
numOfPassed = stats.getCountPassed();
mainVC.contextPut("numOfPassed", numOfPassed);
int total = membersStatistics.getTotal();
int percentPassed = total <= 0 ? 0 : Math.round(100.0f * (stats.getCountPassed() / total));
mainVC.contextPut("percentPassed", percentPassed);
numOfFailed = stats.getCountFailed();
mainVC.contextPut("numOfFailed", numOfFailed);
int percentFailed = total <= 0 ? 0 : Math.round(100.0f * (stats.getCountFailed() / total));
mainVC.contextPut("percentFailed", percentFailed);
int numOfParticipantLaunches = membersStatistics.getNumOfParticipantsLoggedIn();
mainVC.contextPut("numOfParticipantLaunches", numOfParticipantLaunches);
if (assessmentCallback.canAssessNonMembers()) {
mainVC.contextPut("numOfOtherUserLaunches", membersStatistics.getLoggedIn());
}
}
use of org.olat.course.assessment.model.SearchAssessedIdentityParams in project openolat by klemens.
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 klemens.
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 klemens.
the class AssessmentCourseStatisticsSmallController method updateStatistics.
public void updateStatistics() {
ICourse course = CourseFactory.loadCourse(courseEntry);
String rootNodeIdent = course.getRunStructure().getRootNode().getIdent();
SearchAssessedIdentityParams params = new SearchAssessedIdentityParams(courseEntry, rootNodeIdent, null, assessmentCallback);
numOfAssessedIdentities = assessmentToolManager.getNumberOfAssessedIdentities(getIdentity(), params);
mainVC.contextPut("numOfAssessedIdentities", numOfAssessedIdentities);
memberStatistics = assessmentToolManager.getNumberOfParticipants(getIdentity(), params);
mainVC.contextPut("numOfParticipants", memberStatistics.getNumOfParticipants());
if (assessmentCallback.canAssessNonMembers()) {
mainVC.contextPut("numOfOtherUsers", memberStatistics.getNumOfOtherUsers());
}
AssessmentStatistics stats = assessmentToolManager.getStatistics(getIdentity(), params);
mainVC.contextPut("scoreAverage", AssessmentHelper.getRoundedScore(stats.getAverageScore()));
numOfPassed = stats.getCountPassed();
mainVC.contextPut("numOfPassed", numOfPassed);
int total = memberStatistics.getTotal();
int percentPassed = total == 0 ? 0 : Math.round(100.0f * (stats.getCountPassed() / total));
mainVC.contextPut("percentPassed", percentPassed);
numOfFailed = stats.getCountFailed();
mainVC.contextPut("numOfFailed", numOfFailed);
int percentFailed = total == 0 ? 0 : Math.round(100.0f * (stats.getCountFailed() / total));
mainVC.contextPut("percentFailed", percentFailed);
int numOfParticipantLaunches = memberStatistics.getNumOfParticipantsLoggedIn();
mainVC.contextPut("numOfParticipantLaunches", numOfParticipantLaunches);
if (assessmentCallback.canAssessNonMembers()) {
int numOfOtherUserLaunches = memberStatistics.getLoggedIn();
mainVC.contextPut("numOfOtherUserLaunches", numOfOtherUserLaunches);
}
}
use of org.olat.course.assessment.model.SearchAssessedIdentityParams in project openolat by klemens.
the class AssessedIdentityListController method updateModel.
protected void updateModel(String searchString, List<FlexiTableFilter> filters, List<FlexiTableFilter> extendedFilters) {
SearchAssessedIdentityParams params = new SearchAssessedIdentityParams(testEntry, null, testEntry, assessmentCallback);
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 (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(searchString);
List<Identity> assessedIdentities = assessmentToolManager.getAssessedIdentities(getIdentity(), params);
List<AssessmentEntry> assessmentEntries = assessmentToolManager.getAssessmentEntries(getIdentity(), params, null);
Map<Long, AssessmentEntry> entryMap = new HashMap<>();
assessmentEntries.stream().filter((entry) -> entry.getIdentity() != null).forEach((entry) -> entryMap.put(entry.getIdentity().getKey(), entry));
Map<Long, Date> initialLaunchDates = userInfosMgr.getInitialLaunchDates(testEntry.getOlatResource());
List<AssessedIdentityElementRow> rows = new ArrayList<>(assessedIdentities.size());
for (Identity assessedIdentity : assessedIdentities) {
AssessmentEntry entry = entryMap.get(assessedIdentity.getKey());
AssessedIdentityElementRow row = new AssessedIdentityElementRow(assessedIdentity, entry, null, null, userPropertyHandlers, getLocale());
row.setInitialCourseLaunchDate(initialLaunchDates.get(assessedIdentity.getKey()));
rows.add(row);
}
usersTableModel.setObjects(rows);
if (filters != null && filters.size() > 0 && filters.get(0) != null) {
usersTableModel.filter(Collections.singletonList(filters.get(0)));
}
tableEl.reloadData();
searchParams = params;
updateTools(assessedIdentities);
}
Aggregations