Search in sources :

Example 11 with TransientAssessmentMode

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

the class AssessmentModeListController method event.

@Override
public void event(Event event) {
    if (event instanceof AssessmentModeNotificationEvent) {
        AssessmentModeNotificationEvent amne = (AssessmentModeNotificationEvent) event;
        TransientAssessmentMode mode = amne.getAssessementMode();
        if (mode.getRepositoryEntryKey().equals(entry.getKey()) && model.updateModeStatus(amne.getAssessementMode())) {
            tableEl.getComponent().setDirty(true);
        }
    }
}
Also used : AssessmentModeNotificationEvent(org.olat.course.assessment.AssessmentModeNotificationEvent) TransientAssessmentMode(org.olat.course.assessment.model.TransientAssessmentMode)

Example 12 with TransientAssessmentMode

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

the class AssessmentModeCoordinationServiceImpl method sendEvent.

private void sendEvent(String cmd, AssessmentMode mode, Set<Long> assessedIdentityKeys) {
    TransientAssessmentMode transientMode = new TransientAssessmentMode(mode);
    AssessmentModeNotificationEvent event = new AssessmentModeNotificationEvent(cmd, transientMode, assessedIdentityKeys);
    coordinatorManager.getCoordinator().getEventBus().fireEventToListenersOf(event, AssessmentModeNotificationEvent.ASSESSMENT_MODE_NOTIFICATION);
}
Also used : AssessmentModeNotificationEvent(org.olat.course.assessment.AssessmentModeNotificationEvent) TransientAssessmentMode(org.olat.course.assessment.model.TransientAssessmentMode)

Example 13 with TransientAssessmentMode

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

the class AssessmentModeGuardController method syncAssessmentModes.

private void syncAssessmentModes(UserRequest ureq) {
    List<ResourceGuard> modeWrappers = new ArrayList<ResourceGuard>();
    for (TransientAssessmentMode mode : modes) {
        if (mode != null) {
            ResourceGuard wrapper = syncAssessmentMode(ureq, mode);
            if (wrapper != null) {
                modeWrappers.add(wrapper);
            }
        }
    }
    guards.setList(modeWrappers);
    mainContinueButton.setVisible(modeWrappers.isEmpty());
    mainVC.setDirty(true);
}
Also used : ArrayList(java.util.ArrayList) TransientAssessmentMode(org.olat.course.assessment.model.TransientAssessmentMode)

Example 14 with TransientAssessmentMode

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

the class AssessmentModeGuardController method processAssessmentModeNotificationEvent.

private void processAssessmentModeNotificationEvent(AssessmentModeNotificationEvent event) {
    if (getIdentity() != null && event.getAssessedIdentityKeys() != null && event.getAssessedIdentityKeys().contains(getIdentity().getKey())) {
        boolean update = false;
        TransientAssessmentMode mode = event.getAssessementMode();
        List<TransientAssessmentMode> updatedModes = new ArrayList<TransientAssessmentMode>();
        for (TransientAssessmentMode currentMode : modes) {
            if (currentMode.getModeKey().equals(mode.getModeKey())) {
                updatedModes.add(mode);
                update |= (currentMode.getStatus() != mode.getStatus());
            } else {
                updatedModes.add(currentMode);
                update |= true;
            }
        }
        modes = updatedModes;
        pushUpdate |= update;
    }
}
Also used : ArrayList(java.util.ArrayList) TransientAssessmentMode(org.olat.course.assessment.model.TransientAssessmentMode)

Aggregations

TransientAssessmentMode (org.olat.course.assessment.model.TransientAssessmentMode)14 ArrayList (java.util.ArrayList)4 AssessmentMode (org.olat.course.assessment.AssessmentMode)4 AssessmentModeNotificationEvent (org.olat.course.assessment.AssessmentModeNotificationEvent)4 UserSession (org.olat.core.util.UserSession)2 UserSessionManager (org.olat.core.util.session.UserSessionManager)2 AssessmentModeManager (org.olat.course.assessment.AssessmentModeManager)2 AssessmentModule (org.olat.course.assessment.AssessmentModule)2 AssessmentModeGuardController (org.olat.course.assessment.ui.mode.AssessmentModeGuardController)2