use of com.remswork.project.alice.model.RecitationResult in project classify-system by anverliedoit.
the class RecitationResultResource method addRecitationResult.
@POST
public Response addRecitationResult(@QueryParam("score") int score, @PathParam("recitationId") long recitationId) {
try {
RecitationResultResourceLinks resultResourceLinks = new RecitationResultResourceLinks(uriInfo);
RecitationResult result = recitationService.addRecitationResult(score, recitationId, 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.model.RecitationResult in project classify-system by anverliedoit.
the class RecitationResultResource method deleteRecitationResult.
@DELETE
public Response deleteRecitationResult(@PathParam("recitationId") long recitationId) {
try {
RecitationResultResourceLinks resultResourceLinks = new RecitationResultResourceLinks(uriInfo);
RecitationResult result = recitationService.deleteRecitationResultByRecitationAndStudentId(recitationId, 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.model.RecitationResult in project classify-system by anverliedoit.
the class RecitationResultResource method getRecitationResult.
@GET
public Response getRecitationResult(@PathParam("recitationId") long recitationId) {
try {
RecitationResultResourceLinks resultResourceLinks = new RecitationResultResourceLinks(uriInfo);
RecitationResult result = recitationService.getRecitationResultByRecitationAndStudentId(recitationId, 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.model.RecitationResult in project classify-system by anverliedoit.
the class RecitationResultResource method updateRecitationResult.
@PUT
public Response updateRecitationResult(@PathParam("recitationId") long recitationId, @QueryParam("score") int score) {
try {
RecitationResultResourceLinks resultResourceLinks = new RecitationResultResourceLinks(uriInfo);
RecitationResult result = recitationService.updateRecitationResultByRecitationAndStudentId(score, recitationId, 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();
}
}
Aggregations