Commit 5c6d9965 authored by François-Xavier Lebastard's avatar François-Xavier Lebastard
Browse files

UNOTOPLYS-66 UNOTOPLYS-67 feat(variable) :ajout d'une fonction moyenneQuestions

 Elle prend directement les références des questions. À partir des références, elle ne comptabilise ques les questions ayant des réponses et que celles qui ont un score
parent e13cf6f1
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -175,7 +175,7 @@ public class Expression implements IExpression {
}
//@formatter:off
final List<Double> questionsScores = Stream.of(questionsReferences)
.filter(answers.keySet()::contains)
.filter(this::isQuestionAnswerExists)
.map(this.scores::get)
.filter(Objects::nonNull)
.collect(Collectors.toList());
......@@ -188,6 +188,10 @@ public class Expression implements IExpression {
return stats.getMean();
}
protected boolean isQuestionAnswerExists(String questionReference){
return scores.keySet().contains(questionReference);
}
/**
* Ou exclusif.
* @param op1 opérande 1
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment