Search in sources :

Example 6 with GradingScaleItem

use of fi.otavanopisto.muikku.schooldata.entity.GradingScaleItem in project muikku by otavanopisto.

the class EvaluationRESTService method updateWorkspaceAssessment.

@PUT
@Path("/workspaces/{WORKSPACEENTITYID}/students/{STUDENTID}/assessments/{EVALUATIONID}")
@RESTPermit(handling = Handling.INLINE, requireLoggedIn = true)
public Response updateWorkspaceAssessment(@PathParam("WORKSPACEENTITYID") Long workspaceEntityId, @PathParam("STUDENTID") String studentId, @PathParam("EVALUATIONID") String workspaceAssesmentId, WorkspaceAssessment payload) {
    if (!sessionController.isLoggedIn()) {
        return Response.status(Status.UNAUTHORIZED).build();
    }
    SchoolDataIdentifier studentIdentifier = SchoolDataIdentifier.fromId(studentId);
    if (studentIdentifier == null) {
        return Response.status(Status.BAD_REQUEST).entity(String.format("Malformed student identifier %s", studentId)).build();
    }
    WorkspaceEntity workspaceEntity = workspaceController.findWorkspaceEntityById(workspaceEntityId);
    if (workspaceEntity == null) {
        return Response.status(Status.NOT_FOUND).entity(String.format("Could not find workspace entity %d", workspaceEntityId)).build();
    }
    SchoolDataIdentifier workspaceIdentifier = new SchoolDataIdentifier(workspaceEntity.getIdentifier(), workspaceEntity.getDataSource().getIdentifier());
    WorkspaceUserEntity workspaceStudentEntity = workspaceUserEntityController.findActiveWorkspaceUserByWorkspaceEntityAndUserIdentifier(workspaceEntity, studentIdentifier);
    if (workspaceStudentEntity == null) {
        return Response.status(Status.NOT_FOUND).entity(String.format("Could not find workspace student entity %s from workspace entity %d", studentIdentifier, workspaceEntityId)).build();
    }
    SchoolDataIdentifier workspaceAssesmentIdentifier = SchoolDataIdentifier.fromId(workspaceAssesmentId);
    if (workspaceAssesmentIdentifier == null) {
        return Response.status(Status.BAD_REQUEST).entity(String.format("Malformed workspace assessment identifier %s", workspaceAssesmentIdentifier)).build();
    }
    fi.otavanopisto.muikku.schooldata.entity.WorkspaceAssessment workspaceAssessment = gradingController.findWorkspaceAssessment(workspaceIdentifier, studentIdentifier, workspaceAssesmentIdentifier);
    if (workspaceAssessment == null) {
        return Response.status(Status.NOT_FOUND).entity(String.format("Could not find workspace assessment %s from workspace entity %d, student identifer %s", workspaceAssesmentId, workspaceEntityId, studentIdentifier)).build();
    }
    if (!sessionController.hasWorkspacePermission(MuikkuPermissions.EVALUATE_USER, workspaceEntity)) {
        return Response.status(Status.FORBIDDEN).build();
    }
    if (payload.getEvaluated() == null) {
        return Response.status(Status.BAD_REQUEST).entity("evaluated is missing").build();
    }
    if (payload.getAssessorEntityId() == null) {
        return Response.status(Status.BAD_REQUEST).entity("assessorEntityId is missing").build();
    }
    UserEntity assessor = userEntityController.findUserEntityById(payload.getAssessorEntityId());
    if (assessor == null) {
        return Response.status(Status.BAD_REQUEST).entity("assessor is invalid").build();
    }
    User assessingUser = userController.findUserByUserEntityDefaults(assessor);
    if (assessingUser == null) {
        return Response.status(Status.BAD_REQUEST).entity("Could not find assessor from school data source").build();
    }
    if (payload.getGradeSchoolDataSource() == null) {
        return Response.status(Status.BAD_REQUEST).entity("gradeSchoolDataSource is missing").build();
    }
    GradingScale gradingScale = gradingController.findGradingScale(payload.getGradingScaleSchoolDataSource(), payload.getGradingScaleIdentifier());
    if (gradingScale == null) {
        return Response.status(Status.BAD_REQUEST).entity("gradingScale is invalid").build();
    }
    if (payload.getGradeIdentifier() == null) {
        return Response.status(Status.BAD_REQUEST).entity("gradeIdentifier is missing").build();
    }
    GradingScaleItem grade = gradingController.findGradingScaleItem(gradingScale, payload.getGradeSchoolDataSource(), payload.getGradeIdentifier());
    if (grade == null) {
        return Response.status(Status.BAD_REQUEST).entity("grade is invalid").build();
    }
    fi.otavanopisto.muikku.schooldata.entity.WorkspaceUser workspaceStudent = workspaceController.findWorkspaceUser(workspaceStudentEntity);
    if (workspaceStudent == null) {
        return Response.status(Status.INTERNAL_SERVER_ERROR).entity(String.format("Failed to get workspace student for workspace student entity %d from school data source", workspaceStudentEntity.getId())).build();
    }
    Date evaluated = payload.getEvaluated();
    UserEntity student = userEntityController.findUserEntityByUserIdentifier(workspaceStudent.getUserIdentifier());
    Workspace workspace = workspaceController.findWorkspace(workspaceEntity);
    fi.otavanopisto.muikku.schooldata.entity.WorkspaceAssessment assessment = gradingController.updateWorkspaceAssessment(workspaceAssesmentIdentifier, workspaceStudent, assessingUser, grade, payload.getVerbalAssessment(), evaluated);
    if (student != null && workspace != null && assessment != null) {
        sendAssessmentNotification(workspaceEntity, payload, assessor, student, workspace, grade.getName());
    }
    return Response.ok(createRestModel(workspaceEntity, assessment)).build();
}
Also used : SchoolDataIdentifier(fi.otavanopisto.muikku.schooldata.SchoolDataIdentifier) GradingScale(fi.otavanopisto.muikku.schooldata.entity.GradingScale) WorkspaceGradingScale(fi.otavanopisto.muikku.plugins.evaluation.rest.model.WorkspaceGradingScale) User(fi.otavanopisto.muikku.schooldata.entity.User) GradingScaleItem(fi.otavanopisto.muikku.schooldata.entity.GradingScaleItem) UserEntity(fi.otavanopisto.muikku.model.users.UserEntity) WorkspaceUserEntity(fi.otavanopisto.muikku.model.workspace.WorkspaceUserEntity) Date(java.util.Date) WorkspaceUserEntity(fi.otavanopisto.muikku.model.workspace.WorkspaceUserEntity) WorkspaceEntity(fi.otavanopisto.muikku.model.workspace.WorkspaceEntity) Workspace(fi.otavanopisto.muikku.schooldata.entity.Workspace) Path(javax.ws.rs.Path) RESTPermit(fi.otavanopisto.security.rest.RESTPermit) PUT(javax.ws.rs.PUT)

