Search in sources :

Example 6 with SearchAssessedIdentityParams

use of org.olat.course.assessment.model.SearchAssessedIdentityParams in project openolat by klemens.

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

Example 7 with SearchAssessedIdentityParams

use of org.olat.course.assessment.model.SearchAssessedIdentityParams in project openolat by klemens.

the class AssessmentToolManagerTest method assessmentTool_coach.

@Test
public void assessmentTool_coach() {
    // course
    Identity author = JunitTestHelper.createAndPersistIdentityAsRndUser("ast-author-1");
    ICourse course = CoursesWebService.createEmptyCourse(author, "course-assessment-tool", "course long name", null);
    // members as participant and coach
    Identity assessedIdentity1 = JunitTestHelper.createAndPersistIdentityAsRndUser("ast-1");
    Identity assessedIdentity2 = JunitTestHelper.createAndPersistIdentityAsRndUser("ast-2");
    Identity assessedIdentity3 = JunitTestHelper.createAndPersistIdentityAsRndUser("ast-3");
    Identity assessedIdentity4 = JunitTestHelper.createAndPersistIdentityAsRndUser("ast-4");
    Identity coach = JunitTestHelper.createAndPersistIdentityAsRndUser("ast-coach-1");
    RepositoryEntry entry = course.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
    RepositoryEntry refEntry = JunitTestHelper.createAndPersistRepositoryEntry();
    String subIdent = UUID.randomUUID().toString();
    BusinessGroup group1 = businessGroupDao.createAndPersist(null, "assessment-tool-bg-1", "assessment-tool-bg-1-desc", -1, -1, false, false, false, false, false);
    businessGroupRelationDao.addRelationToResource(group1, entry);
    BusinessGroup group2 = businessGroupDao.createAndPersist(null, "assessment-tool-bg-2", "assessment-tool-bg-2-desc", -1, -1, false, false, false, false, false);
    businessGroupRelationDao.addRelationToResource(group2, entry);
    businessGroupRelationDao.addRole(assessedIdentity1, group1, GroupRoles.participant.name());
    businessGroupRelationDao.addRole(assessedIdentity2, group1, GroupRoles.participant.name());
    businessGroupRelationDao.addRole(assessedIdentity3, group2, GroupRoles.participant.name());
    businessGroupRelationDao.addRole(coach, group1, GroupRoles.coach.name());
    dbInstance.commitAndCloseSession();
    // some datas
    assessmentEntryDao.createAssessmentEntry(assessedIdentity1, null, entry, subIdent, refEntry, 3.0f, Boolean.FALSE, null, null);
    assessmentEntryDao.createAssessmentEntry(assessedIdentity2, null, entry, subIdent, refEntry, 5.0f, Boolean.TRUE, null, null);
    assessmentEntryDao.createAssessmentEntry(assessedIdentity3, null, entry, subIdent, refEntry, 8.0f, Boolean.TRUE, null, null);
    assessmentEntryDao.createAssessmentEntry(assessedIdentity4, null, entry, subIdent, refEntry, 9.0f, Boolean.TRUE, null, null);
    assessmentEntryDao.createAssessmentEntry(null, UUID.randomUUID().toString(), entry, subIdent, refEntry);
    dbInstance.commitAndCloseSession();
    // coach of group 1 with id 1 and id2
    List<BusinessGroup> coachedGroups = Collections.singletonList(group1);
    AssessmentToolSecurityCallback assessmentCallback = new AssessmentToolSecurityCallback(false, false, false, true, coachedGroups);
    SearchAssessedIdentityParams params = new SearchAssessedIdentityParams(entry, subIdent, refEntry, assessmentCallback);
    // statistics
    AssessmentStatistics statistics = assessmentToolManager.getStatistics(coach, params);
    Assert.assertEquals(4.0d, statistics.getAverageScore().doubleValue(), 0.0001);
    Assert.assertEquals(1, statistics.getCountFailed());
    Assert.assertEquals(1, statistics.getCountPassed());
    // check assessed identities list
    List<Identity> assessedIdentities = assessmentToolManager.getAssessedIdentities(coach, params);
    Assert.assertNotNull(assessedIdentities);
    Assert.assertEquals(2, assessedIdentities.size());
    // number of assessed identities
    int numOfAssessedIdentities = assessmentToolManager.getNumberOfAssessedIdentities(coach, params);
    Assert.assertEquals(2, numOfAssessedIdentities);
    // check only the queries
    AssessmentMembersStatistics participantStatistics = assessmentToolManager.getNumberOfParticipants(coach, params);
    Assert.assertNotNull(participantStatistics);
    int numOfInitialLanches = assessmentToolManager.getNumberOfInitialLaunches(coach, params);
    // not launched, only simulated
    Assert.assertEquals(0, numOfInitialLanches);
    List<IdentityShort> assessedShortIdentities = assessmentToolManager.getShortAssessedIdentities(coach, params, 120);
    Assert.assertNotNull(assessedShortIdentities);
    Assert.assertEquals(2, assessedShortIdentities.size());
    List<AssessmentEntry> assessmentEntries = assessmentToolManager.getAssessmentEntries(coach, params, AssessmentEntryStatus.notStarted);
    Assert.assertNotNull(assessmentEntries);
    Assert.assertEquals(0, assessmentEntries.size());
    // separate check with more options in the search parameters
    // add by group key
    params.setBusinessGroupKeys(Collections.singletonList(group1.getKey()));
    // assessed groups
    List<AssessedBusinessGroup> assessedGroups = assessmentToolManager.getBusinessGroupStatistics(coach, params);
    Assert.assertNotNull(assessedGroups);
    Assert.assertEquals(1, assessedGroups.size());
    // check assessed identities list
    List<Identity> assessedIdentitiesAlt = assessmentToolManager.getAssessedIdentities(coach, params);
    Assert.assertNotNull(assessedIdentitiesAlt);
    Assert.assertEquals(2, assessedIdentitiesAlt.size());
    // number of assessed identities
    int numOfAssessedIdentitiesAlt = assessmentToolManager.getNumberOfAssessedIdentities(coach, params);
    Assert.assertEquals(2, numOfAssessedIdentitiesAlt);
    List<IdentityShort> assessedShortIdentitiesAlt = assessmentToolManager.getShortAssessedIdentities(coach, params, 120);
    Assert.assertNotNull(assessedShortIdentitiesAlt);
    Assert.assertEquals(2, assessedShortIdentitiesAlt.size());
    List<AssessmentEntry> assessmentEntriesAlt = assessmentToolManager.getAssessmentEntries(coach, params, AssessmentEntryStatus.notStarted);
    Assert.assertNotNull(assessmentEntriesAlt);
    Assert.assertEquals(0, assessmentEntriesAlt.size());
}
Also used : AssessmentMembersStatistics(org.olat.modules.assessment.model.AssessmentMembersStatistics) BusinessGroup(org.olat.group.BusinessGroup) AssessedBusinessGroup(org.olat.course.assessment.model.AssessedBusinessGroup) IdentityShort(org.olat.basesecurity.IdentityShort) AssessmentToolSecurityCallback(org.olat.modules.assessment.ui.AssessmentToolSecurityCallback) ICourse(org.olat.course.ICourse) RepositoryEntry(org.olat.repository.RepositoryEntry) AssessmentEntry(org.olat.modules.assessment.AssessmentEntry) AssessmentStatistics(org.olat.course.assessment.model.AssessmentStatistics) SearchAssessedIdentityParams(org.olat.course.assessment.model.SearchAssessedIdentityParams) AssessedBusinessGroup(org.olat.course.assessment.model.AssessedBusinessGroup) Identity(org.olat.core.id.Identity) Test(org.junit.Test)

