public static string Performance(double reactionTime, int numberOfTasks) { string performance; if (reactionTime < 300) { performance = "You did great!"; } else if (reactionTime < 600) { performance = "You did O.K."; } else if (reactionTime < double.MaxValue) { performance = "You did rather poorly."; } else { performance = "You did nothing!"; } if (AntiSpamming.DidHeSpam(4)) { performance += " \nBut you spammed the keyboard"; } return(performance); }
private void CheckSpamming() { bool spamming = AntiSpamming.DidHeSpam(1); if (spamming && _spammingText.gameObject.activeInHierarchy == false) { ShowNotification(); } }
private void DisplayInfo() { double mean = SrtHandler.GetMean(_reactionTimes); _threshold = SrtHandler.GetAcceptableReationTime(_reactionTimes); string performance = OutputTextHandler.Performance(mean, _baselineSettings.NumberOfTasks); _panel.GetComponentInChildren <Text>().text = performance; GlobalSettings.Gs?.UpdateThreshold(_threshold); _currentDisplayStatus = AntiSpamming.DidHeSpam(4) || !(mean < double.MaxValue) ? DisplayStatus.GoToMainMenu : DisplayStatus.DisplayingInfo; UnityClient.Communicator.Connect(); }