Search in sources :

Example 11 with WorkspaceRootFolder

use of fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceRootFolder in project muikku by otavanopisto.

the class EvaluationRESTService method listWorkspaceMaterialEvaluations.

@GET
@Path("/workspaces/{WORKSPACEENTITYID}/materials/{WORKSPACEMATERIALID}/evaluations/")
@RESTPermit(handling = Handling.INLINE)
public Response listWorkspaceMaterialEvaluations(@PathParam("WORKSPACEENTITYID") Long workspaceEntityId, @PathParam("WORKSPACEMATERIALID") Long workspaceMaterialId, @QueryParam("userEntityId") Long userEntityId) {
    if (!sessionController.isLoggedIn()) {
        return Response.status(Status.UNAUTHORIZED).build();
    }
    if (userEntityId == null) {
        return Response.status(Status.NOT_IMPLEMENTED).entity("Listing workspace material evaluations without userEntityId is not implemented yet").build();
    }
    UserEntity userEntity = userEntityController.findUserEntityById(userEntityId);
    if (userEntity == null) {
        return Response.status(Status.BAD_REQUEST).entity("Invalid user entity id").build();
    }
    WorkspaceEntity workspaceEntity = workspaceEntityController.findWorkspaceEntityById(workspaceEntityId);
    if (workspaceEntity == null) {
        return Response.status(Status.NOT_FOUND).build();
    }
    if (!sessionController.getLoggedUserEntity().getId().equals(userEntity.getId())) {
        if (!sessionController.hasWorkspacePermission(EvaluationResourcePermissionCollection.EVALUATION_LISTWORKSPACEMATERIALEVALUATIONS, workspaceEntity)) {
            return Response.status(Status.FORBIDDEN).build();
        }
    }
    WorkspaceMaterial workspaceMaterial = workspaceMaterialController.findWorkspaceMaterialById(workspaceMaterialId);
    if (workspaceMaterial == null) {
        return Response.status(Status.NOT_FOUND).entity("workspaceMaterial not found").build();
    }
    WorkspaceRootFolder rootFolder = workspaceMaterialController.findWorkspaceRootFolderByWorkspaceNode(workspaceMaterial);
    if (rootFolder == null) {
        return Response.status(Status.NOT_FOUND).build();
    }
    if (!workspaceEntity.getId().equals(rootFolder.getWorkspaceEntityId())) {
        return Response.status(Status.NOT_FOUND).build();
    }
    List<fi.otavanopisto.muikku.plugins.evaluation.model.WorkspaceMaterialEvaluation> result = new ArrayList<>();
    fi.otavanopisto.muikku.plugins.evaluation.model.WorkspaceMaterialEvaluation workspaceMaterialEvaluation = evaluationController.findWorkspaceMaterialEvaluationByWorkspaceMaterialAndStudent(workspaceMaterial, userEntity);
    if (workspaceMaterialEvaluation != null) {
        result.add(workspaceMaterialEvaluation);
    }
    if (result.isEmpty()) {
        return Response.ok(Collections.emptyList()).build();
    }
    if (!workspaceMaterialEvaluation.getWorkspaceMaterialId().equals(workspaceMaterial.getId())) {
        return Response.status(Status.NOT_FOUND).build();
    }
    return Response.ok(createRestModel(result.toArray(new fi.otavanopisto.muikku.plugins.evaluation.model.WorkspaceMaterialEvaluation[0]))).build();
}
Also used : 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) WorkspaceEntity(fi.otavanopisto.muikku.model.workspace.WorkspaceEntity) WorkspaceMaterialEvaluation(fi.otavanopisto.muikku.plugins.evaluation.rest.model.WorkspaceMaterialEvaluation) WorkspaceRootFolder(fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceRootFolder) Path(javax.ws.rs.Path) RESTPermit(fi.otavanopisto.security.rest.RESTPermit) GET(javax.ws.rs.GET)

Example 12 with WorkspaceRootFolder

use of fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceRootFolder in project muikku by otavanopisto.

the class EvaluationRESTService method updateWorkspaceMaterialEvaluation.

