let feedbackJSON = require('./scoreFeedback.json');

exports.getScoreFeedback = (score) => {

    if (score.total < 6) {
        const random = Math.floor(Math.random() * feedbackJSON.feedback1to5.length);
        return feedbackJSON.feedback1to5[random];
    } else if (score.total < 8) {
        const random = Math.floor(Math.random() * feedbackJSON.feedback6to7.length);
        return feedbackJSON.feedback6to7[random];
    } else if(score.total < 10) {
        const random = Math.floor(Math.random() * feedbackJSON.feedback8to9.length);
        return feedbackJSON.feedback8to9[random];
    } else {
        const random = Math.floor(Math.random() * feedbackJSON.feedback10to11.length);
        return feedbackJSON.feedback10to11[random];
    }

}
