// Update the dictionary containing user selected reasoning public void UpdateUserReasoning(SymptomState selectedSymptom, ReasoningState userChoice) { // Update the dictionaries tracking the reasoning for user and correct choices // Only use first reasoning choice if (!userReasoning.ContainsKey(selectedSymptom)) { userReasoning[selectedSymptom] = reasoningChoices[userChoice]; correctReasoning[selectedSymptom] = reasoningChoices[ReasoningState.Correct]; } return; }
// Updates the user reasoning text box private void UpdateUserReasoning() { // Get text component of object Text textComponent = UserReasoning.GetComponent <Text>(); // Get the Symptom currently being compared SymptomState symptom = UserSelectedReasoning[reasoningIndex]; // Get the ReasoningValue the user selected for that symptom ReasoningState userChoice = CaseInformation.UserReasoning[symptom]; // Set value of the text textComponent.text = PlayLoopData.ReasoningValues[symptom][userChoice]; return; }
// Set text for the button correspodning to the reasoning assigned to the index passed in private void AssignReasoningTextToButton(int reasoningIndex, ReasoningState reasoning) { string reasoningText = PlayLoopData.ReasoningValues[CaseInformation.SelectedSymptom][reasoning]; // Reasoning index (what button index did this reasoning text get assigned to) switch (reasoningIndex) { // Set it to button 1 (index 0) case 0: { ReasoningButton0Text.text = reasoningText; break; } // Set it to button 2 (index 1) case 1: { ReasoningButton1Text.text = reasoningText; break; } // Set it to button 3 (index 2) case 2: { ReasoningButton2Text.text = reasoningText; break; } // Set it to button 4 (index 3) case 3: { ReasoningButton3Text.text = reasoningText; break; } default: { break; } } return; }