Reponses
This commit is contained in:
BIN
data/test.lck
BIN
data/test.lck
Binary file not shown.
@@ -1,5 +1,17 @@
|
|||||||
package metier;
|
package metier;
|
||||||
|
|
||||||
|
import jakarta.persistence.GeneratedValue;
|
||||||
|
import jakarta.persistence.Id;
|
||||||
|
|
||||||
public abstract class Activity {
|
public abstract class Activity {
|
||||||
|
|
||||||
private long id_utilisateur_created;
|
private long id_utilisateur_created;
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue
|
||||||
|
public int id;
|
||||||
|
|
||||||
|
public Activity(){
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,23 @@
|
|||||||
package metier;
|
package metier;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import jakarta.persistence.GeneratedValue;
|
||||||
|
import jakarta.persistence.Id;
|
||||||
|
|
||||||
public class Choix extends Reponse{
|
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 {
|
public class Question {
|
||||||
|
|
||||||
private int id;
|
private int id;
|
||||||
private List<Reponse> reponseList;
|
private Reponse reponse;
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue
|
@GeneratedValue
|
||||||
@@ -22,11 +22,11 @@ public class Question {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@OneToMany(mappedBy ="reponse", cascade = CascadeType.DETACH)
|
@OneToMany(mappedBy ="reponse", cascade = CascadeType.DETACH)
|
||||||
public List<Reponse> getReponseList() {
|
public Reponse getReponse() {
|
||||||
return reponseList;
|
return reponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setReponseList(List<Reponse> reponseList) {
|
public void setReponse(Reponse reponse) {
|
||||||
this.reponseList = reponseList;
|
this.reponse = reponse;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
package metier;
|
package metier;
|
||||||
|
|
||||||
public class Quizz {
|
public class Quizz extends Activity{
|
||||||
|
|
||||||
|
public Quizz(){
|
||||||
|
super();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,29 +1,17 @@
|
|||||||
package metier;
|
package metier;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import jakarta.persistence.Id;
|
import jakarta.persistence.Id;
|
||||||
|
|
||||||
public abstract class Reponse {
|
public abstract class Reponse {
|
||||||
@Id
|
@Id
|
||||||
private int id;
|
private int id;
|
||||||
private String value;
|
|
||||||
private Boolean correct;
|
ArrayList<String> reponses;
|
||||||
|
|
||||||
|
|
||||||
public Reponse(){
|
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();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
target/classes/metier/ReponseCourte.class
Normal file
BIN
target/classes/metier/ReponseCourte.class
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user