예제 #1
0
        private static void cleanReponse(Reponse r)
        {
            if (r is ReponseSimple)
            {
                ReponseSimple rm    = (ReponseSimple)r;
                String        texte = rm.texte;
                texte = Regex.Replace(texte, @"%-?[0-9]+(\.[0-9]+)?%", "");
                texte = texte.Replace("\n", "");
                texte = Regex.Replace(texte, @"####.*", "");
                int index = texte.IndexOf("#");
                if (index != -1)
                {
                    String[] split = texte.Split("#");
                    texte        = split[0];
                    rm.feedbackR = split[1];
                }
                rm.texte = texte;
            }
            if (r is ReponseMatching)
            {
                ReponseMatching rm     = (ReponseMatching)r;
                String          texte1 = rm.texte1;
                texte1 = texte1.Replace("\n", "");
                String texte2 = rm.texte2;
                texte2 = texte2.Replace("\n", "");

                texte2 = Regex.Replace(texte2, @"####.*", "");
                int index = texte2.IndexOf("#");
                if (index != -1)
                {
                    String[] split = texte2.Split("#");
                    texte2       = split[0];
                    rm.feedbackR = split[1];
                }
                rm.texte1 = texte1;
                rm.texte2 = texte2;
            }
        }
예제 #2
0
 public void addReponse(Reponse rep)
 {
     rps.Add(rep);
 }