Example 7 with GradingScaleItem

use of fi.otavanopisto.muikku.schooldata.entity.GradingScaleItem in project muikku by otavanopisto.

the class Evaluation2RESTService method listWorkspaceAssignments.

@GET
@Path("/workspace/{WORKSPACEENTITYID}/assignments")
@RESTPermit(handling = Handling.INLINE)
public Response listWorkspaceAssignments(@PathParam("WORKSPACEENTITYID") Long workspaceEntityId, @QueryParam("userEntityId") Long userEntityId) {
    // Workspace entity
    WorkspaceEntity workspaceEntity = workspaceEntityController.findWorkspaceEntityById(workspaceEntityId);
    if (workspaceEntity == null) {
        return Response.status(Status.NOT_FOUND).build();
    }
    // User entity (optional)
    UserEntity userEntity = null;
    if (userEntityId != null) {
        userEntity = userEntityController.findUserEntityById(userEntityId);
        if (userEntity == null) {
            return Response.status(Status.NOT_FOUND).build();
        }
    }
    // Workspace materials...
    List<WorkspaceMaterial> workspaceMaterials = workspaceMaterialController.listWorkspaceMaterialsByAssignmentType(workspaceEntity, WorkspaceMaterialAssignmentType.EVALUATED, BooleanPredicate.IGNORE);
    workspaceMaterials.addAll(workspaceMaterialController.listWorkspaceMaterialsByAssignmentType(workspaceEntity, WorkspaceMaterialAssignmentType.EXERCISE, BooleanPredicate.IGNORE));
    // ...to RestAssignments
    List<RestAssignment> assignments = new ArrayList<RestAssignment>();
    for (WorkspaceMaterial workspaceMaterial : workspaceMaterials) {
        Long workspaceMaterialEvaluationId = null;
        Long workspaceMaterialId = workspaceMaterial.getId();
        Long materialId = workspaceMaterial.getMaterialId();
        String path = workspaceMaterial.getPath();
        String title = workspaceMaterial.getTitle();
        Boolean evaluable = workspaceMaterial.getAssignmentType() == WorkspaceMaterialAssignmentType.EVALUATED;
        Date submitted = null;
        Date evaluated = null;
        String grade = null;
        String literalEvaluation = null;
        if (userEntity != null) {
            WorkspaceMaterialReply workspaceMaterialReply = workspaceMaterialReplyController.findWorkspaceMaterialReplyByWorkspaceMaterialAndUserEntity(workspaceMaterial, userEntity);
            if (workspaceMaterialReply != null) {
                WorkspaceMaterialReplyState replyState = workspaceMaterialReply.getState();
                if (replyState == WorkspaceMaterialReplyState.SUBMITTED || replyState == WorkspaceMaterialReplyState.PASSED || replyState == WorkspaceMaterialReplyState.FAILED || replyState == WorkspaceMaterialReplyState.INCOMPLETE) {
                    submitted = workspaceMaterialReply.getLastModified();
                }
            } else if (workspaceMaterial.getHidden()) {
                // Skip hidden material which has no reply
                continue;
            }
            WorkspaceMaterialEvaluation workspaceMaterialEvaluation = evaluationController.findWorkspaceMaterialEvaluationByWorkspaceMaterialAndStudent(workspaceMaterial, userEntity);
            if (workspaceMaterialEvaluation != null) {
                workspaceMaterialEvaluationId = workspaceMaterialEvaluation.getId();
                evaluated = workspaceMaterialEvaluation.getEvaluated();
                GradingScale gradingScale = gradingController.findGradingScale(workspaceMaterialEvaluation.getGradingScaleSchoolDataSource(), workspaceMaterialEvaluation.getGradingScaleIdentifier());
                if (gradingScale != null) {
                    GradingScaleItem gradingScaleItem = gradingController.findGradingScaleItem(gradingScale, workspaceMaterialEvaluation.getGradeSchoolDataSource(), workspaceMaterialEvaluation.getGradeIdentifier());
                    if (gradingScaleItem != null) {
                        grade = gradingScaleItem.getName();
                    }
                }
                literalEvaluation = workspaceMaterialEvaluation.getVerbalAssessment();
            } else {
                SupplementationRequest supplementationRequest = evaluationController.findSupplementationRequestByStudentAndWorkspaceMaterialAndArchived(userEntity.getId(), workspaceMaterial.getId(), Boolean.FALSE);
                if (supplementationRequest != null) {
                    evaluated = supplementationRequest.getRequestDate();
                    literalEvaluation = supplementationRequest.getRequestText();
                }
            }
        }
        if (!(workspaceMaterial.getHidden() && submitted == null)) {
            assignments.add(new RestAssignment(workspaceMaterialEvaluationId, workspaceMaterialId, materialId, path, title, evaluable, submitted, evaluated, grade, literalEvaluation));
        }
    }
    return Response.ok(assignments).build();
}
Also used : CompositeGradingScale(fi.otavanopisto.muikku.schooldata.entity.CompositeGradingScale) GradingScale(fi.otavanopisto.muikku.schooldata.entity.GradingScale) WorkspaceGradingScale(fi.otavanopisto.muikku.plugins.evaluation.rest.model.WorkspaceGradingScale) RestAssignment(fi.otavanopisto.muikku.plugins.evaluation.rest.model.RestAssignment) WorkspaceMaterialReply(fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceMaterialReply) GradingScaleItem(fi.otavanopisto.muikku.schooldata.entity.GradingScaleItem) ArrayList(java.util.ArrayList) UserEntity(fi.otavanopisto.muikku.model.users.UserEntity) WorkspaceUserEntity(fi.otavanopisto.muikku.model.workspace.WorkspaceUserEntity) WorkspaceMaterial(fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceMaterial) Date(java.util.Date) WorkspaceEntity(fi.otavanopisto.muikku.model.workspace.WorkspaceEntity) WorkspaceMaterialEvaluation(fi.otavanopisto.muikku.plugins.evaluation.model.WorkspaceMaterialEvaluation) SupplementationRequest(fi.otavanopisto.muikku.plugins.evaluation.model.SupplementationRequest) RestSupplementationRequest(fi.otavanopisto.muikku.plugins.evaluation.rest.model.RestSupplementationRequest) WorkspaceMaterialReplyState(fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceMaterialReplyState) Path(javax.ws.rs.Path) RESTPermit(fi.otavanopisto.security.rest.RESTPermit) GET(javax.ws.rs.GET)

