public void SaveProgress() { //Debug.Log("Saving Progress"); MenuVariables.selectedQuestionaryObj.lastAnsweredQuestion = currentQuestion; //Debug.Log("Saving currentQuestion: " + currentQuestion.ToString()); MenuVariables.selectedQuestionaryObj.correctAnswers = rightAnswers; //Debug.Log("Saving rightAnswers: " + rightAnswers.ToString()); MenuVariables.SaveQuestionary(); //Debug.Log("Finished Saving Progress"); }
void UpdateSave(int grade, bool bestScore) { if (bestScore) { MenuVariables.selectedQuestionaryObj.bestscore = grade; } float average = (float)(MenuVariables.selectedQuestionaryObj.averagescore * MenuVariables.selectedQuestionaryObj.timesAnswered); average += grade; MenuVariables.selectedQuestionaryObj.timesAnswered++; average /= MenuVariables.selectedQuestionaryObj.timesAnswered; MenuVariables.selectedQuestionaryObj.averagescore = (int)average; MenuVariables.selectedQuestionaryObj.lastAnsweredQuestion = 0; MenuVariables.selectedQuestionaryObj.correctAnswers = 0; MenuVariables.SaveQuestionary(); }