Search in sources :

Example 96 with IdentityEnvironment

use of org.olat.core.id.IdentityEnvironment in project openolat by klemens.

the class QTI21ResetDataController method formOK.

@Override
protected void formOK(UserRequest ureq) {
    if (courseNode instanceof IQTESTCourseNode) {
        IQTESTCourseNode testCourseNode = (IQTESTCourseNode) courseNode;
        RepositoryEntry testEntry = courseNode.getReferencedRepositoryEntry();
        RepositoryEntry courseEntry = courseEnv.getCourseGroupManager().getCourseEntry();
        ICourse course = CourseFactory.loadCourse(courseEntry);
        archiveData(course, options);
        qtiService.deleteAssessmentTestSession(identities, testEntry, courseEntry, courseNode.getIdent());
        for (Identity identity : identities) {
            ScoreEvaluation scoreEval = new ScoreEvaluation(null, null, AssessmentEntryStatus.notStarted, null, Boolean.FALSE, 0.0d, AssessmentRunStatus.notStarted, null);
            IdentityEnvironment ienv = new IdentityEnvironment(identity, studentRoles);
            UserCourseEnvironment uce = new UserCourseEnvironmentImpl(ienv, courseEnv);
            testCourseNode.updateUserScoreEvaluation(scoreEval, uce, getIdentity(), false, Role.coach);
            testCourseNode.updateCurrentCompletion(uce, getIdentity(), null, AssessmentRunStatus.notStarted, Role.coach);
        }
    } else if (assessedEntry != null) {
        archiveData(assessedEntry);
        qtiService.deleteAssessmentTestSession(identities, assessedEntry, null, null);
    }
    fireEvent(ureq, Event.CHANGED_EVENT);
}
Also used : IQTESTCourseNode(org.olat.course.nodes.IQTESTCourseNode) ScoreEvaluation(org.olat.course.run.scoring.ScoreEvaluation) UserCourseEnvironmentImpl(org.olat.course.run.userview.UserCourseEnvironmentImpl) UserCourseEnvironment(org.olat.course.run.userview.UserCourseEnvironment) ICourse(org.olat.course.ICourse) RepositoryEntry(org.olat.repository.RepositoryEntry) Identity(org.olat.core.id.Identity) IdentityEnvironment(org.olat.core.id.IdentityEnvironment)

Aggregations

IdentityEnvironment (org.olat.core.id.IdentityEnvironment)96 UserCourseEnvironmentImpl (org.olat.course.run.userview.UserCourseEnvironmentImpl)60 UserCourseEnvironment (org.olat.course.run.userview.UserCourseEnvironment)58 Identity (org.olat.core.id.Identity)56 ICourse (org.olat.course.ICourse)52 RepositoryEntry (org.olat.repository.RepositoryEntry)34 Roles (org.olat.core.id.Roles)30 AssessableCourseNode (org.olat.course.nodes.AssessableCourseNode)22 ScoreEvaluation (org.olat.course.run.scoring.ScoreEvaluation)22 Test (org.junit.Test)20 VisibleTreeFilter (org.olat.course.run.userview.VisibleTreeFilter)20 CourseNode (org.olat.course.nodes.CourseNode)18 ArrayList (java.util.ArrayList)16 CourseTreeVisitor (org.olat.course.run.userview.CourseTreeVisitor)16 File (java.io.File)14 INode (org.olat.core.util.nodes.INode)12 Visitor (org.olat.core.util.tree.Visitor)12 VFSContainer (org.olat.core.util.vfs.VFSContainer)12 URL (java.net.URL)10 FOCourseNode (org.olat.course.nodes.FOCourseNode)10