@PUT
@Path("/workspaces/{WORKSPACEENTITYID}/materials/{WORKSPACEMATERIALID}/evaluations/{ID}")
@RESTPermit(handling = Handling.INLINE)
public Response updateWorkspaceMaterialEvaluation(@PathParam("WORKSPACEENTITYID") Long workspaceEntityId, @PathParam("WORKSPACEMATERIALID") Long workspaceMaterialId, @PathParam("ID") Long workspaceMaterialEvaluationId, WorkspaceMaterialEvaluation payload) {
    if (!sessionController.isLoggedIn()) {
        return Response.status(Status.UNAUTHORIZED).build();
    }
    WorkspaceEntity workspaceEntity = workspaceEntityController.findWorkspaceEntityById(workspaceEntityId);
    if (workspaceEntity == null) {
        return Response.status(Status.NOT_FOUND).build();
    }
    if (!sessionController.hasWorkspacePermission(EvaluationResourcePermissionCollection.EVALUATION_UPDATEWORKSPACEMATERIALEVALUATION, workspaceEntity)) {
        return Response.status(Status.FORBIDDEN).build();
    }
    WorkspaceMaterial workspaceMaterial = workspaceMaterialController.findWorkspaceMaterialById(workspaceMaterialId);
    if (workspaceMaterial == null) {
        return Response.status(Status.NOT_FOUND).entity("workspaceMaterial not found").build();
    }
    WorkspaceRootFolder rootFolder = workspaceMaterialController.findWorkspaceRootFolderByWorkspaceNode(workspaceMaterial);
    if (rootFolder == null) {
        return Response.status(Status.INTERNAL_SERVER_ERROR).build();
    }
    if (!workspaceEntity.getId().equals(rootFolder.getWorkspaceEntityId())) {
        return Response.status(Status.NOT_FOUND).build();
    }
    fi.otavanopisto.muikku.plugins.evaluation.model.WorkspaceMaterialEvaluation workspaceMaterialEvaluation = evaluationController.findWorkspaceMaterialEvaluation(workspaceMaterialEvaluationId);
    if (workspaceMaterialEvaluation == null) {
        return Response.status(Status.NOT_FOUND).build();
    }
    if (!workspaceMaterialEvaluation.getWorkspaceMaterialId().equals(workspaceMaterial.getId())) {
        return Response.status(Status.NOT_FOUND).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();
    }
    if (payload.getGradingScaleSchoolDataSource() == null) {
        return Response.status(Status.BAD_REQUEST).entity("gradingScaleSchoolDataSource is missing").build();
    }
    if (payload.getGradingScaleIdentifier() == null) {
        return Response.status(Status.BAD_REQUEST).entity("gradingScaleIdentifier is missing").build();
    }
    if (payload.getGradeSchoolDataSource() == null) {
        return Response.status(Status.BAD_REQUEST).entity("gradeSchoolDataSource is missing").build();
    }
    if (payload.getGradeIdentifier() == null) {
        return Response.status(Status.BAD_REQUEST).entity("gradeIdentifier is missing").build();
    }
    UserEntity assessor = userEntityController.findUserEntityById(payload.getAssessorEntityId());
    UserEntity student = userEntityController.findUserEntityById(payload.getStudentEntityId());
    GradingScale gradingScale = gradingController.findGradingScale(payload.getGradingScaleSchoolDataSource(), payload.getGradingScaleIdentifier());
    GradingScaleItem grade = gradingController.findGradingScaleItem(gradingScale, payload.getGradeSchoolDataSource(), payload.getGradeIdentifier());
    if (assessor == null) {
        return Response.status(Status.BAD_REQUEST).entity("assessor is invalid").build();
    }
    if (student == null) {
        return Response.status(Status.BAD_REQUEST).entity("student is invalid").build();
    }
    if (gradingScale == null) {
        return Response.status(Status.BAD_REQUEST).entity("gradingScale is invalid").build();
    }
    if (grade == null) {
        return Response.status(Status.BAD_REQUEST).entity("grade is invalid").build();
    }
    Date evaluated = payload.getEvaluated();
    workspaceMaterialEvaluation = evaluationController.updateWorkspaceMaterialEvaluation(workspaceMaterialEvaluation, gradingScale, grade, assessor, evaluated, payload.getVerbalAssessment());
    return Response.ok(createRestModel(workspaceMaterialEvaluation)).build();
}
Also used : GradingScale(fi.otavanopisto.muikku.schooldata.entity.GradingScale) WorkspaceGradingScale(fi.otavanopisto.muikku.plugins.evaluation.rest.model.WorkspaceGradingScale) WorkspaceEntity(fi.otavanopisto.muikku.model.workspace.WorkspaceEntity) GradingScaleItem(fi.otavanopisto.muikku.schooldata.entity.GradingScaleItem) WorkspaceMaterial(fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceMaterial) UserEntity(fi.otavanopisto.muikku.model.users.UserEntity) WorkspaceUserEntity(fi.otavanopisto.muikku.model.workspace.WorkspaceUserEntity) Date(java.util.Date) WorkspaceRootFolder(fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceRootFolder) Path(javax.ws.rs.Path) RESTPermit(fi.otavanopisto.security.rest.RESTPermit) PUT(javax.ws.rs.PUT)