Example 8 with SearchAssessedIdentityParams

use of org.olat.course.assessment.model.SearchAssessedIdentityParams in project openolat by klemens.

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;
}
Also used : SearchAssessedIdentityParams(org.olat.course.assessment.model.SearchAssessedIdentityParams) FlexiTableFilter(org.olat.core.gui.components.form.flexible.elements.FlexiTableFilter) ArrayList(java.util.ArrayList) AssessmentEntryStatus(org.olat.modules.assessment.model.AssessmentEntryStatus)

Example 9 with SearchAssessedIdentityParams

use of org.olat.course.assessment.model.SearchAssessedIdentityParams in project openolat by klemens.

the class IdentityListCourseNodeController method loadModel.

protected void loadModel(@SuppressWarnings("unused") UserRequest ureq) {
    SearchAssessedIdentityParams params = getSearchParameters();
    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));
    List<AssessedIdentityElementRow> rows = new ArrayList<>(assessedIdentities.size());
    for (Identity assessedIdentity : assessedIdentities) {
        AssessmentEntry entry = entryMap.get(assessedIdentity.getKey());
        CompletionItem currentCompletion = new CompletionItem("current-completion-" + (++counter), getLocale());
        if (entry != null) {
            currentCompletion.setCompletion(entry.getCurrentRunCompletion());
            AssessmentRunStatus status = entry.getCurrentRunStatus();
            currentCompletion.setEnded(status != null && AssessmentRunStatus.done.equals(status));
        }
        FormLink toolsLink = uifactory.addFormLink("tools_" + (++counter), "tools", "", null, null, Link.NONTRANSLATED);
        toolsLink.setIconLeftCSS("o_icon o_icon_actions o_icon-lg");
        AssessedIdentityElementRow row = new AssessedIdentityElementRow(assessedIdentity, entry, currentCompletion, toolsLink, userPropertyHandlers, getLocale());
        toolsLink.setUserObject(row);
        rows.add(row);
    }
    usersTableModel.setObjects(rows);
    List<FlexiTableFilter> filters = tableEl.getSelectedFilters();
    if (filters != null && filters.size() > 0 && filters.get(0) != null) {
        usersTableModel.filter(Collections.singletonList(filters.get(0)));
    }
    tableEl.reset();
    tableEl.reloadData();
}
Also used : FlexiTableElement(org.olat.core.gui.components.form.flexible.elements.FlexiTableElement) Util(org.olat.core.util.Util) IdentityEnvironment(org.olat.core.id.IdentityEnvironment) RepositoryService(org.olat.repository.RepositoryService) Activateable2(org.olat.core.gui.control.generic.dtabs.Activateable2) AssessmentToolManager(org.olat.course.assessment.AssessmentToolManager) Role(org.olat.modules.assessment.Role) DefaultFlexiColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel) Autowired(org.springframework.beans.factory.annotation.Autowired) CourseNode(org.olat.course.nodes.CourseNode) IdentityRef(org.olat.basesecurity.IdentityRef) AssessmentToolSecurityCallback(org.olat.modules.assessment.ui.AssessmentToolSecurityCallback) CourseNodeFactory(org.olat.course.nodes.CourseNodeFactory) OLATResourceable(org.olat.core.id.OLATResourceable) AssessmentToolOptions(org.olat.modules.assessment.AssessmentToolOptions) FlexiTableFilter(org.olat.core.gui.components.form.flexible.elements.FlexiTableFilter) GenericEventListener(org.olat.core.util.event.GenericEventListener) OresHelper(org.olat.core.util.resource.OresHelper) Map(java.util.Map) SortKey(org.olat.core.commons.persistence.SortKey) Group(org.olat.basesecurity.Group) FlexiTableColumnModel(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel) CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) ICourse(org.olat.course.ICourse) IdentityCourseElementCols(org.olat.course.assessment.ui.tool.IdentityListCourseNodeTableModel.IdentityCourseElementCols) AssessmentModule(org.olat.course.assessment.AssessmentModule) UserCourseEnvironment(org.olat.course.run.userview.UserCourseEnvironment) WindowControl(org.olat.core.gui.control.WindowControl) STCourseNode(org.olat.course.nodes.STCourseNode) ScoreEvaluation(org.olat.course.run.scoring.ScoreEvaluation) AssessmentFormEvent(org.olat.modules.assessment.ui.event.AssessmentFormEvent) UserPropertyHandler(org.olat.user.propertyhandlers.UserPropertyHandler) Set(java.util.Set) AssessedIdentityElementRow(org.olat.modules.assessment.ui.AssessedIdentityElementRow) Component(org.olat.core.gui.components.Component) LinkFactory(org.olat.core.gui.components.link.LinkFactory) AssessedIdentityListState(org.olat.modules.assessment.ui.AssessedIdentityListState) AssessedIdentityController(org.olat.modules.assessment.ui.AssessedIdentityController) AssessmentEntryStatus(org.olat.modules.assessment.model.AssessmentEntryStatus) SelectionEvent(org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent) List(java.util.List) FormLink(org.olat.core.gui.components.form.flexible.elements.FormLink) CalculatedAssessableCourseNode(org.olat.course.nodes.CalculatedAssessableCourseNode) Align(org.olat.core.gui.components.stack.TooledStackedPanel.Align) Identity(org.olat.core.id.Identity) AssessmentRunStatus(org.olat.modules.assessment.model.AssessmentRunStatus) CloseableCalloutWindowController(org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController) BaseSecurity(org.olat.basesecurity.BaseSecurity) FormLayoutContainer(org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer) Roles(org.olat.core.id.Roles) TooledStackedPanel(org.olat.core.gui.components.stack.TooledStackedPanel) AssessableCourseNode(org.olat.course.nodes.AssessableCourseNode) FormEvent(org.olat.core.gui.components.form.flexible.impl.FormEvent) HashMap(java.util.HashMap) CourseFactory(org.olat.course.CourseFactory) RepositoryEntry(org.olat.repository.RepositoryEntry) FormItem(org.olat.core.gui.components.form.flexible.FormItem) ArrayList(java.util.ArrayList) CompletionItem(org.olat.modules.assessment.ui.component.CompletionItem) 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) ScoreCellRenderer(org.olat.modules.assessment.ui.ScoreCellRenderer) 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) CourseEnvironment(org.olat.course.run.environment.CourseEnvironment) Link(org.olat.core.gui.components.link.Link) CompletionEvent(org.olat.modules.assessment.ui.event.CompletionEvent) ShowDetailsEvent(org.olat.course.assessment.ui.tool.event.ShowDetailsEvent) IdentityRefImpl(org.olat.basesecurity.model.IdentityRefImpl) FlexiTableSearchEvent(org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableSearchEvent) Controller(org.olat.core.gui.control.Controller) UserManager(org.olat.user.UserManager) SearchAssessedIdentityParams(org.olat.course.assessment.model.SearchAssessedIdentityParams) AssessmentToolContainer(org.olat.modules.assessment.ui.AssessmentToolContainer) UserCourseEnvironmentImpl(org.olat.course.run.userview.UserCourseEnvironmentImpl) BusinessGroup(org.olat.group.BusinessGroup) FlexiTableSortOptions(org.olat.core.gui.components.form.flexible.elements.FlexiTableSortOptions) UserRequest(org.olat.core.gui.UserRequest) Collections(java.util.Collections) CoordinatorManager(org.olat.core.util.coordinate.CoordinatorManager) AssessmentRunStatus(org.olat.modules.assessment.model.AssessmentRunStatus) HashMap(java.util.HashMap) AssessedIdentityElementRow(org.olat.modules.assessment.ui.AssessedIdentityElementRow) ArrayList(java.util.ArrayList) FormLink(org.olat.core.gui.components.form.flexible.elements.FormLink) AssessmentEntry(org.olat.modules.assessment.AssessmentEntry) CompletionItem(org.olat.modules.assessment.ui.component.CompletionItem) SearchAssessedIdentityParams(org.olat.course.assessment.model.SearchAssessedIdentityParams) FlexiTableFilter(org.olat.core.gui.components.form.flexible.elements.FlexiTableFilter) Identity(org.olat.core.id.Identity)

