Search in sources :

Example 16 with SearchAssessedIdentityParams

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());
    }
}
Also used : SearchAssessedIdentityParams(org.olat.course.assessment.model.SearchAssessedIdentityParams) AssessmentStatistics(org.olat.course.assessment.model.AssessmentStatistics)

Example 17 with SearchAssessedIdentityParams

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;
}
Also used : SearchAssessedIdentityParams(org.olat.course.assessment.model.SearchAssessedIdentityParams) AssessmentToolOptions(org.olat.modules.assessment.AssessmentToolOptions) Identity(org.olat.core.id.Identity)

Example 18 with SearchAssessedIdentityParams

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();
}
Also used : HashMap(java.util.HashMap) SearchAssessedIdentityParams(org.olat.course.assessment.model.SearchAssessedIdentityParams) ArrayList(java.util.ArrayList) Identity(org.olat.core.id.Identity) AssessmentEntry(org.olat.modules.assessment.AssessmentEntry)

Example 19 with SearchAssessedIdentityParams

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);
    }
}
Also used : SearchAssessedIdentityParams(org.olat.course.assessment.model.SearchAssessedIdentityParams) ICourse(org.olat.course.ICourse) AssessmentStatistics(org.olat.course.assessment.model.AssessmentStatistics)

Example 20 with SearchAssessedIdentityParams

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);
}
Also used : FlexiTableElement(org.olat.core.gui.components.form.flexible.elements.FlexiTableElement) Util(org.olat.core.util.Util) RepositoryHandlerFactory(org.olat.repository.handlers.RepositoryHandlerFactory) Activateable2(org.olat.core.gui.control.generic.dtabs.Activateable2) AssessmentToolManager(org.olat.course.assessment.AssessmentToolManager) Date(java.util.Date) UserCourseInformationsManager(org.olat.course.assessment.manager.UserCourseInformationsManager) DefaultFlexiColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel) Autowired(org.springframework.beans.factory.annotation.Autowired) RepositoyUIFactory(org.olat.repository.ui.RepositoyUIFactory) AssessmentToolOptions(org.olat.modules.assessment.AssessmentToolOptions) RepositoryHandler(org.olat.repository.handlers.RepositoryHandler) FlexiTableFilter(org.olat.core.gui.components.form.flexible.elements.FlexiTableFilter) Map(java.util.Map) FlexiTableColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel) AssessmentModule(org.olat.course.assessment.AssessmentModule) WindowControl(org.olat.core.gui.control.WindowControl) UserPropertyHandler(org.olat.user.propertyhandlers.UserPropertyHandler) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) IdentityCourseElementCols(org.olat.modules.assessment.ui.AssessedIdentityListTableModel.IdentityCourseElementCols) Component(org.olat.core.gui.components.Component) LinkFactory(org.olat.core.gui.components.link.LinkFactory) AssessmentEntryStatus(org.olat.modules.assessment.model.AssessmentEntryStatus) SelectionEvent(org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent) List(java.util.List) Align(org.olat.core.gui.components.stack.TooledStackedPanel.Align) Identity(org.olat.core.id.Identity) BaseSecurity(org.olat.basesecurity.BaseSecurity) FormLayoutContainer(org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer) TooledStackedPanel(org.olat.core.gui.components.stack.TooledStackedPanel) FormEvent(org.olat.core.gui.components.form.flexible.impl.FormEvent) HashMap(java.util.HashMap) RepositoryEntry(org.olat.repository.RepositoryEntry) FormItem(org.olat.core.gui.components.form.flexible.FormItem) ArrayList(java.util.ArrayList) Event(org.olat.core.gui.control.Event) FormBasicController(org.olat.core.gui.components.form.flexible.impl.FormBasicController) AssessmentEntry(org.olat.modules.assessment.AssessmentEntry) FormItemContainer(org.olat.core.gui.components.form.flexible.FormItemContainer) ContextEntry(org.olat.core.id.context.ContextEntry) PassedCellRenderer(org.olat.course.assessment.bulk.PassedCellRenderer) BaseSecurityModule(org.olat.basesecurity.BaseSecurityModule) StringHelper(org.olat.core.util.StringHelper) StateEntry(org.olat.core.id.context.StateEntry) FlexiTableDataModelFactory(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableDataModelFactory) BusinessGroupService(org.olat.group.BusinessGroupService) Link(org.olat.core.gui.components.link.Link) AssessmentStatusCellRenderer(org.olat.course.assessment.ui.tool.AssessmentStatusCellRenderer) FlexiTableSearchEvent(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableSearchEvent) SearchBusinessGroupParams(org.olat.group.model.SearchBusinessGroupParams) Controller(org.olat.core.gui.control.Controller) UserManager(org.olat.user.UserManager) SearchAssessedIdentityParams(org.olat.course.assessment.model.SearchAssessedIdentityParams) AssessmentToolConstants(org.olat.course.assessment.ui.tool.AssessmentToolConstants) AssessedIdentityListProvider(org.olat.course.assessment.ui.tool.AssessedIdentityListProvider) BusinessGroup(org.olat.group.BusinessGroup) UserRequest(org.olat.core.gui.UserRequest) Collections(java.util.Collections) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) AssessmentEntryStatus(org.olat.modules.assessment.model.AssessmentEntryStatus) AssessmentEntry(org.olat.modules.assessment.AssessmentEntry) Date(java.util.Date) SearchAssessedIdentityParams(org.olat.course.assessment.model.SearchAssessedIdentityParams) FlexiTableFilter(org.olat.core.gui.components.form.flexible.elements.FlexiTableFilter) Identity(org.olat.core.id.Identity)

Aggregations

SearchAssessedIdentityParams (org.olat.course.assessment.model.SearchAssessedIdentityParams)22 Identity (org.olat.core.id.Identity)12 ArrayList (java.util.ArrayList)10 AssessmentEntry (org.olat.modules.assessment.AssessmentEntry)10 HashMap (java.util.HashMap)8 BusinessGroup (org.olat.group.BusinessGroup)8 RepositoryEntry (org.olat.repository.RepositoryEntry)8 Collections (java.util.Collections)6 List (java.util.List)6 UserRequest (org.olat.core.gui.UserRequest)6 FormItem (org.olat.core.gui.components.form.flexible.FormItem)6 FormItemContainer (org.olat.core.gui.components.form.flexible.FormItemContainer)6 FlexiTableElement (org.olat.core.gui.components.form.flexible.elements.FlexiTableElement)6 FlexiTableFilter (org.olat.core.gui.components.form.flexible.elements.FlexiTableFilter)6 FormBasicController (org.olat.core.gui.components.form.flexible.impl.FormBasicController)6 FormEvent (org.olat.core.gui.components.form.flexible.impl.FormEvent)6 FormLayoutContainer (org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer)6 DefaultFlexiColumnModel (org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel)6 FlexiTableColumnModel (org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel)6 FlexiTableDataModelFactory (org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableDataModelFactory)6