Example 8 with GradingScaleItem

use of fi.otavanopisto.muikku.schooldata.entity.GradingScaleItem in project muikku by otavanopisto.

the class Evaluation2RESTService method updateWorkspaceMaterialAssessment.

@PUT
@Path("/workspace/{WORKSPACEENTITYID}/user/{USERENTITYID}/workspacematerial/{WORKSPACEMATERIALID}/assessment")
@RESTPermit(handling = Handling.INLINE, requireLoggedIn = true)
public Response updateWorkspaceMaterialAssessment(@PathParam("WORKSPACEENTITYID") Long workspaceEntityId, @PathParam("USERENTITYID") Long userEntityId, @PathParam("WORKSPACEMATERIALID") Long workspaceMaterialId, RestAssessment payload) {
    if (!sessionController.isLoggedIn()) {
        return Response.status(Status.UNAUTHORIZED).build();
    }
    if (!sessionController.hasEnvironmentPermission(MuikkuPermissions.ACCESS_EVALUATION)) {
        return Response.status(Status.FORBIDDEN).build();
    }
    // User entity
    UserEntity userEntity = userEntityController.findUserEntityById(userEntityId);
    if (userEntity == null) {
        return Response.status(Status.BAD_REQUEST).build();
    }
    // Workspace material
    WorkspaceMaterial workspaceMaterial = workspaceMaterialController.findWorkspaceMaterialById(workspaceMaterialId);
    if (workspaceMaterial == null) {
        return Response.status(Status.BAD_REQUEST).build();
    }
    // Workspace material evaluation
    WorkspaceMaterialEvaluation workspaceMaterialEvaluation = evaluationController.findWorkspaceMaterialEvaluationByWorkspaceMaterialAndStudent(workspaceMaterial, userEntity);
    if (workspaceMaterialEvaluation == null) {
        return Response.status(Status.BAD_REQUEST).build();
    }
    // Grade
    SchoolDataIdentifier gradingScaleIdentifier = SchoolDataIdentifier.fromId(payload.getGradingScaleIdentifier());
    GradingScale gradingScale = gradingController.findGradingScale(gradingScaleIdentifier);
    SchoolDataIdentifier gradeIdentifier = SchoolDataIdentifier.fromId(payload.getGradeIdentifier());
    GradingScaleItem gradingScaleItem = gradingController.findGradingScaleItem(gradingScale, gradeIdentifier);
    // Assessor
    SchoolDataIdentifier assessorIdentifier = SchoolDataIdentifier.fromId(payload.getAssessorIdentifier());
    User assessingUser = userController.findUserByIdentifier(assessorIdentifier);
    UserEntity assessor = userEntityController.findUserEntityByUser(assessingUser);
    workspaceMaterialEvaluation = evaluationController.updateWorkspaceMaterialEvaluation(workspaceMaterialEvaluation, gradingScale, gradingScaleItem, assessor, payload.getAssessmentDate(), payload.getVerbalAssessment());
    // WorkspaceMaterialEvaluation to RestAssessment
    RestAssessment restAssessment = new RestAssessment(workspaceMaterialEvaluation.getId().toString(), assessorIdentifier.toId(), gradingScaleIdentifier.toId(), gradeIdentifier.toId(), workspaceMaterialEvaluation.getVerbalAssessment(), workspaceMaterialEvaluation.getEvaluated(), gradingScaleItem.isPassingGrade());
    return Response.ok(restAssessment).build();
}
Also used : SchoolDataIdentifier(fi.otavanopisto.muikku.schooldata.SchoolDataIdentifier) CompositeGradingScale(fi.otavanopisto.muikku.schooldata.entity.CompositeGradingScale) GradingScale(fi.otavanopisto.muikku.schooldata.entity.GradingScale) WorkspaceGradingScale(fi.otavanopisto.muikku.plugins.evaluation.rest.model.WorkspaceGradingScale) User(fi.otavanopisto.muikku.schooldata.entity.User) WorkspaceUser(fi.otavanopisto.muikku.schooldata.entity.WorkspaceUser) WorkspaceMaterialEvaluation(fi.otavanopisto.muikku.plugins.evaluation.model.WorkspaceMaterialEvaluation) GradingScaleItem(fi.otavanopisto.muikku.schooldata.entity.GradingScaleItem) RestAssessment(fi.otavanopisto.muikku.plugins.evaluation.rest.model.RestAssessment) UserEntity(fi.otavanopisto.muikku.model.users.UserEntity) WorkspaceUserEntity(fi.otavanopisto.muikku.model.workspace.WorkspaceUserEntity) WorkspaceMaterial(fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceMaterial) Path(javax.ws.rs.Path) RESTPermit(fi.otavanopisto.security.rest.RESTPermit) PUT(javax.ws.rs.PUT)

