Пример #1
0
        public FormResponses(responseFixed responseFixed)
        {
            InitializeComponent();
            this.responseFixed = responseFixed;

            // Pre-populate with true/false
            this.dataGridView1.Rows.Add(2);
            this.dataGridView1.Rows[0].Cells[0].Value = "true";
            this.dataGridView1.Rows[0].Cells[1].Value = "yes";
            this.dataGridView1.Rows[1].Cells[0].Value = "false";
            this.dataGridView1.Rows[1].Cells[1].Value = "no";
        }
Пример #2
0
        private void buttonNext_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(this.textBoxQID.Text) ||
                string.IsNullOrWhiteSpace(this.textBoxQText.Text))
            {
                Mbox.ShowSimpleMsgBoxError("Required data missing!");
                return;
            }

            q    = new question();
            q.id = this.textBoxQID.Text;
            questionText qt = new questionText();

            qt.Value = this.textBoxQText.Text;
            q.text   = qt;

            // Responses
            response responses = new response();

            q.response = responses;

            if (this.radioButtonMCYes.Checked)
            {
                // MCQ: display response form
                responseFixed responseFixed = new responseFixed();
                responses.Item = responseFixed;
                FormResponses formResponses = new FormResponses(responseFixed);
                formResponses.ShowDialog();

                // TODO - handle cancel
            }
            else
            {
                // Not MCQ
                responseFree responseFree = new responseFree();
                responses.Item = responseFree;

                // Free - just text for now
                // later, configure type
                responseFree.format = responseFreeFormat.text;
            }

            // Finally, add to part
            //updateQuestionsPart(q);

            this.Close();
        }