Skip to content
Snippets Groups Projects
Commit bc56231d authored by Axel's avatar Axel
Browse files

fix: corrected path

parent 782c158a
No related branches found
No related tags found
No related merge requests found
......@@ -2,8 +2,6 @@ package unipotsdam.gf.modules.assessment.controller.view;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import unipotsdam.gf.modules.assessment.controller.model.Quiz;
import unipotsdam.gf.modules.communication.model.SampleAnswer;
import unipotsdam.gf.modules.communication.service.SampleService;
import unipotsdam.gf.modules.communication.view.SampleView;
import javax.ws.rs.GET;
......@@ -11,9 +9,9 @@ import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
@Path("/rest")
class QuizView {
......@@ -21,14 +19,18 @@ class QuizView {
@GET
@Produces(MediaType.APPLICATION_JSON)
@Path("/quiz/{projectId}/{quizId}")
public Quiz exampleQuiz(@PathParam("projectId") String name,@PathParam("quizId") String quiz) {
@Path("quiz/{projectId}/{quizId}")
public Response exampleQuiz(@PathParam("projectId") String name, @PathParam("quizId") String quiz) {
String[] correctAnswers = new String[2];
correctAnswers[0] = "42";
correctAnswers[1] = "24";
String[] wrongAnswers = {"a god created creature", "a some of my mistakes"};
String[] wrongAnswers = {"a god created creature", "a sum of my mistakes"};
if (false){
return Response.status(Response.Status.NOT_FOUND).entity("Entity not found for UUID: " + name).build();
}
Quiz sampleQuiz = new Quiz("multiple","Who am I and if so, how many?", correctAnswers,wrongAnswers);
log.info("HelloWorldview helloWorld Method answered: "+ sampleQuiz.toString());
return sampleQuiz;
return Response.ok(sampleQuiz.toString(), MediaType.APPLICATION_JSON).build();
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment