From 15c3dd0dc4a0916ed1dfb3c3f61588d0cf6215bb Mon Sep 17 00:00:00 2001 From: Christian <chgottsc@uni-potsdam.de> Date: Tue, 24 Jul 2018 17:32:23 +0200 Subject: [PATCH] feat. ansatz, um eingaben in db zu schreiben --- .../service/PeerAssessmentDummy.java | 3 +- .../controller/view/AssessmentView.java | 57 +++++++++++++++++++ 2 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 gemeinsamforschen/src/main/java/unipotsdam/gf/modules/assessment/controller/view/AssessmentView.java diff --git a/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/assessment/controller/service/PeerAssessmentDummy.java b/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/assessment/controller/service/PeerAssessmentDummy.java index 35920c84..5d5ace62 100644 --- a/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/assessment/controller/service/PeerAssessmentDummy.java +++ b/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/assessment/controller/service/PeerAssessmentDummy.java @@ -8,6 +8,7 @@ import java.util.Arrays; import java.util.List; public class PeerAssessmentDummy implements IPeerAssessment { + @Override public void addAssessmentDataToDB(Assessment assessment) { } @@ -33,10 +34,8 @@ public class PeerAssessmentDummy implements IPeerAssessment { incorrectAnswers.add("alle beide"); sampleQuiz = new Quiz("multiple", "Ist das nun des Pudels wahrer Kern?", correctAnswers, incorrectAnswers); } - return sampleQuiz; } - public ArrayList<Quiz> getQuiz(String projectId) { ArrayList<String> correctAnswers = new ArrayList<String>(); ArrayList<String> incorrectAnswers = new ArrayList<String>(); diff --git a/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/assessment/controller/view/AssessmentView.java b/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/assessment/controller/view/AssessmentView.java new file mode 100644 index 00000000..f71b4144 --- /dev/null +++ b/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/assessment/controller/view/AssessmentView.java @@ -0,0 +1,57 @@ +package unipotsdam.gf.modules.assessment.controller.view; + +import unipotsdam.gf.core.management.user.User; +import unipotsdam.gf.interfaces.IPeerAssessment; +import unipotsdam.gf.modules.assessment.controller.model.Assessment; +import unipotsdam.gf.modules.assessment.controller.model.*; +import unipotsdam.gf.modules.assessment.controller.service.PeerAssessment; +import unipotsdam.gf.modules.assessment.controller.service.PeerAssessmentDummy; + + +import javax.annotation.PostConstruct; +import javax.ws.rs.*; +import javax.ws.rs.core.MediaType; +import java.util.ArrayList; +import java.util.List; + +@Path("/assessments") +public class AssessmentView implements IPeerAssessment{ + private static IPeerAssessment peer = new PeerAssessmentDummy(); + @POST + @Consumes(MediaType.APPLICATION_JSON) + @Produces(MediaType.APPLICATION_JSON) + @Path("/calculate2") + @Override + public List<Grading> calculateAssessment(ArrayList<Performance> totalPerformance) { + return peer.calculateAssessment(totalPerformance); + } + @Override + public void addAssessmentDataToDB(Assessment assessment) { + } + @Override + public Quiz getQuiz(String projectId, String groupId) { + return null; + } + @Override + public Assessment getAssessmentDataFromDB(StudentIdentifier student) { + return null; + } + @Override + public void createQuiz(StudentAndQuiz studentAndQuiz) { + } + @Override + public ArrayList<Performance> getTotalAssessment(StudentIdentifier studentIdentifier) { + return null; + } + @Override + public int meanOfAssessement(String ProjectId) { + return 0; + } + @Override + public ArrayList<Quiz> getQuiz(String projectId) { + return null; + } + @Override + public void postPeerRating(ArrayList<PeerRating> peerRatings, String projectId, String groupId) { + } +} -- GitLab