Example 9 with GradingScaleItem

use of fi.otavanopisto.muikku.schooldata.entity.GradingScaleItem in project muikku by otavanopisto.

the class VopsLister method processTransferCredits.

private VopsRESTModel.VopsEntry processTransferCredits(Subject subject, int courseNumber) {
    for (TransferCredit transferCredit : transferCredits) {
        boolean subjectsMatch = Objects.equals(transferCredit.getSubjectIdentifier(), new SchoolDataIdentifier(subject.getIdentifier(), subject.getSchoolDataSource()));
        boolean courseNumbersMatch = Objects.equals(transferCredit.getCourseNumber(), courseNumber);
        if (subjectsMatch && courseNumbersMatch) {
            String grade = "";
            GradingScaleItem gradingScaleItem = null;
            Mandatority mandatority = Mandatority.MANDATORY;
            if (transferCredit.getOptionality() == Optionality.OPTIONAL) {
                mandatority = Mandatority.UNSPECIFIED_OPTIONAL;
            }
            if (transferCredit.getGradeIdentifier() != null && transferCredit.getGradingScaleIdentifier() != null) {
                gradingScaleItem = findGradingScaleItemCached(transferCredit.getGradingScaleIdentifier(), transferCredit.getGradeIdentifier());
                String gradeName = gradingScaleItem.getName();
                if (!StringUtils.isBlank(gradeName)) {
                    if (gradeName.length() > 2)
                        grade = gradeName.substring(0, 2);
                    else
                        grade = gradeName;
                }
            }
            numCourses++;
            if (mandatority == Mandatority.MANDATORY) {
                numMandatoryCourses++;
            }
            return new VopsRESTModel.VopsItem(courseNumber, CourseCompletionState.ASSESSED, (String) null, mandatority, grade, false, transferCredit.getCourseName(), "");
        }
    }
    return null;
}
Also used : SchoolDataIdentifier(fi.otavanopisto.muikku.schooldata.SchoolDataIdentifier) Mandatority(fi.otavanopisto.muikku.plugins.transcriptofrecords.rest.Mandatority) GradingScaleItem(fi.otavanopisto.muikku.schooldata.entity.GradingScaleItem) TransferCredit(fi.otavanopisto.muikku.schooldata.entity.TransferCredit)

