private void DigitEntered() { var enteredPinString = string.Join(",", _controller.EnteredNumbers); SetLoggerCurrentEnteredPin(enteredPinString); LoggingClass.AppendToLog(LoggingClass.ENTERED_PIN_CHANGE, null, null, null, null, null); if (_controller.EnteredNumberCount == 4) { // TODO only in the case that feedback is enabled do we show correct or incorrect if (enteredPinString == CurrentCorrectPinString) { if (currentTrialForPin >= PRACTICE_TRIALS) { ChangeClientMode(TechniqueClientController.ModeType.ContinueNoFeedback); } else { ChangeClientMode(TechniqueClientController.ModeType.ContinueCorrect); } LoggingClass.AppendToLog(LoggingClass.ENTRY_END, null, null, null, null, true); } else { if (currentTrialForPin >= PRACTICE_TRIALS) { ChangeClientMode(TechniqueClientController.ModeType.ContinueNoFeedback); } else { ChangeClientMode(TechniqueClientController.ModeType.ContinueIncorrect); } LoggingClass.AppendToLog(LoggingClass.ENTRY_END, null, null, null, null, false); } // TODO use somewhere: (in the case that feedback is disabled, regardless of correctness) // ChangeClientMode(TechniqueClientController.ModeType.ContinueNoFeedback); _controller.ResetEnteredNumbers(); currentTrialForPin++; SetCurrentPinTrial(currentTrialForPin); if (currentTrialForPin >= PRACTICE_TRIALS) { if (currentPinTested == 0) { OnClientRoundNotification?.Invoke(TechniqueClientController.NotificationType.Round1Normal); } else { OnClientRoundNotification?.Invoke(TechniqueClientController.NotificationType.Round2Normal); } OnClientFeedbackEnabledChanged?.Invoke(false); } // TODO when past trial rounds do this: // OnClientFeedbackEnabledChanged?.Invoke(false); if (currentTrialForPin == TOTAL_TRIALS) //changing the current pin tested. { currentPinTested++; SetCurrentPin(currentPinTested); currentTrialForPin = 0; SetCurrentPinTrial(currentTrialForPin); if (currentPinTested == (PINS_PER_PARTICIPANT - 1)) { OnClientFeedbackEnabledChanged?.Invoke(true); OnClientRoundNotification?.Invoke(TechniqueClientController.NotificationType.Round2Practice); } if (currentPinTested == PINS_PER_PARTICIPANT) { OnClientRoundNotification?.Invoke(TechniqueClientController.NotificationType.Finished); } } /* * //Check if we want this to be the last trial for the technique * if (currentPinTested == (PINS_PER_PARTICIPANT - 1) && currentTrialForPin == 8) * { * // TODO: make sure this is called when pin changes * OnClientFeedbackEnabledChanged?.Invoke(true); * OnClientRoundNotification?.Invoke(TechniqueClientController.NotificationType.Round2); * return; * } */ } }
public void ClientReady() { ChangeClientMode(TechniqueClientController.ModeType.Start); OnClientRoundNotification?.Invoke(TechniqueClientController.NotificationType.Round1Practice); OnClientFeedbackEnabledChanged?.Invoke(true); }