/* * Skill based on the checkbox buttons selected * ******************************************************************** */ public SkillSelection GetSkill() { SkillSelection skill = new SkillSelection(); if (distance.IsChecked == true && direction.IsChecked == false && symbol.IsChecked == false) { skill.mSkill = 1; skill.mSkillText = "distance"; } else if (distance.IsChecked == false && direction.IsChecked == true && symbol.IsChecked == false) { skill.mSkill = 2; skill.mSkillText = "direction"; } else if (distance.IsChecked == false && direction.IsChecked == false && symbol.IsChecked == true) { skill.mSkill = 3; skill.mSkillText = "symbol"; } else if (distance.IsChecked == true && direction.IsChecked == true && symbol.IsChecked == false) { skill.mSkill = 4; skill.mSkillText = "distance and direction"; } else if (distance.IsChecked == true && direction.IsChecked == false && symbol.IsChecked == true) { skill.mSkill = 5; skill.mSkillText = "distance and symbol"; } else if (distance.IsChecked == false && direction.IsChecked == true && symbol.IsChecked == true) { skill.mSkill = 6; skill.mSkillText = "direction and symbol"; } else if (distance.IsChecked == true && direction.IsChecked == true && symbol.IsChecked == true) { skill.mSkill = 7; skill.mSkillText = "distance, direction and symbol"; } return skill; }
///* //* Use the Skill and Strategy Selection to set the Utterances //*/ //public int SetUtterancesList(participantDetails participant, TaskStep taskstepdata, ListBox listBox, UtteranceType type, int strategy, int activeStepID, int firstActivityStep, SkillSelection skillSelection) //{ // listBox.Items.Clear(); // int counter = 0; // int problemCounter = 0; // foreach (XmlNode node in nodes) // { // if (node.SelectSingleNode("strategy") != null && node.SelectSingleNode("skill") != null && node.SelectSingleNode("dynamic") != null) // { // if (type == UtteranceType.FEEDBACK) // { // if (int.Parse(node.SelectSingleNode("strategy").InnerText) == strategy) // { // if (int.Parse(node.SelectSingleNode("strategy").InnerText) == 4) // Requestion // { // if (int.Parse(node.SelectSingleNode("skill").InnerText) == GetTaskScriptOffset(activeStepID)) // { // UtteranceSet utterance = new UtteranceSet(); // utterance = ProcessUtterance(participant, taskstepdata, node, skillSelection); // AddUtteranceItem(listBox, utterance.mText); // counter++; // } // } // else if (int.Parse(node.SelectSingleNode("skill").InnerText) == skillSelection.mSkill || skillSelection.mSkill == 0 || strategy > 9) //Allow Generic Behaviours // { // UtteranceSet utterance = new UtteranceSet(); // utterance = ProcessUtterance(participant, taskstepdata, node, skillSelection); // AddUtteranceItem(listBox, utterance.mText); // counter++; // } // } // } // } // else // { // string[] info = new string[3]; // info[0] = "O.K"; // info[1] = "O.K"; // info[2] = "O.K"; // if (node.SelectSingleNode("strategy") == null) // info[0] = "NULL"; // if (node.SelectSingleNode("skill") == null) // info[1] = "NULL"; // if (node.SelectSingleNode("dynamic") == null) // info[2] = "NULL"; // Console.WriteLine("Something Missing == ID = " + problemCounter.ToString() + " TYPE = " + type + info[0] + "," + info[1] + "," + info[2]); // } // problemCounter++; // } // if (counter == 0) // { // UtteranceSet utterance = new UtteranceSet(); // utterance.mText = "There is nothing to choose from here?"; // AddUtteranceItem(listBox, utterance.mText); // } // return counter; //} private UtteranceSet ProcessUtterance(participantDetails participant, TaskStep taskstepdata, XmlNode node, SkillSelection skillSelection) { UtteranceSet tempUtteranceSet = new UtteranceSet(); tempUtteranceSet.mText = node.SelectSingleNode("text").InnerText; tempUtteranceSet.mStrategy = int.Parse(node.SelectSingleNode("strategy").InnerText); tempUtteranceSet.mSkill = int.Parse(node.SelectSingleNode("skill").InnerText); tempUtteranceSet.mDynamic = int.Parse(node.SelectSingleNode("dynamic").InnerText); tempUtteranceSet.mText = tempUtteranceSet.mText.Replace("/distance/", taskstepdata.mDistanceValue.ToString() + " " + taskstepdata.mDistanceUnit); tempUtteranceSet.mText = tempUtteranceSet.mText.Replace("/interDirection/", taskstepdata.mDirectionValue); tempUtteranceSet.mText = tempUtteranceSet.mText.Replace("/interSecDirection/", taskstepdata.mDirectionValue); tempUtteranceSet.mText = tempUtteranceSet.mText.Replace("/direction/", taskstepdata.mDirectionValue); tempUtteranceSet.mText = tempUtteranceSet.mText.Replace("/symbol/", taskstepdata.mSymbolValue + " symbol"); tempUtteranceSet.mText = tempUtteranceSet.mText.Replace("/student/", participant.mName); tempUtteranceSet.mText = tempUtteranceSet.mText.Replace("/skill/", skillSelection.mSkillText); tempUtteranceSet.mNonTaggedText = Regex.Replace(tempUtteranceSet.mText, @"\s*?(?:\(.*?\)|\<.*?\>|\{.*?\})", String.Empty); tempUtteranceSet.mNonTaggedText = Regex.Replace(tempUtteranceSet.mNonTaggedText, @"\s*?(?:\(.*?\)|\\.*?\\|\{.*?\})", String.Empty); return tempUtteranceSet; }
/* * Use the Skill and Strategy Selection to set the Utterances */ public int SetUtterancesList(participantDetails participant, TaskStep taskstepdata, ListBox listBox, UtteranceType type, int strategy, int activeStepID, int firstActivityStep, SkillSelection skillSelection, List<UtteranceSet> ut) { listBox.Items.Clear(); int counter = 0; int problemCounter = 0; foreach (XmlNode node in nodes) { if (node.SelectSingleNode("strategy") != null && node.SelectSingleNode("skill") != null && node.SelectSingleNode("dynamic") != null) { if (type == UtteranceType.FEEDBACK) { if (int.Parse(node.SelectSingleNode("strategy").InnerText) == strategy) { if (int.Parse(node.SelectSingleNode("strategy").InnerText) == 4) // Requestion { if (int.Parse(node.SelectSingleNode("skill").InnerText) == GetTaskScriptOffset(activeStepID)) { UtteranceSet utterance = new UtteranceSet(); utterance = ProcessUtterance(participant, taskstepdata, node, skillSelection); ut.Add(utterance); AddUtteranceItem(utterance, listBox, utterance.mText); counter++; } } else if (int.Parse(node.SelectSingleNode("skill").InnerText) == skillSelection.mSkill || skillSelection.mSkill == 0 || strategy > 9) //Allow Generic Behaviours { UtteranceSet utterance = new UtteranceSet(); utterance = ProcessUtterance(participant, taskstepdata, node, skillSelection); ut.Add(utterance); AddUtteranceItem(utterance, listBox, utterance.mText); counter++; } } } } else { string[] info = new string[3]; info[0] = "O.K"; info[1] = "O.K"; info[2] = "O.K"; if (node.SelectSingleNode("strategy") == null) info[0] = "NULL"; if (node.SelectSingleNode("skill") == null) info[1] = "NULL"; if (node.SelectSingleNode("dynamic") == null) info[2] = "NULL"; Console.WriteLine("Something Missing == ID = " + problemCounter.ToString() + " TYPE = " + type + info[0] + "," + info[1] + "," + info[2]); } problemCounter++; } if (counter == 0) { UtteranceSet utterance = new UtteranceSet(); utterance.mText = "There is nothing to choose from here?"; utterance.mNonTaggedText = "There is nothing to choose from here?"; ut.Add(utterance); AddUtteranceItem(utterance, listBox, utterance.mText); counter++; } return counter; }