diff --git a/gemeinsamforschen/src/main/java/unipotsdam/gf/core/management/Management.java b/gemeinsamforschen/src/main/java/unipotsdam/gf/core/management/Management.java index dd4ebf438976d96cfe61b1bf4402569834e57ae7..1b00ee2a5441dd19c674ca7f851a8ec84c67938b 100644 --- a/gemeinsamforschen/src/main/java/unipotsdam/gf/core/management/Management.java +++ b/gemeinsamforschen/src/main/java/unipotsdam/gf/core/management/Management.java @@ -4,7 +4,7 @@ import unipotsdam.gf.core.management.project.Project; import unipotsdam.gf.core.management.user.User; import unipotsdam.gf.core.management.user.UserInterests; import unipotsdam.gf.core.management.user.UserProfile; -import unipotsdam.gf.modules.assessment.controller.StudentIdentifier; +import unipotsdam.gf.modules.assessment.controller.model.StudentIdentifier; /** * Created by dehne on 31.05.2018. diff --git a/gemeinsamforschen/src/main/java/unipotsdam/gf/core/management/ManagementImpl.java b/gemeinsamforschen/src/main/java/unipotsdam/gf/core/management/ManagementImpl.java index dfffd4df1fdf0dee228ae9e1d499876342e4219c..edb82a05fa7f3ba6ea6665712efc2d70d45f910d 100644 --- a/gemeinsamforschen/src/main/java/unipotsdam/gf/core/management/ManagementImpl.java +++ b/gemeinsamforschen/src/main/java/unipotsdam/gf/core/management/ManagementImpl.java @@ -6,7 +6,7 @@ import unipotsdam.gf.core.management.project.Project; import unipotsdam.gf.core.management.user.User; import unipotsdam.gf.core.management.user.UserInterests; import unipotsdam.gf.core.management.user.UserProfile; -import unipotsdam.gf.modules.assessment.controller.StudentIdentifier; +import unipotsdam.gf.modules.assessment.controller.model.StudentIdentifier; import java.util.ArrayList; import java.util.List; diff --git a/gemeinsamforschen/src/main/java/unipotsdam/gf/interfaces/IPeerAssessment.java b/gemeinsamforschen/src/main/java/unipotsdam/gf/interfaces/IPeerAssessment.java index b08418626291d61ab01198c43848c3ce6bc450cd..7d1fcf48ac3745fc415aece26812b776bfd44202 100644 --- a/gemeinsamforschen/src/main/java/unipotsdam/gf/interfaces/IPeerAssessment.java +++ b/gemeinsamforschen/src/main/java/unipotsdam/gf/interfaces/IPeerAssessment.java @@ -1,9 +1,9 @@ package unipotsdam.gf.interfaces; -import unipotsdam.gf.modules.assessment.controller.Assessment; -import unipotsdam.gf.modules.assessment.controller.Performance; -import unipotsdam.gf.modules.assessment.controller.Quiz; -import unipotsdam.gf.modules.assessment.controller.StudentIdentifier; +import unipotsdam.gf.modules.assessment.controller.model.Assessment; +import unipotsdam.gf.modules.assessment.controller.model.Performance; +import unipotsdam.gf.modules.assessment.controller.model.Quiz; +import unipotsdam.gf.modules.assessment.controller.model.StudentIdentifier; /** * Created by dehne on 18.05.2018. diff --git a/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/assessment/controller/AssessmentDAO.java b/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/assessment/controller/AssessmentDAO.java index ed7b43d3a6eff9b5a21da1c95feadbb73fefc973..92ddd91fc9484e38b11c304b5bd49b182148200e 100644 --- a/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/assessment/controller/AssessmentDAO.java +++ b/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/assessment/controller/AssessmentDAO.java @@ -2,6 +2,8 @@ package unipotsdam.gf.modules.assessment.controller; import unipotsdam.gf.interfaces.IPeerAssessment; +import unipotsdam.gf.modules.assessment.controller.model.Assessment; +import unipotsdam.gf.modules.assessment.controller.model.StudentIdentifier; /** * Created by dehne on 18.05.2018. diff --git a/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/assessment/controller/FBAssessement.java b/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/assessment/controller/FBAssessement.java index 0890abdcf4ddf3d7fcb7dd8c599fbb097c41b4c3..57886716332eb57be9c7cce9d2bcc3b376a171a7 100644 --- a/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/assessment/controller/FBAssessement.java +++ b/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/assessment/controller/FBAssessement.java @@ -1,5 +1,10 @@ package unipotsdam.gf.modules.assessment.controller; +import unipotsdam.gf.modules.assessment.controller.model.Assessment; +import unipotsdam.gf.modules.assessment.controller.model.Performance; +import unipotsdam.gf.modules.assessment.controller.model.Quiz; +import unipotsdam.gf.modules.assessment.controller.model.StudentIdentifier; + /** * Created by dehne on 18.05.2018. */ diff --git a/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/assessment/controller/Assessment.java b/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/assessment/controller/model/Assessment.java similarity index 93% rename from gemeinsamforschen/src/main/java/unipotsdam/gf/modules/assessment/controller/Assessment.java rename to gemeinsamforschen/src/main/java/unipotsdam/gf/modules/assessment/controller/model/Assessment.java index bfd450bcdae514d309b19919e39e50557df956ef..4fc531131d7ed72ff78727e96fc10db45a82d2f4 100644 --- a/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/assessment/controller/Assessment.java +++ b/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/assessment/controller/model/Assessment.java @@ -1,4 +1,4 @@ -package unipotsdam.gf.modules.assessment.controller; +package unipotsdam.gf.modules.assessment.controller.model; public class Assessment { private StudentIdentifier student; diff --git a/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/assessment/controller/Performance.java b/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/assessment/controller/model/Performance.java similarity index 94% rename from gemeinsamforschen/src/main/java/unipotsdam/gf/modules/assessment/controller/Performance.java rename to gemeinsamforschen/src/main/java/unipotsdam/gf/modules/assessment/controller/model/Performance.java index 7e05864f14a3ca635153d0e1622abac7de3f67cd..4091c3161b7908a54dda978e94795f72acfc6584 100644 --- a/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/assessment/controller/Performance.java +++ b/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/assessment/controller/model/Performance.java @@ -1,4 +1,4 @@ -package unipotsdam.gf.modules.assessment.controller; +package unipotsdam.gf.modules.assessment.controller.model; import java.util.Arrays; diff --git a/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/assessment/controller/Quiz.java b/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/assessment/controller/model/Quiz.java similarity index 94% rename from gemeinsamforschen/src/main/java/unipotsdam/gf/modules/assessment/controller/Quiz.java rename to gemeinsamforschen/src/main/java/unipotsdam/gf/modules/assessment/controller/model/Quiz.java index cc3bab9653370c44cc1a7074c61c369c1a1429ae..fd5f5f5ce95011ab6c0732cdbbf0cd0e7aa8d604 100644 --- a/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/assessment/controller/Quiz.java +++ b/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/assessment/controller/model/Quiz.java @@ -1,4 +1,4 @@ -package unipotsdam.gf.modules.assessment.controller; +package unipotsdam.gf.modules.assessment.controller.model; public class Quiz { private String type; diff --git a/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/assessment/controller/StudentIdentifier.java b/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/assessment/controller/model/StudentIdentifier.java similarity index 92% rename from gemeinsamforschen/src/main/java/unipotsdam/gf/modules/assessment/controller/StudentIdentifier.java rename to gemeinsamforschen/src/main/java/unipotsdam/gf/modules/assessment/controller/model/StudentIdentifier.java index 05799b86895153a95fce2fe5e2243f622c0e7df4..3a382e6454e123c137bfccd45e7e00baefa6e49a 100644 --- a/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/assessment/controller/StudentIdentifier.java +++ b/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/assessment/controller/model/StudentIdentifier.java @@ -1,4 +1,4 @@ -package unipotsdam.gf.modules.assessment.controller; +package unipotsdam.gf.modules.assessment.controller.model; public class StudentIdentifier { private String projectId; diff --git a/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/assessment/controller/view/QuizView.java b/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/assessment/controller/view/QuizView.java new file mode 100644 index 0000000000000000000000000000000000000000..b2c1b1785ea19ac28b48fe18d7631db9a034923d --- /dev/null +++ b/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/assessment/controller/view/QuizView.java @@ -0,0 +1,34 @@ +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; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; + + +@Path("/rest") +class QuizView { + + + Logger log = LoggerFactory.getLogger(SampleView.class); + + @GET + @Produces(MediaType.APPLICATION_JSON) + @Path("/quiz/{projectId}/{quizId}") + public Quiz 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"}; + 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; + } +} diff --git a/gemeinsamforschen/src/test/java/unipotsdam/gf/modules/assessment/TestAddAssessment.java b/gemeinsamforschen/src/test/java/unipotsdam/gf/modules/assessment/TestAddAssessment.java index 78071ead4c147d7f152f09c84f65b3b36e383713..ba96ab29b4b7e8417a1ad0c8ec0428b9b039155c 100644 --- a/gemeinsamforschen/src/test/java/unipotsdam/gf/modules/assessment/TestAddAssessment.java +++ b/gemeinsamforschen/src/test/java/unipotsdam/gf/modules/assessment/TestAddAssessment.java @@ -2,10 +2,10 @@ package unipotsdam.gf.modules.assessment; import org.junit.Test; import unipotsdam.gf.interfaces.IPeerAssessment; -import unipotsdam.gf.modules.assessment.controller.Assessment; +import unipotsdam.gf.modules.assessment.controller.model.Assessment; import unipotsdam.gf.modules.assessment.controller.FBAssessement; -import unipotsdam.gf.modules.assessment.controller.Performance; -import unipotsdam.gf.modules.assessment.controller.StudentIdentifier; +import unipotsdam.gf.modules.assessment.controller.model.Performance; +import unipotsdam.gf.modules.assessment.controller.model.StudentIdentifier; public class TestAddAssessment {