Example 10 with SearchAssessedIdentityParams

use of org.olat.course.assessment.model.SearchAssessedIdentityParams in project OpenOLAT by OpenOLAT.

the class AssessmentToolManagerTest method assessmentTool_coach.

@Test
public void assessmentTool_coach() {
    // course
    Identity author = JunitTestHelper.createAndPersistIdentityAsRndUser("ast-author-1");
    ICourse course = CoursesWebService.createEmptyCourse(author, "course-assessment-tool", "course long name", null);
    // members as participant and coach
    Identity assessedIdentity1 = JunitTestHelper.createAndPersistIdentityAsRndUser("ast-1");
    Identity assessedIdentity2 = JunitTestHelper.createAndPersistIdentityAsRndUser("ast-2");
    Identity assessedIdentity3 = JunitTestHelper.createAndPersistIdentityAsRndUser("ast-3");
    Identity assessedIdentity4 = JunitTestHelper.createAndPersistIdentityAsRndUser("ast-4");
    Identity coach = JunitTestHelper.createAndPersistIdentityAsRndUser("ast-coach-1");
    RepositoryEntry entry = course.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
    RepositoryEntry refEntry = JunitTestHelper.createAndPersistRepositoryEntry();
    String subIdent = UUID.randomUUID().toString();
    BusinessGroup group1 = businessGroupDao.createAndPersist(null, "assessment-tool-bg-1", "assessment-tool-bg-1-desc", -1, -1, false, false, false, false, false);
    businessGroupRelationDao.addRelationToResource(group1, entry);
    BusinessGroup group2 = businessGroupDao.createAndPersist(null, "assessment-tool-bg-2", "assessment-tool-bg-2-desc", -1, -1, false, false, false, false, false);
    businessGroupRelationDao.addRelationToResource(group2, entry);
    businessGroupRelationDao.addRole(assessedIdentity1, group1, GroupRoles.participant.name());
    businessGroupRelationDao.addRole(assessedIdentity2, group1, GroupRoles.participant.name());
    businessGroupRelationDao.addRole(assessedIdentity3, group2, GroupRoles.participant.name());
    businessGroupRelationDao.addRole(coach, group1, GroupRoles.coach.name());
    dbInstance.commitAndCloseSession();
    // some datas
    assessmentEntryDao.createAssessmentEntry(assessedIdentity1, null, entry, subIdent, refEntry, 3.0f, Boolean.FALSE, null, null);
    assessmentEntryDao.createAssessmentEntry(assessedIdentity2, null, entry, subIdent, refEntry, 5.0f, Boolean.TRUE, null, null);
    assessmentEntryDao.createAssessmentEntry(assessedIdentity3, null, entry, subIdent, refEntry, 8.0f, Boolean.TRUE, null, null);
    assessmentEntryDao.createAssessmentEntry(assessedIdentity4, null, entry, subIdent, refEntry, 9.0f, Boolean.TRUE, null, null);
    assessmentEntryDao.createAssessmentEntry(null, UUID.randomUUID().toString(), entry, subIdent, refEntry);
    dbInstance.commitAndCloseSession();
    // coach of group 1 with id 1 and id2
    List<BusinessGroup> coachedGroups = Collections.singletonList(group1);
    AssessmentToolSecurityCallback assessmentCallback = new AssessmentToolSecurityCallback(false, false, false, true, coachedGroups);
    SearchAssessedIdentityParams params = new SearchAssessedIdentityParams(entry, subIdent, refEntry, assessmentCallback);
    // statistics
    AssessmentStatistics statistics = assessmentToolManager.getStatistics(coach, params);
    Assert.assertEquals(4.0d, statistics.getAverageScore().doubleValue(), 0.0001);
    Assert.assertEquals(1, statistics.getCountFailed());
    Assert.assertEquals(1, statistics.getCountPassed());
    // check assessed identities list
    List<Identity> assessedIdentities = assessmentToolManager.getAssessedIdentities(coach, params);
    Assert.assertNotNull(assessedIdentities);
    Assert.assertEquals(2, assessedIdentities.size());
    // number of assessed identities
    int numOfAssessedIdentities = assessmentToolManager.getNumberOfAssessedIdentities(coach, params);
    Assert.assertEquals(2, numOfAssessedIdentities);
    // check only the queries
    AssessmentMembersStatistics participantStatistics = assessmentToolManager.getNumberOfParticipants(coach, params);
    Assert.assertNotNull(participantStatistics);
    int numOfInitialLanches = assessmentToolManager.getNumberOfInitialLaunches(coach, params);
    // not launched, only simulated
    Assert.assertEquals(0, numOfInitialLanches);
    List<IdentityShort> assessedShortIdentities = assessmentToolManager.getShortAssessedIdentities(coach, params, 120);
    Assert.assertNotNull(assessedShortIdentities);
    Assert.assertEquals(2, assessedShortIdentities.size());
    List<AssessmentEntry> assessmentEntries = assessmentToolManager.getAssessmentEntries(coach, params, AssessmentEntryStatus.notStarted);
    Assert.assertNotNull(assessmentEntries);
    Assert.assertEquals(0, assessmentEntries.size());
    // separate check with more options in the search parameters
    // add by group key
    params.setBusinessGroupKeys(Collections.singletonList(group1.getKey()));
    // assessed groups
    List<AssessedBusinessGroup> assessedGroups = assessmentToolManager.getBusinessGroupStatistics(coach, params);
    Assert.assertNotNull(assessedGroups);
    Assert.assertEquals(1, assessedGroups.size());
    // check assessed identities list
    List<Identity> assessedIdentitiesAlt = assessmentToolManager.getAssessedIdentities(coach, params);
    Assert.assertNotNull(assessedIdentitiesAlt);
    Assert.assertEquals(2, assessedIdentitiesAlt.size());
    // number of assessed identities
    int numOfAssessedIdentitiesAlt = assessmentToolManager.getNumberOfAssessedIdentities(coach, params);
    Assert.assertEquals(2, numOfAssessedIdentitiesAlt);
    List<IdentityShort> assessedShortIdentitiesAlt = assessmentToolManager.getShortAssessedIdentities(coach, params, 120);
    Assert.assertNotNull(assessedShortIdentitiesAlt);
    Assert.assertEquals(2, assessedShortIdentitiesAlt.size());
    List<AssessmentEntry> assessmentEntriesAlt = assessmentToolManager.getAssessmentEntries(coach, params, AssessmentEntryStatus.notStarted);
    Assert.assertNotNull(assessmentEntriesAlt);
    Assert.assertEquals(0, assessmentEntriesAlt.size());
}
Also used : AssessmentMembersStatistics(org.olat.modules.assessment.model.AssessmentMembersStatistics) BusinessGroup(org.olat.group.BusinessGroup) AssessedBusinessGroup(org.olat.course.assessment.model.AssessedBusinessGroup) IdentityShort(org.olat.basesecurity.IdentityShort) AssessmentToolSecurityCallback(org.olat.modules.assessment.ui.AssessmentToolSecurityCallback) ICourse(org.olat.course.ICourse) RepositoryEntry(org.olat.repository.RepositoryEntry) AssessmentEntry(org.olat.modules.assessment.AssessmentEntry) AssessmentStatistics(org.olat.course.assessment.model.AssessmentStatistics) SearchAssessedIdentityParams(org.olat.course.assessment.model.SearchAssessedIdentityParams) AssessedBusinessGroup(org.olat.course.assessment.model.AssessedBusinessGroup) Identity(org.olat.core.id.Identity) Test(org.junit.Test)

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