use of org.olat.course.editor.PublishEvent in project OpenOLAT by OpenOLAT.
the class RunMainController method event.
/**
* implementation of listener which listens to publish events
*
* @see org.olat.core.util.event.GenericEventListener#event(org.olat.core.gui.control.Event)
*/
@Override
public void event(Event event) {
if (event instanceof PublishEvent) {
PublishEvent pe = (PublishEvent) event;
if (course.getResourceableId().equals(pe.getPublishedCourseResId())) {
processPublishEvent(pe);
}
} else if (event instanceof OLATResourceableJustBeforeDeletedEvent) {
OLATResourceableJustBeforeDeletedEvent ojde = (OLATResourceableJustBeforeDeletedEvent) event;
// registered only to one event, but good style.
if (ojde.targetEquals(course, true)) {
doDisposeAfterEvent();
}
} else if (event instanceof AssessmentChangedEvent) {
AssessmentChangedEvent ace = (AssessmentChangedEvent) event;
Identity identity = uce.getIdentityEnvironment().getIdentity();
// reevaluate the changed node if the event changed the current user
if (ace.getIdentityKey().equals(identity.getKey())) {
String assessmentChangeType = ace.getCommand();
// do not re-evaluate things if only comment has been changed
if (assessmentChangeType.equals(AssessmentChangedEvent.TYPE_SCORE_EVAL_CHANGED) || assessmentChangeType.equals(AssessmentChangedEvent.TYPE_ATTEMPTS_CHANGED)) {
// LD: do not recalculate the score now, but at the next click, since the event comes before DB commit
// uce.getScoreAccounting().evaluateAll();
assessmentChangedEventReceived = true;
}
// raise a flag to indicate refresh
needsRebuildAfterRunDone = true;
}
}
}
use of org.olat.course.editor.PublishEvent in project openolat by klemens.
the class RunMainController method event.
/**
* implementation of listener which listens to publish events
*
* @see org.olat.core.util.event.GenericEventListener#event(org.olat.core.gui.control.Event)
*/
@Override
public void event(Event event) {
if (event instanceof PublishEvent) {
PublishEvent pe = (PublishEvent) event;
if (course.getResourceableId().equals(pe.getPublishedCourseResId())) {
processPublishEvent(pe);
}
} else if (event instanceof OLATResourceableJustBeforeDeletedEvent) {
OLATResourceableJustBeforeDeletedEvent ojde = (OLATResourceableJustBeforeDeletedEvent) event;
// registered only to one event, but good style.
if (ojde.targetEquals(course, true)) {
doDisposeAfterEvent();
}
} else if (event instanceof AssessmentChangedEvent) {
AssessmentChangedEvent ace = (AssessmentChangedEvent) event;
Identity identity = uce.getIdentityEnvironment().getIdentity();
// reevaluate the changed node if the event changed the current user
if (ace.getIdentityKey().equals(identity.getKey())) {
String assessmentChangeType = ace.getCommand();
// do not re-evaluate things if only comment has been changed
if (assessmentChangeType.equals(AssessmentChangedEvent.TYPE_SCORE_EVAL_CHANGED) || assessmentChangeType.equals(AssessmentChangedEvent.TYPE_ATTEMPTS_CHANGED)) {
// LD: do not recalculate the score now, but at the next click, since the event comes before DB commit
// uce.getScoreAccounting().evaluateAll();
assessmentChangedEventReceived = true;
}
// raise a flag to indicate refresh
needsRebuildAfterRunDone = true;
}
}
}
Aggregations