Search in sources :

Example 21 with SearchAssessedIdentityParams

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

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 22 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(testEntry, null, testEntry, 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)

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