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

feat: more dummy stuff. http request throws 400 atm.

parent 9dfa3819
No related branches found
No related tags found
No related merge requests found
Showing
with 358 additions and 75 deletions
......@@ -3,7 +3,9 @@
<component name="ChangeListManager">
<list default="true" id="b207c042-3fc9-4102-bf50-ee6c9b45c20d" name="Default" comment="">
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/gemeinsamforschen/src/main/java/unipotsdam/gf/interfaces/IPeerAssessment.java" afterPath="$PROJECT_DIR$/gemeinsamforschen/src/main/java/unipotsdam/gf/interfaces/IPeerAssessment.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/assessment/controller/model/Assessment.java" afterPath="$PROJECT_DIR$/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/assessment/controller/model/Assessment.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/assessment/controller/service/PeerAssessmentDummy.java" afterPath="$PROJECT_DIR$/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/assessment/controller/service/PeerAssessmentDummy.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/assessment/controller/view/QuizView.java" afterPath="$PROJECT_DIR$/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/assessment/controller/view/QuizView.java" />
</list>
<ignored path="fltrail.iws" />
<ignored path=".idea/workspace.xml" />
......@@ -44,11 +46,29 @@
</provider>
</entry>
</file>
<file leaf-file-name="projects.php" pinned="false" current-in-tab="true">
<file leaf-file-name="projects.php" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/studentview/pages/projects.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="21">
<caret line="125" column="34" lean-forward="false" selection-start-line="125" selection-start-column="34" selection-end-line="125" selection-end-column="34" />
<caret line="111" column="34" lean-forward="false" selection-start-line="111" selection-start-column="34" selection-end-line="111" selection-end-column="34" />
<folding>
<marker date="1528377403200" expanded="true" signature="10969:10996" ph="..." />
<marker date="1528377403200" expanded="true" signature="10969:11019" ph="..." />
<marker date="1528377403200" expanded="true" signature="10969:11038" ph="..." />
<marker date="1528377403200" expanded="true" signature="10969:11053" ph="..." />
<marker date="1528377403200" expanded="true" signature="10969:11064" ph="..." />
<marker date="1528377403200" expanded="true" signature="10969:11071" ph="..." />
<marker date="1528377403200" expanded="true" signature="10969:11079" ph="..." />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="newProject.js" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/studentview/assets/js/newProject.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-651">
<caret line="20" column="7" lean-forward="false" selection-start-line="20" selection-start-column="7" selection-end-line="20" selection-end-column="7" />
<folding />
</state>
</provider>
......@@ -67,9 +87,19 @@
<file leaf-file-name="overview.js" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/studentview/assets/js/overview.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1806">
<caret line="86" column="0" lean-forward="false" selection-start-line="86" selection-start-column="0" selection-end-line="86" selection-end-column="0" />
<folding />
<state relative-caret-position="1827">
<caret line="87" column="0" lean-forward="false" selection-start-line="87" selection-start-column="0" selection-end-line="87" selection-end-column="0" />
<folding>
<marker date="1528377403191" expanded="true" signature="2039:2586" ph="{...}" />
<marker date="1528377403191" expanded="true" signature="2116:2586" ph="{&quot;url&quot;: url...}" />
<marker date="1528377403191" expanded="true" signature="2253:2586" ph="{...}" />
<marker date="1528377403191" expanded="true" signature="2478:2586" ph="{...}" />
<marker date="1528377403191" expanded="true" signature="5783:6754" ph="{&quot;url&quot;: innerurl...}" />
<marker date="1528377403191" expanded="true" signature="5783:6758" ph="{...}" />
<marker date="1528377403191" expanded="true" signature="5932:6673" ph="{...}" />
<marker date="1528377403191" expanded="true" signature="6102:6663" ph="{...}" />
<marker date="1528377403191" expanded="true" signature="6709:6748" ph="{...}" />
</folding>
</state>
</provider>
</entry>
......@@ -124,13 +154,13 @@
<option value="$PROJECT_DIR$/studentview/pages/deleteProject.php" />
<option value="$PROJECT_DIR$/studentview/pages/enrollment.php" />
<option value="$PROJECT_DIR$/studentview/pages/newproject.php" />
<option value="$PROJECT_DIR$/studentview/pages/projects.php" />
<option value="$PROJECT_DIR$/studentview/register.php" />
<option value="$PROJECT_DIR$/studentview/pages/preferences.php" />
<option value="$PROJECT_DIR$/studentview/assets/js/config.js" />
<option value="$PROJECT_DIR$/studentview/database/config.php" />
<option value="$PROJECT_DIR$/studentview/assets/js/overview.js" />
<option value="$PROJECT_DIR$/gemeinsamforschen/src/main/java/unipotsdam/gf/interfaces/ResearchReport.java" />
<option value="$PROJECT_DIR$/studentview/pages/projects.php" />
</list>
</option>
</component>
......@@ -266,8 +296,8 @@
</PATH>
</subPane>
</pane>
<pane id="Scratches" />
<pane id="Scope" />
<pane id="Scratches" />
<pane id="PackagesPane" />
<pane id="AndroidView" />
</panes>
......@@ -365,26 +395,28 @@
<workItem from="1524585513713" duration="57000" />
<workItem from="1528200793936" duration="888000" />
<workItem from="1528354427057" duration="403000" />
<workItem from="1528809757337" duration="102000" />
</task>
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="75305000" />
<option name="totallyTimeSpent" value="75407000" />
</component>
<component name="ToolWindowManager">
<frame x="-9" y="-9" width="1938" height="1050" extended-state="6" />
<editor active="true" />
<layout>
<window_info id="Remote Host" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="11" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.2125" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" x="9" y="79" width="408" height="943" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.2125" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" x="9" y="79" width="408" height="943" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.23455825" sideWeight="0.47734374" order="8" side_tool="true" content_ui="tabs" />
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.15729167" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="10" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.35496482" sideWeight="0.71510416" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="10" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="5" side_tool="true" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.331509" sideWeight="0.52265626" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="5" side_tool="true" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
......@@ -582,13 +614,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/studentview/assets/js/newProject.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="92" column="40" lean-forward="false" selection-start-line="92" selection-start-column="40" selection-end-line="92" selection-end-column="40" />
</state>
</provider>
</entry>
<entry file="dbDummy://dbtable:/fc3764cf/14340c2c-ac4b-492f-ac4f-18c0853598a8/fltrail.projects" />
<entry file="file://$PROJECT_DIR$/studentview/assets/js/createPreferences.js">
<provider selected="true" editor-type-id="text-editor">
......@@ -711,16 +736,42 @@
</entry>
<entry file="file://$PROJECT_DIR$/studentview/assets/js/overview.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1806">
<caret line="86" column="0" lean-forward="false" selection-start-line="86" selection-start-column="0" selection-end-line="86" selection-end-column="0" />
<folding />
<state relative-caret-position="1827">
<caret line="87" column="0" lean-forward="false" selection-start-line="87" selection-start-column="0" selection-end-line="87" selection-end-column="0" />
<folding>
<marker date="1528377403191" expanded="true" signature="2039:2586" ph="{...}" />
<marker date="1528377403191" expanded="true" signature="2116:2586" ph="{&quot;url&quot;: url...}" />
<marker date="1528377403191" expanded="true" signature="2253:2586" ph="{...}" />
<marker date="1528377403191" expanded="true" signature="2478:2586" ph="{...}" />
<marker date="1528377403191" expanded="true" signature="5783:6754" ph="{&quot;url&quot;: innerurl...}" />
<marker date="1528377403191" expanded="true" signature="5783:6758" ph="{...}" />
<marker date="1528377403191" expanded="true" signature="5932:6673" ph="{...}" />
<marker date="1528377403191" expanded="true" signature="6102:6663" ph="{...}" />
<marker date="1528377403191" expanded="true" signature="6709:6748" ph="{...}" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/studentview/pages/projects.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="21">
<caret line="125" column="34" lean-forward="false" selection-start-line="125" selection-start-column="34" selection-end-line="125" selection-end-column="34" />
<caret line="111" column="34" lean-forward="false" selection-start-line="111" selection-start-column="34" selection-end-line="111" selection-end-column="34" />
<folding>
<marker date="1528377403200" expanded="true" signature="10969:10996" ph="..." />
<marker date="1528377403200" expanded="true" signature="10969:11019" ph="..." />
<marker date="1528377403200" expanded="true" signature="10969:11038" ph="..." />
<marker date="1528377403200" expanded="true" signature="10969:11053" ph="..." />
<marker date="1528377403200" expanded="true" signature="10969:11064" ph="..." />
<marker date="1528377403200" expanded="true" signature="10969:11071" ph="..." />
<marker date="1528377403200" expanded="true" signature="10969:11079" ph="..." />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/studentview/assets/js/newProject.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-651">
<caret line="20" column="7" lean-forward="false" selection-start-line="20" selection-start-column="7" selection-end-line="20" selection-end-column="7" />
<folding />
</state>
</provider>
......
package unipotsdam.gf.interfaces;
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;
import unipotsdam.gf.modules.assessment.controller.model.*;
/**
* Created by dehne on 18.05.2018.
......@@ -29,19 +26,18 @@ public interface IPeerAssessment {
/**
* writes a quiz-question into the DB so other students can benefit from another's insights.
*
* @param student
* @param quiz
* @param studentAndQuiz
*/
void createQuiz(StudentIdentifier student, Quiz quiz);
void createQuiz(StudentAndQuiz studentAndQuiz);
/**
* calculate grades for everyone in a list.
* either it will be overwritten by choice of co- or peer-assessment or it gets a parameter which specifies it.
*
* @param performanceOfAllStudents
* @return
*
* @param totalPerformance @return
*/
int[] calculateAssessment(Performance[] performanceOfAllStudents); // calculates marks for every performance and writes it to an array
Grades calculateAssessment(TotalPerformance totalPerformance); // calculates marks for every performance and writes it to an array
/**
* calculates the mean value of all assessments in a project.
......
package unipotsdam.gf.modules.assessment.controller.model;
import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement
public class Assessment {
private StudentIdentifier student;
private Performance performance;
......@@ -9,6 +13,8 @@ public class Assessment {
this.performance = performance;
}
public Assessment(){}
public StudentIdentifier getStudent() {
return student;
}
......
package unipotsdam.gf.modules.assessment.controller.model;
public class Grades {
private Grading[] grading;
public Grades(){}
public Grades(Grading[] grading) {
this.grading = grading;
}
public Grading[] getGrading() {
return grading;
}
public void setGrading(Grading[] grading) {
this.grading = grading;
}
@Override
public String toString() {
return "Grades{" +
"grading=" + grading +
'}';
}
}
package unipotsdam.gf.modules.assessment.controller.model;
public class Grading {
private StudentIdentifier studentIdentifier;
private int grade;
public Grading(){}
public Grading(StudentIdentifier studentIdentifier, int grade) {
this.studentIdentifier = studentIdentifier;
this.grade = grade;
}
public int getGrade() {
return grade;
}
public void setGrade(int grade) {
this.grade = grade;
}
public StudentIdentifier getStudentIdentifier() {
return studentIdentifier;
}
public void setStudentIdentifier(StudentIdentifier studentIdentifier) {
this.studentIdentifier = studentIdentifier;
}
@Override
public String toString() {
return "Grading{" +
"studentIdentifier=" + studentIdentifier +
", grade=" + grade +
'}';
}
}
package unipotsdam.gf.modules.assessment.controller.model;
public class StudentAndQuiz {
@Override
public String toString() {
return "StudentAndQuiz{" +
"studentIdentifier=" + studentIdentifier +
", quiz=" + quiz +
'}';
}
public StudentAndQuiz(){}
private StudentIdentifier studentIdentifier;
public StudentIdentifier getStudentIdentifier() {
return studentIdentifier;
}
public void setStudentIdentifier(StudentIdentifier studentIdentifier) {
this.studentIdentifier = studentIdentifier;
}
public Quiz getQuiz() {
return quiz;
}
public void setQuiz(Quiz quiz) {
this.quiz = quiz;
}
private Quiz quiz;
public StudentAndQuiz(StudentIdentifier studentIdentifier, Quiz quiz) {
this.studentIdentifier = studentIdentifier;
this.quiz = quiz;
}
}
package unipotsdam.gf.modules.assessment.controller.model;
import java.util.Arrays;
public class TotalPerformance {
private StudentIdentifier[] studentIdentifier;
private Performance[] performances;
public TotalPerformance(StudentIdentifier[] studentIdentifier, Performance[] performances) {
this.studentIdentifier = studentIdentifier;
this.performances = performances;
}
public TotalPerformance() {
}
public Performance[] getPerformances() {
return performances;
}
public void setPerformances(Performance[] performances) {
this.performances = performances;
}
public StudentIdentifier[] getStudentIdentifier() {
return studentIdentifier;
}
public void setStudentIdentifier(StudentIdentifier[] studentIdentifier) {
this.studentIdentifier = studentIdentifier;
}
@Override
public String toString() {
return "TotalPerformance{" +
"studentIdentifier=" + studentIdentifier +
", performances=" + Arrays.toString(performances) +
'}';
}
}
package unipotsdam.gf.modules.assessment.controller.service;
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;
import unipotsdam.gf.modules.assessment.controller.model.*;
/**
* Created by dehne on 18.05.2018.
......@@ -21,19 +18,15 @@ public class FBAssessement extends AssessmentDAO {
}
@Override
public void createQuiz(StudentIdentifier student, Quiz quiz) {
public void createQuiz(StudentAndQuiz studentAndQuiz) {
}
@Override
public int[] calculateAssessment(Performance[] performanceOfAllStudents){ // calculates marks for every performance and writes it to an array
int[] dummy = new int[4];
dummy[0]=1;
dummy[1]=4;
dummy[2]=3;
dummy[3]=2;
return dummy;
public Grades calculateAssessment(TotalPerformance totalPerformance){ // calculates marks for every performance and writes it to an array
Grades grades = new Grades();
return grades;
}
public void createQuiz(StudentIdentifier student, String question, String[] answers){ //writes a new question into the DB
......
package unipotsdam.gf.modules.assessment.controller.service;
import unipotsdam.gf.interfaces.IPeerAssessment;
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;
import unipotsdam.gf.modules.assessment.controller.model.*;
public class PeerAssessment implements IPeerAssessment {
@Override
......@@ -23,13 +20,14 @@ public class PeerAssessment implements IPeerAssessment {
}
@Override
public void createQuiz(StudentIdentifier student, Quiz quiz) {
public void createQuiz(StudentAndQuiz studentAndQuiz) {
}
@Override
public int[] calculateAssessment(Performance[] performanceOfAllStudents) {
return new int[0];
public Grades calculateAssessment(TotalPerformance totalPerformance) {
Grades grades = new Grades();
return grades;
}
@Override
......
package unipotsdam.gf.modules.assessment.controller.service;
import unipotsdam.gf.interfaces.IPeerAssessment;
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;
import unipotsdam.gf.modules.assessment.controller.model.*;
public class PeerAssessmentDummy implements IPeerAssessment {
@Override
......@@ -27,17 +24,39 @@ public class PeerAssessmentDummy implements IPeerAssessment {
@Override
public Assessment getAssessmentDataFromDB(StudentIdentifier student) {
return null;
int[] quizAnswer = {1,1,1,0,0,0,1,0,0,1,1};
int[] workRating = {1,5,3,4,1,5,5};
Performance performance = new Performance(quizAnswer, "what a nice guy", workRating);
Assessment assessment = new Assessment(student, performance);
return assessment;
}
@Override
public void createQuiz(StudentIdentifier student, Quiz quiz) {
public void createQuiz(StudentAndQuiz studentAndQuiz) {
}
@Override
public int[] calculateAssessment(Performance[] performanceOfAllStudents) {
return new int[0];
public Grades calculateAssessment(TotalPerformance totalPerformance) {
Performance[] performanceOfAllStudents = totalPerformance.getPerformances();
StudentIdentifier[] allStudents = totalPerformance.getStudentIdentifier();
int[] allAssessements = new int[performanceOfAllStudents.length] ;
Grades grades = new Grades();
Grading[] grading = new Grading[performanceOfAllStudents.length];
for (int i=0; i< performanceOfAllStudents.length;i++) {
for (int j=0; j< performanceOfAllStudents[i].getQuizAnswer().length;j++) {
allAssessements[i] += performanceOfAllStudents[i].getQuizAnswer()[j];
}
allAssessements[i] = allAssessements[i]/performanceOfAllStudents[i].getQuizAnswer().length;
}
for (int i=0; i<performanceOfAllStudents.length; i++){
grading[i].setStudentIdentifier(allStudents[i]);
grading[i].setGrade(allAssessements[i]);
}
grades.setGrading(grading);
return grades;
}
@Override
......
package unipotsdam.gf.modules.assessment.controller.view;
import unipotsdam.gf.interfaces.IPeerAssessment;
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;
import unipotsdam.gf.modules.assessment.controller.model.*;
import unipotsdam.gf.modules.assessment.controller.service.PeerAssessmentDummy;
import javax.ws.rs.*;
......@@ -30,27 +27,45 @@ public class QuizView implements IPeerAssessment {
peer.addAssessmentDataToDB(assessment);
}
@GET
@Produces(MediaType.TEXT_PLAIN)
@Path("/project/{projectId}/student/{studentId}")
@Override
public Assessment getAssessmentDataFromDB(StudentIdentifier student){//@PathParam("projectId") String projectId,@PathParam("studentId") String studentId){
//StudentIdentifier student = new StudentIdentifier(projectId, studentId);
public Assessment getAssessmentDataFromDB(StudentIdentifier student){
return peer.getAssessmentDataFromDB(student);
}
@Override
public void createQuiz(StudentIdentifier student, Quiz quiz) {
@GET
@Produces(MediaType.APPLICATION_JSON)
@Path("/project/{projectId}/student/{studentId}")
public Assessment getAssessmentDataFromDB(@PathParam("projectId") String projectId,@PathParam("studentId") String studentId){
StudentIdentifier student = new StudentIdentifier(projectId, studentId);
return getAssessmentDataFromDB(student);
}
@POST
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
@Path("/quiz")
@Override
public void createQuiz(StudentAndQuiz studentAndQuiz) {
peer.createQuiz(studentAndQuiz);
}
@POST
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
@Path("/calculate")
@Override
public int[] calculateAssessment(Performance[] performanceOfAllStudents) {
return new int[0];
public Grades calculateAssessment(TotalPerformance totalPerformance) { //todo: maybe the return variable is the problem why it doesnt work.
return peer.calculateAssessment(totalPerformance);
}
@GET
@Produces(MediaType.APPLICATION_JSON)
@Path("/mean/project/{projectId}")
@Override
public int meanOfAssessement(String ProjectId) {
return 0;
public int meanOfAssessement(@PathParam("projectId") String ProjectId) {
return peer.meanOfAssessement(ProjectId);
}
}
$(document).ready(function(){
$("#calculateNow").on("click", function(){
var data = [{
StudentIdentifier: {
projectId: 'gemeinsamForschn',
student: 'Max*i Mustermann*ine'
},
Performance: {
quizAnswers: [1,0,1,1,0,0,0,0,1],
feedback: 'ganz feiner Student war das',
workRating: [4,3,5,1,1,5,3]
}
},{
StudentIdentifier: {
projectId: 'gemeinsamForschn',
student: 'John Doe'
},
Performance: {
quizAnswers: [1,0,1,1,0,1,1,1,1],
feedback: 'ganz feiner Student war das',
workRating: [2,3,2,3,1,2,3]
}
},{
StudentIdentifier: {
projectId: 'gemeinsamForschn',
student: 'Harri Gründler'
},
Performance: {
quizAnswers: [0,0,0,0,0,0,0,0,0],
feedback: 'ganz feiner Student war das',
workRating: [1,1,1,1,1,1,1]
}
}
];
$.ajax({
url: "http://localhost:8080/gemeinsamforschen/rest/assessments/calculate",
type: 'POST',
contentType: 'application/json; charset=utf-8',
data: data,
success: function(data){
alert(data);
},
error: function(a,b,c){
alert('some error'+a);
}
})
})
});
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>assessment calculator</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="../assets/js/assessmentCalculator.js"></script>
</head>
<body>
<button id="calculateNow">click mich</button>
</body>
</html>
\ No newline at end of file
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