Esempio n. 1
0
        public bool connectOpr(string add)
        {
            opros op = new opros();
            if (!op.load(add)) return false;

            if (this.anketa.Count != op.anketa.Count) return false;
            for (int i=0; i<op.anketa.Count; i++)
            {
                if (this.anketa[i] != op.anketa[i]) return false;
            }

            foreach (var x in op.testers)
            {
                tester t = new tester();
                foreach (var a in x.anketa)
                {
                    t.anketa.Add(a);
                }
                foreach (var a in x.answers)
                {
                    answer answ = new answer(new List<bool>());
                    foreach (var b in a.SelectedAnswers)
                    {
                        answ.SelectedAnswers.Add(b);
                    }
                    t.answers.Add(answ);
                }
                this.testers.Add(t);
            }
            return true;
        }
Esempio n. 2
0
        public mainOpros(opros x)
        {
            InitializeComponent();
            res = x;
            changePage();

            foreach (var i in res.selectedOprosnik.elements) //заполним список ответов пустотой :\
            {
                res.testers[0].answers.Add(new answer(new List<bool>()));
            }
        }
Esempio n. 3
0
        public AnswersData(opros res)
        {
            InitializeComponent();
            this.res = res;

            foreach (var a in res.selectedOprosnik.elements)
            {
                treeView1.Nodes.Add(a.question);
                if (a.IsOneVariant) treeView1.Nodes[treeView1.Nodes.Count - 1].ForeColor = Color.Blue;
                else treeView1.Nodes[treeView1.Nodes.Count - 1].ForeColor = Color.Green;
                    //один ответ = синий
            }
        }
Esempio n. 4
0
 public FormBeginOpros(string way, opros x)
 {
     InitializeComponent();
     if (!x.load(way)) { MessageBox.Show("Это не файл опроса"); };
     label3ostalos.Text = (x.maxTesters - x.testers.Count).ToString();
     if (x.maxTesters - x.testers.Count < 1)
     {
         label3ostalos.Text = "0";
         button1.Enabled = false;
         button1.Text = "Опрос завершён";
     }
     label3desc.Text = x.Description;
 }
Esempio n. 5
0
 private void button1_Click(object sender, EventArgs e)
 {
     List<string> s= new List<string>();
     try
     {
         result = new opros(Convert.ToInt32(textBox1.Text), richTextBox1.Text, x, checkBox1.Checked, s);
         this.DialogResult = DialogResult.OK;
     }
     catch
     {
         MessageBox.Show("Ошибка при создании опроса");
     }
     this.Close();
 }
Esempio n. 6
0
        private void button4load_Click(object sender, EventArgs e)
        {
            try
            {
                string t = openFileDialog2continue.Title;

                okFileOprosOpen = false;
                openFileDialog2continue.Title = "Выберите исходный опрос";
                openFileDialog2continue.ShowDialog();
                if (!okFileOprosOpen) return;

                string source = openFileDialog2continue.FileName;

                okFileOprosOpen = false;
                openFileDialog2continue.Title = "Выберите догружаемый опрос";
                openFileDialog2continue.ShowDialog();
                if (!okFileOprosOpen) return;

                string add = openFileDialog2continue.FileName;

                opros res = new opros();
                if (!res.load(source)) { MessageBox.Show("Выбраный файл не является опросом"); };
                if (!res.connectOpr(add))
                {
                    MessageBox.Show("У опросников должны быть одинаковые анкеты" + Environment.NewLine + "Кроме того, они должны быть основаны на одном и том же опроснике");
                    return;
                }

                openFileDialog2continue.Title = t;

                okFileOprosSave = false;
                saveFileDialog1.ShowDialog();
                if (!okFileOprosSave) return;
                res.save(saveFileDialog1.FileName);

                MessageBox.Show("Результат сохранён");
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Esempio n. 7
0
        private void button3continue_Click(object sender, EventArgs e)
        {
            try
            {
                okFileOprosOpen = false;
                openFileDialog2continue.ShowDialog();
                if (okFileOprosOpen)
                {
                    opros res = new opros();
                    FormBeginOpros fb = new FormBeginOpros(openFileDialog2continue.FileName, res);
                    fb.ShowDialog();
                    if (fb.DialogResult != DialogResult.OK) return;

                    res.testers.Insert(0, new tester()); //0ой тестер
                    if (res.IsAnonimus == false)
                    {
                        anketaFill af = new anketaFill(res);
                        af.ShowDialog();
                        if (af.DialogResult != DialogResult.OK) return;
                    }

                    mainOpros mo = new mainOpros(res);
                    mo.ShowDialog();

                    if (mo.DialogResult != DialogResult.OK) return;
                    res.save(openFileDialog2continue.FileName);
                    MessageBox.Show("Опрос пройден. Результаты сохранены.");
                }
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Esempio n. 8
0
 public anketa(opros x)
 {
     InitializeComponent();
     res = x;
 }
Esempio n. 9
0
 public anketaFill(opros op)
 {
     InitializeComponent();
     res = op;
     dosome();
 }
Esempio n. 10
0
 public resultsForm(string way)
 {
     InitializeComponent();
     res = new opros();
     if (!res.load(way)) { MessageBox.Show("Выбраный файл не является опросом"); }
 }
Esempio n. 11
0
 public OproshinieData(opros s)
 {
     InitializeComponent();
     res = s;
 }