Esempio n. 1
0
        //
        //On click of Previous button: Stores the selected answer and navigates to the previous question
        //
        private void previous_Click(object sender, EventArgs e)
        {
            //Stores the selected answer
            ans = (string)orderTextBox.Text;
            ab.storeAnswer(a, index, ans);

            //Navigates to the previous question
            index--;
            string prev = q[index].format;
            switch (prev)
            {
                case "Match The Column":
                    MatchTheColumnTest mc = new MatchTheColumnTest(q, a, b, index, timeLeft, emp, ed);
                    mc.MdiParent = this.MdiParent;
                    mc.Dock = DockStyle.Fill;
                    this.Close();
                    mc.Show();
                    break;

                case "MCQ (Single Answer)":
                    SingleAnswerTest mb = new SingleAnswerTest(q, a, b, index, timeLeft, emp, ed);
                    mb.MdiParent = this.MdiParent;
                    mb.Dock = DockStyle.Fill;
                    this.Close();
                    mb.Show();
                    break;

                case "MCQ (Multiple Answers)":
                    MultipleAnswerTest ma = new MultipleAnswerTest(q, a, b, index, timeLeft, emp, ed);
                    ma.MdiParent = this.MdiParent;
                    ma.Dock = DockStyle.Fill;
                    this.Close();
                    ma.Show();
                    break;

                case "Picture Question: Single Answer":
                    PictureQuestionSingleAns mp = new PictureQuestionSingleAns(q, a, b, index, timeLeft, emp, ed);
                    mp.MdiParent = this.MdiParent;
                    mp.Dock = DockStyle.Fill;
                    this.Close();
                    mp.Show();
                    break;

                case "Picture Question: Multiple Answer":
                    PictureQuestionMultipleAnswer mm = new PictureQuestionMultipleAnswer(q, a, b, index, timeLeft, emp, ed);
                    mm.MdiParent = this.MdiParent;
                    mm.Dock = DockStyle.Fill;
                    this.Close();
                    mm.Show();
                    break;
            }
        }
Esempio n. 2
0
        //
        //On click of another question in Boomark Grid: Stores the selected ans, gets the clicked questions and navigates to it
        //
        private void bookmarkGrid_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            //Stores the selected ans
            ans = (string)orderTextBox.Text;
            ab.storeAnswer(a, index, ans);

            //Gets the clicked questions and navigates to it
            Point p = bookMarkGrid.CurrentCellAddress;
            index = p.Y;
            switch (q[index].format)
            {
                case "Match The Column":
                    MatchTheColumnTest mc = new MatchTheColumnTest(q, a, b, index, timeLeft, emp, ed);
                    mc.MdiParent = this.MdiParent;
                    mc.Dock = DockStyle.Fill;
                    this.Close();
                    mc.Show();
                    break;

                case "MCQ (Single Answer)":
                    SingleAnswerTest mb = new SingleAnswerTest(q, a, b, index, timeLeft, emp, ed);
                    mb.MdiParent = this.MdiParent;
                    mb.Dock = DockStyle.Fill;
                    this.Close();
                    mb.Show();
                    break;

                case "MCQ (Multiple Answers)":
                    MultipleAnswerTest ma = new MultipleAnswerTest(q, a, b, index, timeLeft, emp, ed);
                    ma.MdiParent = this.MdiParent;
                    ma.Dock = DockStyle.Fill;
                    this.Close();
                    ma.Show();
                    break;

                case "Picture Question: Single Answer":
                    PictureQuestionSingleAns mp = new PictureQuestionSingleAns(q, a, b, index, timeLeft, emp, ed);
                    mp.MdiParent = this.MdiParent;
                    mp.Dock = DockStyle.Fill;
                    this.Close();
                    mp.Show();
                    break;

                case "Picture Question: Multiple Answer":
                    PictureQuestionMultipleAnswer mm = new PictureQuestionMultipleAnswer(q, a, b, index, timeLeft, emp, ed);
                    mm.MdiParent = this.MdiParent;
                    mm.Dock = DockStyle.Fill;
                    this.Close();
                    mm.Show();
                    break;
            }
        }
Esempio n. 3
0
        //
        //On click of Previous button: Stores the selected answer and navigates to the previous question
        //
        private void previous_Click(object sender, EventArgs e)
        {
            //Stores the selected answer
            string ans = "";
            if (option1Radio.Checked)
                ans = ans + "1";
            else if (option2Radio.Checked)
                ans = ans + "2";
            else if (option3Radio.Checked)
                ans = ans + "3";
            else if (option4Radio.Checked)
                ans = ans + "4";
            ab.storeAnswer(a, index, ans);

            //Navigates to the previous question
            index--;
            switch (q[index].format)
            {
                case "Match The Column":
                    MatchTheColumnTest mc = new MatchTheColumnTest(q, a, b, index, timeLeft, emp, ed);
                    mc.MdiParent = this.MdiParent;
                    mc.Dock = DockStyle.Fill;
                    this.Close();
                    mc.Show();
                    break;

                case "MCQ (Single Answer)":
                    SingleAnswerTest mb = new SingleAnswerTest(q, a, b, index, timeLeft, emp, ed);
                    mb.MdiParent = this.MdiParent;
                    mb.Dock = DockStyle.Fill;
                    this.Close();
                    mb.Show();
                    break;

                case "MCQ (Multiple Answers)":
                    MultipleAnswerTest ma = new MultipleAnswerTest(q, a, b, index, timeLeft, emp, ed);
                    ma.MdiParent = this.MdiParent;
                    ma.Dock = DockStyle.Fill;
                    this.Close();
                    ma.Show();
                    break;

                case "Picture Question: Single Answer":
                    PictureQuestionSingleAns mp = new PictureQuestionSingleAns(q, a, b, index, timeLeft, emp, ed);
                    mp.MdiParent = this.MdiParent;
                    mp.Dock = DockStyle.Fill;
                    this.Close();
                    mp.Show();
                    break;

                case "Picture Question: Multiple Answer":
                    PictureQuestionMultipleAnswer mm = new PictureQuestionMultipleAnswer(q, a, b, index, timeLeft, emp, ed);
                    mm.MdiParent = this.MdiParent;
                    mm.Dock = DockStyle.Fill;
                    this.Close();
                    mm.Show();
                    break;
             }
        }