Example 10 with GradingScaleItem

use of fi.otavanopisto.muikku.schooldata.entity.GradingScaleItem in project muikku by otavanopisto.

the class VopsLister method processCourse.

private VopsRESTModel.VopsEntry processCourse(Subject subject, int courseNumber) {
    VopsRESTModel.VopsEntry transferCreditEntry = processTransferCredits(subject, courseNumber);
    if (transferCreditEntry != null) {
        return transferCreditEntry;
    }
    List<VopsWorkspace> workspaces = vopsController.listWorkspaceIdentifiersBySubjectIdentifierAndCourseNumber(subject.getSchoolDataSource(), subject.getIdentifier(), courseNumber);
    List<WorkspaceAssessment> workspaceAssessments = new ArrayList<>();
    if (curriculumIdentifier != null) {
        workspaces.removeIf((VopsWorkspace workspace) -> !workspace.getCurriculumIdentifiers().contains(curriculumIdentifier));
    }
    if (!workspaces.isEmpty()) {
        SchoolDataIdentifier educationSubtypeIdentifier = null;
        boolean workspaceUserExists = false;
        String name = "";
        String description = "";
        boolean canSignUp = false;
        for (VopsWorkspace workspace : workspaces) {
            WorkspaceEntity workspaceEntity = workspaceController.findWorkspaceEntityById(workspace.getWorkspaceIdentifier());
            WorkspaceUserEntity workspaceUser = workspaceUserEntityController.findWorkspaceUserByWorkspaceEntityAndUserIdentifier(workspaceEntity, studentIdentifier);
            WorkspaceAssessment workspaceAssesment = studentAssessments.get(workspace.getWorkspaceIdentifier());
            List<UserGroupEntity> userGroupEntities = userGroupEntityController.listUserGroupsByUserIdentifier(studentIdentifier);
            Permission permission = permissionController.findByName(MuikkuPermissions.WORKSPACE_SIGNUP);
            for (UserGroupEntity userGroupEntity : userGroupEntities) {
                if (permissionController.hasWorkspaceGroupPermission(workspaceEntity, userGroupEntity, permission)) {
                    canSignUp = true;
                    break;
                }
            }
            if (workspaceAssesment != null) {
                workspaceAssessments.add(workspaceAssesment);
            }
            if (workspaceUser != null) {
                workspaceUserExists = true;
            }
        }
        for (VopsWorkspace workspace : workspaces) {
            name = workspace.getName();
            if (name != null) {
                break;
            }
        }
        for (VopsWorkspace workspace : workspaces) {
            description = workspace.getDescription();
            if (description != null) {
                break;
            }
        }
        for (VopsWorkspace workspace : workspaces) {
            educationSubtypeIdentifier = workspace.getEducationSubtypeIdentifier();
            if (educationSubtypeIdentifier != null) {
                break;
            }
        }
        Mandatority mandatority = educationTypeMapping.getMandatority(educationSubtypeIdentifier);
        CourseCompletionState state = CourseCompletionState.NOT_ENROLLED;
        String grade = null;
        if (workspaceUserExists) {
            state = CourseCompletionState.ENROLLED;
        }
        for (WorkspaceAssessment workspaceAssessment : workspaceAssessments) {
            if (!Boolean.TRUE.equals(workspaceAssessment.getPassing())) {
                state = CourseCompletionState.FAILED;
                break;
            }
        }
        for (WorkspaceAssessment workspaceAssessment : workspaceAssessments) {
            if (Boolean.TRUE.equals(workspaceAssessment.getPassing())) {
                state = CourseCompletionState.ASSESSED;
                numCourses++;
                if (mandatority == Mandatority.MANDATORY) {
                    numMandatoryCourses++;
                }
                SchoolDataIdentifier gradingScaleIdentifier = workspaceAssessment.getGradingScaleIdentifier();
                if (gradingScaleIdentifier == null) {
                    break;
                }
                SchoolDataIdentifier gradeIdentifier = workspaceAssessment.getGradeIdentifier();
                if (gradeIdentifier == null) {
                    break;
                }
                GradingScaleItem gradingScaleItem = findGradingScaleItemCached(gradingScaleIdentifier, gradeIdentifier);
                String gradeName = gradingScaleItem.getName();
                if (!StringUtils.isBlank(gradeName)) {
                    if (gradeName.length() > 2)
                        grade = gradeName.substring(0, 2);
                    else
                        grade = gradeName;
                }
                break;
            }
        }
        if (state == CourseCompletionState.NOT_ENROLLED && !canSignUp) {
            return new VopsRESTModel.VopsPlaceholder();
        }
        StudiesViewCourseChoice courseChoice = studiesViewCourseChoiceController.find(new SchoolDataIdentifier(subject.getIdentifier(), subject.getSchoolDataSource()).toId(), courseNumber, studentIdentifierString);
        if (state == CourseCompletionState.NOT_ENROLLED && courseChoice != null) {
            state = CourseCompletionState.PLANNED;
        }
        return new VopsRESTModel.VopsItem(courseNumber, state, educationSubtypeIdentifier != null ? educationSubtypeIdentifier.toId() : null, mandatority, grade, workspaceUserExists, clean(name), clean(description));
    }
    return new VopsRESTModel.VopsPlaceholder();
}
Also used : SchoolDataIdentifier(fi.otavanopisto.muikku.schooldata.SchoolDataIdentifier) WorkspaceAssessment(fi.otavanopisto.muikku.schooldata.entity.WorkspaceAssessment) GradingScaleItem(fi.otavanopisto.muikku.schooldata.entity.GradingScaleItem) ArrayList(java.util.ArrayList) UserGroupEntity(fi.otavanopisto.muikku.model.users.UserGroupEntity) StudiesViewCourseChoice(fi.otavanopisto.muikku.plugins.transcriptofrecords.model.StudiesViewCourseChoice) WorkspaceUserEntity(fi.otavanopisto.muikku.model.workspace.WorkspaceUserEntity) WorkspaceEntity(fi.otavanopisto.muikku.model.workspace.WorkspaceEntity) Mandatority(fi.otavanopisto.muikku.plugins.transcriptofrecords.rest.Mandatority) Permission(fi.otavanopisto.muikku.model.security.Permission) VopsRESTModel(fi.otavanopisto.muikku.plugins.transcriptofrecords.rest.VopsRESTModel) CourseCompletionState(fi.otavanopisto.muikku.plugins.transcriptofrecords.rest.CourseCompletionState)

