Example #1
0
        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);
        }
Example #2
0
        public Test_selection()
        {
            InitializeComponent();

            const int Width_Button = 550, Height_Button = 45;

            BackgroundImage = Design.Background;
            Design.Design_for_label(label_SName);
            Design.Design_for_label(label_Name);
            Design.Design_for_label(label_PName);
            Design.Design_for_label(label_day);
            Design.Design_for_label(label_month);
            Design.Design_for_label(label_year);

            this.SuspendLayout(); //Временно приостанавливает логику компоновки для элемента управления.
            List <string> test_names = new List <string>(Additional_functions.Get_filenames(Setting.tests_path));

            Button[] Test_add_button = new Button[test_names.Count];
            Test_add_button[0] = new Button
            {
                Text   = test_names[0],
                Width  = Width_Button,
                Height = Height_Button,
                BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch,
                Font     = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))),
                Location = new Point(50, textBox4.Location.Y + textBox4.Height + 45)
            };
            Design.Design_for_button(Test_add_button[0]);
            Test_add_button[0].Click += new EventHandler(Button_add_test_Click);
            this.Controls.Add(Test_add_button[0]);
            for (int i = 1; i < test_names.Count; i++)
            {
                Test_add_button[i] = new Button
                {
                    Width = Width_Button, Height = Height_Button, Text = test_names[i],
                    BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch,
                    Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)))
                };
                Test_add_button[i].Location = new Point(50, Test_add_button[i - 1].Location.Y + Test_add_button[i - 1].Height + 5);
                this.Controls.Add(Test_add_button[i]);
                Test_add_button[i].Click += new EventHandler(Button_add_test_Click);
                Design.Design_for_button(Test_add_button[i]);
            }
            Button StatTest = new Button {
                Width = Width_Button - 100, Height = Height_Button, Text = "Начать тестирование"
            };

            StatTest.Click += new EventHandler(StatTest_Click);
            Design.Design_for_button(StatTest);
            StatTest.Location = new Point(150, Test_add_button[Test_add_button.Length - 1].Location.Y + Test_add_button[Test_add_button.Length - 1].Height + 35);
            this.Controls.Add(StatTest);

            this.AutoScrollMargin = new System.Drawing.Size(0, 20);
            this.ResumeLayout(false);//
            this.Show();
        }
Example #3
0
 private void Button_update_Click(object sender, EventArgs e)  // update Listbox
 {
     try
     {
         listBox_test_results.Items.Clear();
         List <string> names = new List <string>(Additional_functions.Get_filenames(Setting.database_path));
         for (int i = 0; i < names.Count; i++)
         {
             listBox_test_results.Items.Add(names[i]);
         }
     }
     catch
     {
         MessageBox.Show("Ошибка: БД результатов не найдена");
     }
 }
Example #4
0
        public Form3()
        {
            InitializeComponent();
            this.BackgroundImage = Design.Background;
            this.Show();
            this.DoubleBuffered = true;
            this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);

            try
            {
                listBox_tests.Items.Clear();
                List <string> names = new List <string>(Additional_functions.Get_filenames(Setting.tests_path));
                for (int i = 0; i < names.Count; i++)
                {
                    listBox_tests.Items.Add(names[i]);
                }
            }
            catch
            {
                MessageBox.Show("Ошибка: БД тестов не найдена");
                this.Close();
                return;
            }
        }