public static void Create_an_automatic_resume(List <Test> TESTS, List <Answers_to_Test> Answers_to_all_tests, string FileName)
        {
            List <List <double> > Keys_value_all = new List <List <double> >(); // all points on the scales

            for (int test_number = 0; test_number < TESTS.Count; ++test_number)
            {
                Keys_value_all.Add(Descriptors_implementation._SUM_counting(TESTS[test_number]._Keys, Answers_to_all_tests[test_number]));
            }

            Dictionary_of_scales = new List <Dictionary <string, double> >();
            List <List <string> > Manifestations_all = new List <List <string> >(); // all Manifestations on the first and second level

            for (int test_number = 0; test_number < TESTS.Count; ++test_number)
            {
                Dictionary <string, double> newscale = new Dictionary <string, double>();
                Manifestations_all.Add(Test_parser_level_1_and_2(TESTS[test_number]._Scales, Keys_value_all[test_number], ref newscale));
                Dictionary_of_scales.Add(newscale);
            }

            List <string> characteristics = new List <string>(Additional_functions.Get_filenames(Setting.characteristics_path));
            List <Personal_characteristic> Personal_characteristics = new List <Personal_characteristic>();

            for (int number = 0; number < characteristics.Count; number++)
            {
                Personal_characteristics.Add(Test_parser_level_3(ref TESTS, characteristics[number], Dictionary_of_scales));
            }

            if (!Stored_Exceptions.Empty)
            {
                MessageBox.Show("Ошибка: резюме содержит ошибки!");
            }

            Save_automatic_resume(TESTS, Answers_to_all_tests, Manifestations_all, Personal_characteristics, FileName);
        }
        static List <string> Test_parser_level_1_and_2(List <Scale> _Scales, List <double> Key_value, ref Dictionary <string, double> newscale)
        {
            List <string> Manifestations = new List <string>();

            for (int scale_number = 0; scale_number < _Scales.Count; ++scale_number)
            {
                string tmp = Descriptors_implementation._SCALE_counting(_Scales[scale_number], Key_value, newscale);
                if (tmp != null)
                {
                    Manifestations.Add(tmp);
                }
            }
            return(Manifestations);
        }
Exemple #3
0
        public bool Creat_Personal_characteristic(string FileName)
        {
            using (StreamReader sr = new StreamReader(Setting.characteristics_path + "\\" + FileName + ".txt", Encoding.GetEncoding(1251)))
            {
                string line = sr.ReadToEnd();
                string keyword;
                for (int i = 0; i < line.Length; i++)
                {
                    if (line[i] == '_') // выделение ключевого слова
                    {
                        keyword = "";
                        for (; i < line.Length && line[i] != ' '; i++)
                        {
                            keyword += line[i];
                        }
                        Enum.TryParse(keyword, out Descriptors Descriptor);
                        switch (Descriptor) // заполнение класса
                        {
                        case Descriptors._GROUP:
                        {
                            Descriptors_implementation._GROUP(Groups, ref i, ref line);
                            break;
                        }

                        case Descriptors._LINK:
                        {
                            Descriptors_implementation._LINK(Groups, ref i, ref line);
                            break;
                        }

                        default:
                            break;
                        }
                    }
                }
                if (!Stored_Exceptions.Empty)
                {
                    Stored_Exceptions.Show();
                    MessageBox.Show("The file could not be read:");
                    return(false);
                }
            }
            return(true);
        }
Exemple #4
0
        bool Upload_data_from_file(string FileName)
        {
            using (StreamReader sr = new StreamReader(FileName))
            {
                string line = sr.ReadToEnd();
                string keyword;
                for (int i = 0; i < line.Length; i++)
                {
                    if (line[i] == '_') // выделение ключевого слова
                    {
                        keyword = "";
                        for (; i < line.Length && line[i] != ' '; i++)
                        {
                            keyword += line[i];
                        }
                        Enum.TryParse(keyword, out Descriptors Descriptor);
                        switch (Descriptor) // заполнение класса Test
                        {
                        case Descriptors._HEADER:
                        {
                            Descriptors_implementation._GET_RESULT(ref i, line, out _HEADER);
                            break;
                        }

                        case Descriptors._TEST_RESULT:
                        {
                            Descriptors_implementation._GET_RESULT(ref i, line, out _TEST_RESULT);
                            break;
                        }

                        case Descriptors._AUTOMATIC_RESUME:
                        {
                            Descriptors_implementation._GET_RESULT(ref i, line, out _AUTOMATIC_RESUME);
                            break;
                        }

                        case Descriptors._LEVELS_OF_EXPRESSION:
                        {
                            Descriptors_implementation._GET_RESULT(ref i, line, out _LEVELS_OF_EXPRESSION);
                            break;
                        }

                        case Descriptors._ANSWERS_TO_TESTS:
                        {
                            Descriptors_implementation._GET_RESULT(ref i, line, out _ANSWERS_TO_TESTS);
                            break;
                        }

                        case Descriptors._TEST_SCALES:
                        {
                            Descriptors_implementation._GET_RESULT(ref i, line, out _TEST_SCALES);
                            break;
                        }

                        default:
                            break;
                        }
                    }
                }
                if (!Stored_Exceptions.Empty)
                {
                    Stored_Exceptions.Show();
                    MessageBox.Show("The file could not be read:");
                    return(false);
                }
            }
            return(true);
        }
Exemple #5
0
        public bool Creat_test(string FileName) // создание теста
        {
            using (StreamReader sr = new StreamReader($"{Setting.tests_path}\\{FileName}", Encoding.GetEncoding(1251)))
            {
                string line = sr.ReadToEnd();
                string keyword;
                for (int i = 0; i < line.Length; i++)
                {
                    if (line[i] == '_') // выделение ключевого слова
                    {
                        keyword = "";
                        for (; i < line.Length && line[i] != ' '; i++)
                        {
                            keyword += line[i];
                        }
                        Enum.TryParse(keyword, out Descriptors Descriptor);
                        switch (Descriptor) // заполнение класса Test
                        {
                        case Descriptors._ANSWER:
                        {
                            Descriptors_implementation._ANSWER(_Questions, ref i, ref line);
                            break;
                        }

                        case Descriptors._QUESTION:
                        {
                            Descriptors_implementation._QUESTION(_Questions, ref i, ref line);
                            break;
                        }

                        case Descriptors._SCALE:
                        {
                            Descriptors_implementation._SCALE(_Scales, ref i, ref line);
                            break;
                        }

                        case Descriptors._KEY:
                        {
                            Descriptors_implementation._KEY(_Keys, ref i, ref line);
                            break;
                        }

                        case Descriptors._FUZZY_SETS:
                        {
                            Descriptors_implementation._FUZZY_SETS(_Fuzzy_sets, ref i, ref line);
                            break;
                        }

                        case Descriptors._NAME:
                        {
                            Descriptors_implementation._NAME(_Header, ref i, ref line);
                            break;
                        }

                        case Descriptors._DESCRIPTION:
                        {
                            Descriptors_implementation._DESCRIPTION(_Header, ref i, ref line);
                            break;
                        }

                        case Descriptors._VERIFIER:
                        {
                            Descriptors_implementation._VERIFIER(_Header, ref i, ref line);
                            break;
                        }

                        default:
                            break;
                        }
                    }
                }
                if (!Stored_Exceptions.Empty)
                {
                    Stored_Exceptions.Show();
                    MessageBox.Show("The file could not be read:");
                    return(false);
                }
            }
            return(true);
        }