use of com.remswork.project.alice.resource.links.ActivityResultResourceLinks in project classify-system by anverliedoit.
the class ActivityResultResource method updateActivityResult.
@PUT
public Response updateActivityResult(@PathParam("activityId") long activityId, @QueryParam("score") int score) {
try {
ActivityResultResourceLinks resultResourceLinks = new ActivityResultResourceLinks(uriInfo);
ActivityResult result = activityService.updateActivityResultByActivityAndStudentId(score, activityId, studentId);
result.addLink(resultResourceLinks.self(result.getId()));
return Response.status(Response.Status.OK).entity(result).build();
} catch (GradingFactorException e) {
e.printStackTrace();
Message message = new Message(400, "Bad Request", e.getMessage());
return Response.status(Response.Status.NOT_FOUND).entity(message).build();
}
}
use of com.remswork.project.alice.resource.links.ActivityResultResourceLinks in project classify-system by anverliedoit.
the class ActivityResultResource method addActivityResult.
@POST
public Response addActivityResult(@QueryParam("score") int score, @PathParam("activityId") long activityId) {
try {
ActivityResultResourceLinks resultResourceLinks = new ActivityResultResourceLinks(uriInfo);
ActivityResult result = activityService.addActivityResult(score, activityId, studentId);
result.addLink(resultResourceLinks.self(result.getId()));
return Response.status(Response.Status.OK).entity(result).build();
} catch (GradingFactorException e) {
e.printStackTrace();
Message message = new Message(404, "Not Found", e.getMessage());
return Response.status(Response.Status.NOT_FOUND).entity(message).build();
}
}
use of com.remswork.project.alice.resource.links.ActivityResultResourceLinks in project classify-system by anverliedoit.
the class ActivityResultResource method deleteActivityResult.
@DELETE
public Response deleteActivityResult(@PathParam("activityId") long activityId) {
try {
ActivityResultResourceLinks resultResourceLinks = new ActivityResultResourceLinks(uriInfo);
ActivityResult result = activityService.deleteActivityResultByActivityAndStudentId(activityId, studentId);
result.addLink(resultResourceLinks.self(result.getId()));
return Response.status(Response.Status.OK).entity(result).build();
} catch (GradingFactorException e) {
e.printStackTrace();
Message message = new Message(400, "Bad Request", e.getMessage());
return Response.status(Response.Status.BAD_REQUEST).entity(message).build();
}
}
use of com.remswork.project.alice.resource.links.ActivityResultResourceLinks in project classify-system by anverliedoit.
the class ActivityResultResource method getActivityResult.
@GET
public Response getActivityResult(@PathParam("activityId") long activityId) {
try {
ActivityResultResourceLinks resultResourceLinks = new ActivityResultResourceLinks(uriInfo);
ActivityResult result = activityService.getActivityResultByActivityAndStudentId(activityId, studentId);
result.addLink(resultResourceLinks.self(result.getId()));
return Response.status(Response.Status.OK).entity(result).build();
} catch (GradingFactorException e) {
e.printStackTrace();
Message message = new Message(404, "Not Found", e.getMessage());
return Response.status(Response.Status.NOT_FOUND).entity(message).build();
}
}
Aggregations