Example 13 with WorkspaceRootFolder

use of fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceRootFolder in project muikku by otavanopisto.

the class EvaluationRESTService method createOrUpdateWorkspaceMaterialEvaluation.

@POST
@Path("/workspaces/{WORKSPACEENTITYID}/materials/{WORKSPACEMATERIALID}/evaluations/")
@RESTPermit(handling = Handling.INLINE)
public Response createOrUpdateWorkspaceMaterialEvaluation(@PathParam("WORKSPACEENTITYID") Long workspaceEntityId, @PathParam("WORKSPACEMATERIALID") Long workspaceMaterialId, WorkspaceMaterialEvaluation payload) {
    if (!sessionController.isLoggedIn()) {
        return Response.status(Status.UNAUTHORIZED).build();
    }
    WorkspaceEntity workspaceEntity = workspaceEntityController.findWorkspaceEntityById(workspaceEntityId);
    if (workspaceEntity == null) {
        return Response.status(Status.NOT_FOUND).build();
    }
    if (!sessionController.hasWorkspacePermission(EvaluationResourcePermissionCollection.EVALUATION_CREATEWORKSPACEMATERIALEVALUATION, workspaceEntity)) {
        return Response.status(Status.FORBIDDEN).build();
    }
    WorkspaceMaterial workspaceMaterial = workspaceMaterialController.findWorkspaceMaterialById(workspaceMaterialId);
    if (workspaceMaterial == null) {
        return Response.status(Status.NOT_FOUND).entity("workspaceMaterial not found").build();
    }
    WorkspaceRootFolder rootFolder = workspaceMaterialController.findWorkspaceRootFolderByWorkspaceNode(workspaceMaterial);
    if (rootFolder == null) {
        return Response.status(Status.INTERNAL_SERVER_ERROR).build();
    }
    if (!workspaceEntity.getId().equals(rootFolder.getWorkspaceEntityId())) {
        return Response.status(Status.NOT_FOUND).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();
    }
    if (payload.getStudentEntityId() == null) {
        return Response.status(Status.BAD_REQUEST).entity("studentEntityId is missing").build();
    }
    if (payload.getGradingScaleSchoolDataSource() == null) {
        return Response.status(Status.BAD_REQUEST).entity("gradingScaleSchoolDataSource is missing").build();
    }
    if (payload.getGradingScaleIdentifier() == null) {
        return Response.status(Status.BAD_REQUEST).entity("gradingScaleIdentifier is missing").build();
    }
    if (payload.getGradeSchoolDataSource() == null) {
        return Response.status(Status.BAD_REQUEST).entity("gradeSchoolDataSource is missing").build();
    }
    if (payload.getGradeIdentifier() == null) {
        return Response.status(Status.BAD_REQUEST).entity("gradeIdentifier is missing").build();
    }
    UserEntity assessor = userEntityController.findUserEntityById(payload.getAssessorEntityId());
    UserEntity student = userEntityController.findUserEntityById(payload.getStudentEntityId());
    GradingScale gradingScale = gradingController.findGradingScale(payload.getGradingScaleSchoolDataSource(), payload.getGradingScaleIdentifier());
    GradingScaleItem grade = gradingController.findGradingScaleItem(gradingScale, payload.getGradeSchoolDataSource(), payload.getGradeIdentifier());
    if (assessor == null) {
        return Response.status(Status.BAD_REQUEST).entity("assessor is invalid").build();
    }
    if (student == null) {
        return Response.status(Status.BAD_REQUEST).entity("student is invalid").build();
    }
    if (gradingScale == null) {
        return Response.status(Status.BAD_REQUEST).entity("gradingScale is invalid").build();
    }
    if (grade == null) {
        return Response.status(Status.BAD_REQUEST).entity("grade is invalid").build();
    }
    if (evaluationController.findWorkspaceMaterialEvaluationByWorkspaceMaterialAndStudent(workspaceMaterial, student) != null) {
        return Response.status(Status.BAD_REQUEST).entity("material already evaluated").build();
    }
    Date evaluated = payload.getEvaluated();
    return Response.ok(createRestModel(evaluationController.createWorkspaceMaterialEvaluation(student, workspaceMaterial, gradingScale, grade, assessor, evaluated, payload.getVerbalAssessment()))).build();
}
Also used : GradingScale(fi.otavanopisto.muikku.schooldata.entity.GradingScale) WorkspaceGradingScale(fi.otavanopisto.muikku.plugins.evaluation.rest.model.WorkspaceGradingScale) WorkspaceEntity(fi.otavanopisto.muikku.model.workspace.WorkspaceEntity) GradingScaleItem(fi.otavanopisto.muikku.schooldata.entity.GradingScaleItem) WorkspaceMaterial(fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceMaterial) UserEntity(fi.otavanopisto.muikku.model.users.UserEntity) WorkspaceUserEntity(fi.otavanopisto.muikku.model.workspace.WorkspaceUserEntity) Date(java.util.Date) WorkspaceRootFolder(fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceRootFolder) Path(javax.ws.rs.Path) RESTPermit(fi.otavanopisto.security.rest.RESTPermit) POST(javax.ws.rs.POST)

