Search in sources :

Example 1 with CompletionEvent

use of org.olat.modules.assessment.ui.event.CompletionEvent in project openolat by klemens.

the class QTI21AssessmentRunController method updateOutcomes.

@Override
public void updateOutcomes(Float score, Boolean pass, Double completion) {
    if (courseNode instanceof IQTESTCourseNode) {
        ((IQTESTCourseNode) courseNode).updateCurrentCompletion(userCourseEnv, getIdentity(), completion, AssessmentRunStatus.running, Role.user);
        coordinatorManager.getCoordinator().getEventBus().fireEventToListenersOf(new CompletionEvent(CompletionEvent.PROGRESS, courseNode.getIdent(), completion, AssessmentRunStatus.running, getIdentity().getKey()), userCourseEnv.getCourseEnvironment().getCourseGroupManager().getCourseResource());
    }
}
Also used : IQTESTCourseNode(org.olat.course.nodes.IQTESTCourseNode) CompletionEvent(org.olat.modules.assessment.ui.event.CompletionEvent)

Example 2 with CompletionEvent

use of org.olat.modules.assessment.ui.event.CompletionEvent in project OpenOLAT by OpenOLAT.

the class QTI21AssessmentRunController method updateOutcomes.

@Override
public void updateOutcomes(Float score, Boolean pass, Double completion) {
    if (courseNode instanceof IQTESTCourseNode) {
        ((IQTESTCourseNode) courseNode).updateCurrentCompletion(userCourseEnv, getIdentity(), completion, AssessmentRunStatus.running, Role.user);
        coordinatorManager.getCoordinator().getEventBus().fireEventToListenersOf(new CompletionEvent(CompletionEvent.PROGRESS, courseNode.getIdent(), completion, AssessmentRunStatus.running, getIdentity().getKey()), userCourseEnv.getCourseEnvironment().getCourseGroupManager().getCourseResource());
    }
}
Also used : IQTESTCourseNode(org.olat.course.nodes.IQTESTCourseNode) CompletionEvent(org.olat.modules.assessment.ui.event.CompletionEvent)

Example 3 with CompletionEvent

use of org.olat.modules.assessment.ui.event.CompletionEvent in project OpenOLAT by OpenOLAT.

the class QTI21AssessmentRunController method submit.

@Override
public void submit(Float score, Boolean pass, Double completion, Long assessmentId) {
    if (anonym) {
        assessmentNotificationsHandler.markPublisherNews(getIdentity(), userCourseEnv.getCourseEnvironment().getCourseResourceableId());
        return;
    }
    if (courseNode instanceof IQTESTCourseNode) {
        Boolean visibility;
        AssessmentEntryStatus assessmentStatus;
        if (IQEditController.CORRECTION_MANUAL.equals(courseNode.getModuleConfiguration().getStringValue(IQEditController.CONFIG_CORRECTION_MODE))) {
            assessmentStatus = AssessmentEntryStatus.inReview;
            visibility = Boolean.FALSE;
        } else {
            assessmentStatus = AssessmentEntryStatus.done;
            visibility = Boolean.TRUE;
        }
        ScoreEvaluation sceval = new ScoreEvaluation(score, pass, assessmentStatus, visibility, Boolean.TRUE, completion, AssessmentRunStatus.done, assessmentId);
        boolean increment = incrementAttempts.getAndSet(false);
        ((IQTESTCourseNode) courseNode).updateUserScoreEvaluation(sceval, userCourseEnv, getIdentity(), increment, Role.user);
        if (increment) {
            ThreadLocalUserActivityLogger.log(QTI21LoggingAction.QTI_CLOSE_IN_COURSE, getClass());
        }
        coordinatorManager.getCoordinator().getEventBus().fireEventToListenersOf(new CompletionEvent(CompletionEvent.PROGRESS, courseNode.getIdent(), completion, AssessmentRunStatus.done, getIdentity().getKey()), userCourseEnv.getCourseEnvironment().getCourseGroupManager().getCourseResource());
        assessmentNotificationsHandler.markPublisherNews(getIdentity(), userCourseEnv.getCourseEnvironment().getCourseResourceableId());
    } else if (courseNode instanceof SelfAssessableCourseNode) {
        boolean increment = incrementAttempts.getAndSet(false);
        if (increment) {
            ((SelfAssessableCourseNode) courseNode).incrementUserAttempts(userCourseEnv, Role.user);
        }
    }
}
Also used : IQTESTCourseNode(org.olat.course.nodes.IQTESTCourseNode) ScoreEvaluation(org.olat.course.run.scoring.ScoreEvaluation) CompletionEvent(org.olat.modules.assessment.ui.event.CompletionEvent) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) AssessmentEntryStatus(org.olat.modules.assessment.model.AssessmentEntryStatus) SelfAssessableCourseNode(org.olat.course.nodes.SelfAssessableCourseNode)

