Skip to content
This repository was archived by the owner on Mar 25, 2021. It is now read-only.

Commit 17ad624

Browse files
committed
fix bug
1 parent 1c99a48 commit 17ad624

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/main/java/controleur/Controleur.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ public QuestionReponse next() {
9494
return facade.next(pseudo, idQuestionnaire);
9595
}
9696

97-
public void validerQuestion(String reponse) {
98-
facade.validerQuestion(pseudo, idQuestionnaire, reponse);
97+
public void validerQuestion(String reponse, int id) {
98+
facade.validerQuestion(pseudo, id, reponse);
9999
}
100100

101101
public void goToQuestion() {

src/main/java/vues/Question.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public class Question {
2828
public ComboBox<String> listeReponse;
2929

3030
private Controleur monControleur;
31+
private int id;
3132

3233

3334
public static Question creer(Stage laStageUnique) {
@@ -51,20 +52,29 @@ public void show() {
5152
}
5253

5354

55+
public int getId() {
56+
return id;
57+
}
58+
59+
public void setId(int id) {
60+
this.id = id;
61+
}
62+
5463
public void setMonControleur(Controleur monControleur) {
5564
this.monControleur = monControleur;
5665
}
5766

5867
public void chargerQuestion() {
5968
QuestionReponse questionReponse = monControleur.next();
6069
question.setText(questionReponse.getQuestion());
70+
setId(questionReponse.getIdQuestion());
6171
numero.setText("Question " + questionReponse.getIdQuestion());
6272
listeReponse.getItems().clear();
6373
listeReponse.getItems().addAll(questionReponse.getReponsesPossibles());
6474
}
6575

6676
public void validerReponse(ActionEvent actionEvent) {
67-
monControleur.validerQuestion(listeReponse.getSelectionModel().getSelectedItem());
77+
monControleur.validerQuestion(listeReponse.getSelectionModel().getSelectedItem(), id);
6878
if (monControleur.hasNext()) {
6979
chargerQuestion();
7080
} else {

0 commit comments

Comments
 (0)