Assessment now gives a final score in percentage

Percentage is preferable rather than display the arbitrary number of wrong answers generated by the six meaning assessment.
This commit is contained in:
law39 2020-04-30 12:48:38 +01:00
parent becf069f04
commit 8a9de02e74

View file

@ -171,9 +171,9 @@ public class AssessmentGenerator {
} else {
StringBuilder sb = new StringBuilder();
sb.append("You scored: ")
.append(Question.correctAnswers).append("/")
.append(Question.correctAnswers + Question.wrongAnswers)
sb.append("You got ")
.append(Question.correctAnswers / (Question.correctAnswers + Question.wrongAnswers))
.append("%")
.append("\n Would you like to test yourself again?");
ButtonType yesBtn = new ButtonType("Yes");