Exemple #1
0
        private int[] getRadButStatus()
        {
            bool[] status = new bool[15];

            SeminarForm sf = this;

            Control[] groupBox = this.Controls.Find("opt", false);
            int       i        = 0;

            foreach (Control con in groupBox)
            {
                Control[] radio = con.Controls.Find("radio", false);
                foreach (Control rad in radio)
                {
                    status[i] = ((RadioButton)rad).Checked;
                    i++;
                }
            }

            int k = 0;

            int[] intStat = new int[5];
            for (int q = 0; q < 5; q++)
            {
                intStat[q] = 0;
            }

            for (int p = 0; p < status.Length; p += 3)
            {
                int l = 0;
                for (int j = p; j < p + 3; j++)
                {
                    if (status[j] == true)
                    {
                        intStat[k] = l + 1;
                        //k++;
                    }

                    l++;
                }

                k++;
            }

            return(intStat);
        }
Exemple #2
0
        void lectionPressed(object sender, EventArgs e)
        {
            if (((LinkLabel)sender).Tag.GetType().Name.Equals("lection"))
            {
                switch (((lection)((LinkLabel)sender).Tag).type)
                {
                case "lec":
                    LectionForm f2 = new LectionForm(userProgress);
                    f2.Tag = (lection)((LinkLabel)sender).Tag;

                    f2.Show();
                    break;

                case "sem":
                    SeminarForm f1 = new SeminarForm(userProgress);
                    f1.Tag = (lection)((LinkLabel)sender).Tag;
                    f1.Show();
                    break;
                }
            }
            else
            {
                if (((exam)((LinkLabel)sender).Tag).lesson == 1)
                {
                    ExamForm f3 = new ExamForm(userProgress);
                    f3.Tag = (exam)((LinkLabel)sender).Tag;
                    f3.Show();
                }
                else
                {
                    if (userProgress.getExamProgress(((exam)((LinkLabel)sender).Tag).lesson - 1) > 3 && ((exam)((LinkLabel)sender).Tag).lesson > 1)
                    {
                        ExamForm f3 = new ExamForm(userProgress);
                        f3.Tag = (exam)((LinkLabel)sender).Tag;
                        f3.Show();
                    }
                    else
                    {
                        MessageBox.Show("Вы не сдали предыдущий экзамен!");
                    }
                }
            }
        }