Beispiel #1
0
 private void AddControl( )
 {
     this.panelQw.Controls.Clear();
     if (Datass.QQ[Datass.polz] is OnePossibleAnswers)
     {
         OnePossibleAnswers buf = (OnePossibleAnswers)Datass.QQ[Datass.polz];
         SpisokBoxTip.SelectedIndex = 0;
         this.panelQw.Controls.AddRange(buf.masEl);
     }
     else if (Datass.QQ[Datass.polz] is SeveralPossibleAnswers)
     {
         SeveralPossibleAnswers buf = (SeveralPossibleAnswers)Datass.QQ[Datass.polz];
         this.panelQw.Controls.AddRange(buf.masEl);
         SpisokBoxTip.SelectedIndex = 1;
     }
     else if (Datass.QQ[Datass.polz] is QuestionForCompliance)
     {
         QuestionForCompliance buf = (QuestionForCompliance)Datass.QQ[Datass.polz];
         this.panelQw.Controls.AddRange(buf.masEl);
         SpisokBoxTip.SelectedIndex = 2;
     }
     else if (Datass.QQ[Datass.polz] is FreeAnswer)
     {
         FreeAnswer buf = (FreeAnswer)Datass.QQ[Datass.polz];
         this.panelQw.Controls.AddRange(buf.masEl);
         SpisokBoxTip.SelectedIndex = 3;
     }
 }
Beispiel #2
0
        static public bool read_proget()
        {
            Datass.Readerfile = new StreamReader(Datass.Namefile);
            string buf;

            Datass.kol  = 0;
            Datass.polz = 0;

            string[] b1;
            string[] b;
            string[] d  = new string[1];
            string[] d1 = new string[1];
            d[0]  = " ;;";
            d1[0] = "end\r\n";
            if ((buf = Datass.Readerfile.ReadLine()) != null)
            {
                b = buf.Split(d, StringSplitOptions.RemoveEmptyEntries);
            }
            else
            {
                return(false);
            }
            if (String.Compare(b[0], "SET") == 0)
            {
                SET(b);
                buf = Datass.Readerfile.ReadToEnd();
                b1  = buf.Split(d1, StringSplitOptions.RemoveEmptyEntries);
                foreach (string ss in b1)

                {
                    b = ss.Split(d, StringSplitOptions.RemoveEmptyEntries);


                    if (String.Compare(b[0], "AOT") == 0)
                    {
                        Datass.NameTest  = b[1];
                        Datass.OpisTest  = b[2];
                        Datass.AutorTest = b[3];
                    }
                    else if (String.Compare(b[0], "OPA") == 0)
                    {
                        OnePossibleAnswers bufq = new OnePossibleAnswers();
                        bufq.WriteingQW(b);
                        Datass.QQ.Add(bufq);
                        Datass.kol++;
                    }
                    else if (String.Compare(b[0], "SPA") == 0)
                    {
                        SeveralPossibleAnswers bufq = new SeveralPossibleAnswers();
                        bufq.WriteingQW(b);
                        Datass.QQ.Add(bufq);
                        Datass.kol++;
                    }
                    else if (String.Compare(b[0], "FA") == 0)
                    {
                        FreeAnswer bufq = new FreeAnswer();
                        bufq.WriteingQW(b);
                        Datass.QQ.Add(bufq);
                        Datass.kol++;
                    }
                    else if (String.Compare(b[0], "QFS") == 0)
                    {
                        QuestionForCompliance bufq = new QuestionForCompliance();
                        bufq.WriteingQW(b);
                        Datass.QQ.Add(bufq);
                        Datass.kol++;
                    }
                }
            }
            else
            {
                return(false);
            }
            return(true);
        }