Example 4 with CompletionEvent

use of org.olat.modules.assessment.ui.event.CompletionEvent in project openolat by klemens.

the class QTI21AssessmentRunController method submit.

@Override
public void submit(Float score, Boolean pass, Double completion, Long assessmentId) {
    if (anonym) {
        assessmentNotificationsHandler.markPublisherNews(getIdentity(), userCourseEnv.getCourseEnvironment().getCourseResourceableId());
        return;
    }
    if (courseNode instanceof IQTESTCourseNode) {
        Boolean visibility;
        AssessmentEntryStatus assessmentStatus;
        if (IQEditController.CORRECTION_MANUAL.equals(courseNode.getModuleConfiguration().getStringValue(IQEditController.CONFIG_CORRECTION_MODE))) {
            assessmentStatus = AssessmentEntryStatus.inReview;
            visibility = Boolean.FALSE;
        } else {
            assessmentStatus = AssessmentEntryStatus.done;
            visibility = Boolean.TRUE;
        }
        ScoreEvaluation sceval = new ScoreEvaluation(score, pass, assessmentStatus, visibility, Boolean.TRUE, completion, AssessmentRunStatus.done, assessmentId);
        boolean increment = incrementAttempts.getAndSet(false);
        ((IQTESTCourseNode) courseNode).updateUserScoreEvaluation(sceval, userCourseEnv, getIdentity(), increment, Role.user);
        if (increment) {
            ThreadLocalUserActivityLogger.log(QTI21LoggingAction.QTI_CLOSE_IN_COURSE, getClass());
        }
        coordinatorManager.getCoordinator().getEventBus().fireEventToListenersOf(new CompletionEvent(CompletionEvent.PROGRESS, courseNode.getIdent(), completion, AssessmentRunStatus.done, getIdentity().getKey()), userCourseEnv.getCourseEnvironment().getCourseGroupManager().getCourseResource());
        assessmentNotificationsHandler.markPublisherNews(getIdentity(), userCourseEnv.getCourseEnvironment().getCourseResourceableId());
    } else if (courseNode instanceof SelfAssessableCourseNode) {
        boolean increment = incrementAttempts.getAndSet(false);
        if (increment) {
            ((SelfAssessableCourseNode) courseNode).incrementUserAttempts(userCourseEnv, Role.user);
        }
    }
}
Also used : IQTESTCourseNode(org.olat.course.nodes.IQTESTCourseNode) ScoreEvaluation(org.olat.course.run.scoring.ScoreEvaluation) CompletionEvent(org.olat.modules.assessment.ui.event.CompletionEvent) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) AssessmentEntryStatus(org.olat.modules.assessment.model.AssessmentEntryStatus) SelfAssessableCourseNode(org.olat.course.nodes.SelfAssessableCourseNode)

Aggregations

IQTESTCourseNode (org.olat.course.nodes.IQTESTCourseNode)4 CompletionEvent (org.olat.modules.assessment.ui.event.CompletionEvent)4 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)2 SelfAssessableCourseNode (org.olat.course.nodes.SelfAssessableCourseNode)2 ScoreEvaluation (org.olat.course.run.scoring.ScoreEvaluation)2 AssessmentEntryStatus (org.olat.modules.assessment.model.AssessmentEntryStatus)2