From 8a9de02e74747c75150c89ea8c39f8c0aeaa81f2 Mon Sep 17 00:00:00 2001 From: law39 Date: Thu, 30 Apr 2020 12:48:38 +0100 Subject: [PATCH] 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. --- .../cs22120/group20/selfassessment/AssessmentGenerator.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/selfassessment/AssessmentGenerator.java b/src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/selfassessment/AssessmentGenerator.java index 2edd29f..c1438de 100644 --- a/src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/selfassessment/AssessmentGenerator.java +++ b/src/Welsh Vocabulary Tutor/src/main/java/uk/ac/aber/cs22120/group20/selfassessment/AssessmentGenerator.java @@ -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");