From 756591b792be3237ce2fd5e52869bd3a033076e6 Mon Sep 17 00:00:00 2001 From: by801687 Date: Wed, 6 Nov 2019 11:28:07 +0100 Subject: [PATCH] =?UTF-8?q?#9=20ajout=20v=C3=A9rification=20Question=20(1?= =?UTF-8?q?=20r=C3=A9p=20fausse=20et=201=20juste=20au=20moins)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/config/Question.java | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/config/Question.java b/src/config/Question.java index 3801378..533c370 100644 --- a/src/config/Question.java +++ b/src/config/Question.java @@ -75,6 +75,23 @@ public class Question { } } -// TODO : methode pour verifier si la question a au moins une bonne reponse ET une mauvaise reponse - + public boolean verifQuestion() { + int nbrepf=0; + int nbrepj=0; + for(Reponse p : reponses) { + + if(p.isJuste()==true) { + nbrepj=nbrepj+1; + } + else { + nbrepf=nbrepf+1; + } + + } + if(nbrepf==0||nbrepj==0) { + return false; + } + else + return true; + } }