Reponses
This commit is contained in:
@@ -1,5 +1,17 @@
|
||||
package metier;
|
||||
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.Id;
|
||||
|
||||
public abstract class Activity {
|
||||
|
||||
private long id_utilisateur_created;
|
||||
|
||||
@Id
|
||||
@GeneratedValue
|
||||
public int id;
|
||||
|
||||
public Activity(){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,23 @@
|
||||
package metier;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.Id;
|
||||
|
||||
public class Choix extends Reponse{
|
||||
public Choix() {}
|
||||
|
||||
@Id
|
||||
@GeneratedValue
|
||||
int id;
|
||||
|
||||
ArrayList<String> choix;
|
||||
|
||||
public Choix() {
|
||||
super();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import java.util.List;
|
||||
public class Question {
|
||||
|
||||
private int id;
|
||||
private List<Reponse> reponseList;
|
||||
private Reponse reponse;
|
||||
|
||||
@Id
|
||||
@GeneratedValue
|
||||
@@ -22,11 +22,11 @@ public class Question {
|
||||
}
|
||||
|
||||
@OneToMany(mappedBy ="reponse", cascade = CascadeType.DETACH)
|
||||
public List<Reponse> getReponseList() {
|
||||
return reponseList;
|
||||
public Reponse getReponse() {
|
||||
return reponse;
|
||||
}
|
||||
|
||||
public void setReponseList(List<Reponse> reponseList) {
|
||||
this.reponseList = reponseList;
|
||||
public void setReponse(Reponse reponse) {
|
||||
this.reponse = reponse;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package metier;
|
||||
|
||||
public class Quizz {
|
||||
public class Quizz extends Activity{
|
||||
|
||||
public Quizz(){
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,29 +1,17 @@
|
||||
package metier;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import jakarta.persistence.Id;
|
||||
|
||||
public abstract class Reponse {
|
||||
@Id
|
||||
private int id;
|
||||
private String value;
|
||||
private Boolean correct;
|
||||
|
||||
ArrayList<String> reponses;
|
||||
|
||||
|
||||
public Reponse(){
|
||||
}
|
||||
|
||||
public void setValue(String value){
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getValue(){
|
||||
return this.value;
|
||||
}
|
||||
|
||||
public boolean isCorrect(){
|
||||
return this.correct;
|
||||
}
|
||||
|
||||
public void setCorrect(Boolean correct){
|
||||
this.correct = correct;
|
||||
}
|
||||
}
|
||||
20
src/main/java/metier/ReponseCourte.java
Normal file
20
src/main/java/metier/ReponseCourte.java
Normal file
@@ -0,0 +1,20 @@
|
||||
package metier;
|
||||
|
||||
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.Id;
|
||||
|
||||
public class ReponseCourte extends Reponse{
|
||||
|
||||
@Id
|
||||
@GeneratedValue
|
||||
int id;
|
||||
|
||||
String value;
|
||||
|
||||
|
||||
public ReponseCourte(){
|
||||
super();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user