// Include custom header files
#include "Quiz.h"

int Quiz::score {0}; // Initialize static Quiz member "score" as zero

std::string Quiz::getQuestion() { // Function to get an object's question

    return question;

}

std::string Quiz::getAnswer() { // Function to get an object's answer

    return answer;

}

int Quiz::getScore() { // Static function to get global score

    return score;

}

void Quiz::updateScore(const int &val) { // Static function to update global score

    // Checks the input value to guard against negative overall score
    if (val > 0) {
        score = score + val;
    } else {
        if ((score + val) >= 0) { // If adding the current score and the input value still results in a score of zero or more
            score = score + val; // Add current score and input value
        }
    }

}