Example 14 with WorkspaceRootFolder

use of fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceRootFolder in project muikku by otavanopisto.

the class WorkspaceRESTService method getAllFileAnswers.

@GET
@Produces("application/zip")
@Path("/allfileanswers/{FILEID}")
@RESTPermit(handling = Handling.INLINE)
public Response getAllFileAnswers(@PathParam("FILEID") String fileId, @QueryParam("archiveName") String archiveName) {
    if (!sessionController.isLoggedIn()) {
        return Response.status(Status.UNAUTHORIZED).build();
    }
    // Find the initial file
    WorkspaceMaterialFileFieldAnswerFile answerFile = workspaceMaterialFieldAnswerController.findWorkspaceMaterialFileFieldAnswerFileByFileId(fileId);
    if (answerFile == null) {
        return Response.status(Status.NOT_FOUND).build();
    }
    // Access check
    fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceMaterialReply workspaceMaterialReply = answerFile.getFieldAnswer().getReply();
    if (workspaceMaterialReply == null) {
        return Response.status(Status.INTERNAL_SERVER_ERROR).entity(String.format("Could not find reply from answer file %d", answerFile.getId())).build();
    }
    WorkspaceMaterial workspaceMaterial = workspaceMaterialReply.getWorkspaceMaterial();
    if (workspaceMaterial == null) {
        return Response.status(Status.INTERNAL_SERVER_ERROR).entity(String.format("Could not find workspace material from reply %d", workspaceMaterialReply.getId())).build();
    }
    WorkspaceRootFolder workspaceRootFolder = workspaceMaterialController.findWorkspaceRootFolderByWorkspaceNode(workspaceMaterial);
    if (workspaceRootFolder == null) {
        return Response.status(Status.INTERNAL_SERVER_ERROR).entity(String.format("Could not find workspace root folder for material %d", workspaceMaterial.getId())).build();
    }
    WorkspaceEntity workspaceEntity = workspaceEntityController.findWorkspaceEntityById(workspaceRootFolder.getWorkspaceEntityId());
    if (workspaceEntity == null) {
        return Response.status(Status.INTERNAL_SERVER_ERROR).entity(String.format("Could not find workspace entity for root folder %d", workspaceRootFolder.getId())).build();
    }
    if (!workspaceMaterialReply.getUserEntityId().equals(sessionController.getLoggedUserEntity().getId())) {
        if (!sessionController.hasWorkspacePermission(MuikkuPermissions.ACCESS_STUDENT_ANSWERS, workspaceEntity)) {
            return Response.status(Status.FORBIDDEN).build();
        }
    }
    // Fetch all files belonging to the same answer as the initial file
    List<WorkspaceMaterialFileFieldAnswerFile> answerFiles = workspaceMaterialFieldAnswerController.listWorkspaceMaterialFileFieldAnswerFilesByFieldAnswer(answerFile.getFieldAnswer());
    if (CollectionUtils.isEmpty(answerFiles)) {
        return Response.status(Status.INTERNAL_SERVER_ERROR).entity(String.format("answerFiles not found")).build();
    }
    try {
        Set<String> fileNames = new HashSet<String>();
        StreamingOutput output = new StreamingOutput() {

            @Override
            public void write(OutputStream out) throws IOException {
                ZipOutputStream zout = new ZipOutputStream(out);
                for (WorkspaceMaterialFileFieldAnswerFile file : answerFiles) {
                    // Prevent duplicate file names
                    String fileName = file.getFileName();
                    if (fileNames.contains(fileName)) {
                        int counter = 1;
                        String name = file.getFileName();
                        String prefix = "";
                        if (StringUtils.contains(name, ".")) {
                            prefix = StringUtils.substringAfterLast(name, ".");
                            name = StringUtils.substringBeforeLast(name, ".");
                        }
                        if (!StringUtils.isEmpty(prefix)) {
                            prefix = String.format(".%s", prefix);
                        }
                        while (fileNames.contains(fileName)) {
                            fileName = String.format("%s (%s)%s", name, counter++, prefix);
                        }
                    }
                    fileNames.add(fileName);
                    // Zip file
                    ZipEntry ze = new ZipEntry(fileName);
                    zout.putNextEntry(ze);
                    InputStream inputStream = new ByteArrayInputStream(file.getContent());
                    IOUtils.copy(inputStream, zout);
                    zout.closeEntry();
                }
                zout.flush();
                zout.close();
            }
        };
        archiveName = StringUtils.defaultIfEmpty(archiveName, "files.zip");
        return Response.ok(output).header("Content-Disposition", "attachment; filename=\"" + archiveName.replaceAll("\"", "\\\"") + "\"").build();
    } catch (Exception e) {
        return Response.status(Status.INTERNAL_SERVER_ERROR).build();
    }
}
Also used : ByteArrayInputStream(java.io.ByteArrayInputStream) InputStream(java.io.InputStream) ZipOutputStream(java.util.zip.ZipOutputStream) OutputStream(java.io.OutputStream) ZipEntry(java.util.zip.ZipEntry) StreamingOutput(javax.ws.rs.core.StreamingOutput) WorkspaceMaterial(fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceMaterial) WorkspaceFieldIOException(fi.otavanopisto.muikku.plugins.workspace.fieldio.WorkspaceFieldIOException) IOException(java.io.IOException) WorkspaceEntity(fi.otavanopisto.muikku.model.workspace.WorkspaceEntity) ByteArrayInputStream(java.io.ByteArrayInputStream) WorkspaceMaterialFileFieldAnswerFile(fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceMaterialFileFieldAnswerFile) ZipOutputStream(java.util.zip.ZipOutputStream) WorkspaceRootFolder(fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceRootFolder) HashSet(java.util.HashSet) Path(javax.ws.rs.Path) RESTPermit(fi.otavanopisto.security.rest.RESTPermit) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET)

