Exemplo n.º 1
0
        public void saveDictant(string text, string header, List <int> positions, List <string> answers)
        {
            StringBuilder stdText = new StringBuilder(text);

            for (int i = 0; i < positions.Count; i++)
            {
                stdText.Remove(positions[i], answers[i].Length);
                stdText.Insert(positions[i], new string('一', answers[i].Length));
            }
            if (currentDictant != null)
            {
                currentTeacher.editDictant(CurrentDictant.ID, text, header, positions, answers, stdText);
            }
            else
            {
                currentTeacher.addNewDictant(text, header, positions, answers, stdText);
                currentDictant = currentTeacher.getDictantByID(currentTeacher.GetMaxId("Dictant"));
            }
        }