Aggregations

GradingScaleItem (fi.otavanopisto.muikku.schooldata.entity.GradingScaleItem)17 GradingScale (fi.otavanopisto.muikku.schooldata.entity.GradingScale)15 WorkspaceGradingScale (fi.otavanopisto.muikku.plugins.evaluation.rest.model.WorkspaceGradingScale)12 UserEntity (fi.otavanopisto.muikku.model.users.UserEntity)11 WorkspaceUserEntity (fi.otavanopisto.muikku.model.workspace.WorkspaceUserEntity)11 WorkspaceEntity (fi.otavanopisto.muikku.model.workspace.WorkspaceEntity)10 SchoolDataIdentifier (fi.otavanopisto.muikku.schooldata.SchoolDataIdentifier)10 RESTPermit (fi.otavanopisto.security.rest.RESTPermit)10 Path (javax.ws.rs.Path)10 User (fi.otavanopisto.muikku.schooldata.entity.User)7 WorkspaceMaterial (fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceMaterial)5 CompositeGradingScale (fi.otavanopisto.muikku.schooldata.entity.CompositeGradingScale)5 Date (java.util.Date)5 RestAssessment (fi.otavanopisto.muikku.plugins.evaluation.rest.model.RestAssessment)4 Workspace (fi.otavanopisto.muikku.schooldata.entity.Workspace)4 WorkspaceAssessment (fi.otavanopisto.muikku.schooldata.entity.WorkspaceAssessment)4 WorkspaceUser (fi.otavanopisto.muikku.schooldata.entity.WorkspaceUser)4 PUT (javax.ws.rs.PUT)4 SupplementationRequest (fi.otavanopisto.muikku.plugins.evaluation.model.SupplementationRequest)3 WorkspaceMaterialEvaluation (fi.otavanopisto.muikku.plugins.evaluation.model.WorkspaceMaterialEvaluation)3