Example 15 with WorkspaceRootFolder

use of fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceRootFolder in project muikku by otavanopisto.

the class WorkspaceRESTService method listWorkspaceMaterialReplies.

@GET
@Path("/workspaces/{WORKSPACEENTITYID}/materials/{WORKSPACEMATERIALID}/replies")
@RESTPermitUnimplemented
public Response listWorkspaceMaterialReplies(@PathParam("WORKSPACEENTITYID") Long workspaceEntityId, @PathParam("WORKSPACEMATERIALID") Long workspaceMaterialId) {
    UserEntity loggedUser = sessionController.getLoggedUserEntity();
    if (loggedUser == null) {
        return Response.status(Status.UNAUTHORIZED).entity("Unauthorized").build();
    }
    WorkspaceEntity workspaceEntity = workspaceEntityController.findWorkspaceEntityById(workspaceEntityId);
    if (workspaceEntity == null) {
        return Response.status(Status.NOT_FOUND).entity("Could not find workspace entity").build();
    }
    WorkspaceMaterial workspaceMaterial = workspaceMaterialController.findWorkspaceMaterialById(workspaceMaterialId);
    if (workspaceMaterial == null) {
        return Response.status(Status.NOT_FOUND).entity("Could not find workspace material").build();
    }
    WorkspaceRootFolder workspaceRootFolder = workspaceMaterialController.findWorkspaceRootFolderByWorkspaceNode(workspaceMaterial);
    if (workspaceRootFolder == null) {
        return Response.status(Status.INTERNAL_SERVER_ERROR).entity("Could not find workspace root folder").build();
    }
    if (!workspaceRootFolder.getWorkspaceEntityId().equals(workspaceEntity.getId())) {
        return Response.status(Status.BAD_REQUEST).entity("Invalid workspace material id or workspace entity id").build();
    }
    fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceMaterialReply materialReply = workspaceMaterialReplyController.findWorkspaceMaterialReplyByWorkspaceMaterialAndUserEntity(workspaceMaterial, loggedUser);
    if (materialReply != null) {
        return Response.ok(createRestModel(new fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceMaterialReply[] { materialReply })).build();
    } else {
        return Response.ok(createRestModel(new fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceMaterialReply[] {})).build();
    }
}
Also used : WorkspaceEntity(fi.otavanopisto.muikku.model.workspace.WorkspaceEntity) UserEntity(fi.otavanopisto.muikku.model.users.UserEntity) WorkspaceUserEntity(fi.otavanopisto.muikku.model.workspace.WorkspaceUserEntity) WorkspaceMaterial(fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceMaterial) WorkspaceRootFolder(fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceRootFolder) Path(javax.ws.rs.Path) RESTPermitUnimplemented(fi.otavanopisto.muikku.rest.RESTPermitUnimplemented) GET(javax.ws.rs.GET)

Aggregations

WorkspaceRootFolder (fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceRootFolder)21 WorkspaceEntity (fi.otavanopisto.muikku.model.workspace.WorkspaceEntity)14 WorkspaceMaterial (fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceMaterial)14 Path (javax.ws.rs.Path)12 GET (javax.ws.rs.GET)8 RESTPermit (fi.otavanopisto.security.rest.RESTPermit)7 WorkspaceUserEntity (fi.otavanopisto.muikku.model.workspace.WorkspaceUserEntity)6 UserEntity (fi.otavanopisto.muikku.model.users.UserEntity)5 WorkspaceNode (fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceNode)5 RESTPermitUnimplemented (fi.otavanopisto.muikku.rest.RESTPermitUnimplemented)5 ArrayList (java.util.ArrayList)4 POST (javax.ws.rs.POST)3 WorkspaceGradingScale (fi.otavanopisto.muikku.plugins.evaluation.rest.model.WorkspaceGradingScale)2 BinaryMaterial (fi.otavanopisto.muikku.plugins.material.model.BinaryMaterial)2 HtmlMaterial (fi.otavanopisto.muikku.plugins.material.model.HtmlMaterial)2 WorkspaceMaterialFileFieldAnswerFile (fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceMaterialFileFieldAnswerFile)2 GradingScale (fi.otavanopisto.muikku.schooldata.entity.GradingScale)2 GradingScaleItem (fi.otavanopisto.muikku.schooldata.entity.GradingScaleItem)2 IOException (java.io.IOException)2 Date (java.util.Date)2