コード例 #1
0
        private void btnSiguiente_Click(object sender, EventArgs e)
        {
            if (NumeroPregunta < 10)
            {
                //PreguntasDelCuestionaro Pregunta = (PreguntasDelCuestionaro)Preguntas[Aleatorio[NumeroPregunta]];
                PreguntasDelCuestionaro Pregunta = (PreguntasDelCuestionaro)Preguntas[Numeros[NumeroPregunta]];
                //Aumenta el puntaje obtenido por el usuario.
                if (radboA.Checked)
                {
                    if (Pregunta.R1 == Pregunta.rCorrecta)
                    {
                        puntaje++;
                    }
                }
                else if (radboB.Checked)
                {
                    if (Pregunta.R2 == Pregunta.rCorrecta)
                    {
                        puntaje++;
                    }
                }
                else if (radboC.Checked)
                {
                    if (Pregunta.R1 == Pregunta.rCorrecta)
                    {
                        puntaje++;
                    }
                }

                //Verifica que por lo menos un RadioButton está seleccionado para cambiar de pregunta.
                if (radboA.Checked || radboB.Checked || radboC.Checked)
                {
                    lbPregunta.Text = (++NumeroPregunta).ToString() + "-. " + Pregunta.Pregunta;
                    radboA.Text     = "A) " + Pregunta.R1;
                    radboB.Text     = "B) " + Pregunta.R2;
                    radboC.Text     = "C) " + Pregunta.R3;
                }
                else
                {
                    MessageBox.Show("No puedes pasar a la siguiente pregunta hasta que hayas seleccionado una opción.");
                }
            }
            else
            {
                TiempoCuestionario.Stop();
                lbPregunta.Text = "Tuviste " + puntaje.ToString() + "respuestas correctas";
                radboA.Hide();
                radboB.Hide();
                radboC.Hide();
                Minutos.Hide();
                Segundos.Hide();
                label3.Hide();
                btnSiguiente.Hide();
            }
        }
コード例 #2
0
        public Cuestionario()
        {
            ConstruirCuestionario();

            //PreguntasDelCuestionaro Pregunta = (PreguntasDelCuestionaro)Preguntas[Aleatorio[NumeroPregunta]];
            PreguntasDelCuestionaro Pregunta = (PreguntasDelCuestionaro)Preguntas[Numeros[NumeroPregunta]];

            InitializeComponent();
            TiempoCuestionario.Start();
            Minutos.Text = "19";

            lbPregunta.Text = (++NumeroPregunta).ToString() + "-. " + Pregunta.Pregunta;
            radboA.Text     = "A) " + Pregunta.R1;
            radboB.Text     = "B) " + Pregunta.R2;
            radboC.Text     = "C) " + Pregunta.R3;
        }
コード例 #3
0
        public Cuestionario(Form1 formPadre)
        {
            this.formPadre = formPadre;
            MdiParent      = formPadre;

            ConstruirCuestionario();

            PreguntasDelCuestionaro MostrarPregunta = (PreguntasDelCuestionaro)Preguntas[Numeros[NumeroPregunta]];

            InitializeComponent();

            TiempoCuestionario.Start();

            Minutos.Text = "19";
            //++NumeroPregunta
            lbPregunta.Text = (1).ToString() + "-. " + MostrarPregunta.Pregunta;
            radboA.Text     = "A) " + MostrarPregunta.R1;
            radboB.Text     = "B) " + MostrarPregunta.R2;
            radboC.Text     = "C) " + MostrarPregunta.R3;

            GraficaPuntosCorrectos.Hide();
        }
コード例 #4
0
        private void btnSiguiente_Click(object sender, EventArgs e)
        {
            if (NumeroPregunta < 10)
            {
                PreguntasDelCuestionaro MostrarPregunta = (PreguntasDelCuestionaro)Preguntas[Numeros[NumeroPregunta]];
                //Aumenta el puntaje obtenido por el usuario.
                if (radboA.Checked)
                {
                    if (MostrarPregunta.R1 == MostrarPregunta.rCorrecta)
                    {
                        puntaje++;
                        incorrecta[NumeroPregunta] = 0;
                    }
                    else
                    {
                        incorrecta[NumeroPregunta] = MostrarPregunta.Tema;
                        FilaRIncorrectas.Enqueue(NumeroPregunta);
                    }
                }
                else if (radboB.Checked)
                {
                    if (MostrarPregunta.R2 == MostrarPregunta.rCorrecta)
                    {
                        puntaje++;
                        incorrecta[NumeroPregunta] = 0;
                    }
                    else
                    {
                        incorrecta[NumeroPregunta] = MostrarPregunta.Tema;
                        FilaRIncorrectas.Enqueue(NumeroPregunta);
                    }
                }
                else if (radboC.Checked)
                {
                    if (MostrarPregunta.R1 == MostrarPregunta.rCorrecta)
                    {
                        puntaje++;
                        incorrecta[NumeroPregunta] = 0;
                    }
                    else
                    {
                        incorrecta[NumeroPregunta] = MostrarPregunta.Tema;
                        FilaRIncorrectas.Enqueue(NumeroPregunta);
                    }
                }

                //Verifica que por lo menos un RadioButton está seleccionado para cambiar de pregunta.
                if (radboA.Checked || radboB.Checked || radboC.Checked)
                {
                    lbPregunta.Text = (++NumeroPregunta).ToString() + "-. " + MostrarPregunta.Pregunta;
                    radboA.Text     = "A) " + MostrarPregunta.R1;
                    radboB.Text     = "B) " + MostrarPregunta.R2;
                    radboC.Text     = "C) " + MostrarPregunta.R3;
                }
                else
                {
                    MessageBox.Show("No puedes pasar a la siguiente pregunta hasta que hayas seleccionado una opción.", "Respuesta no seleccionada");
                }
            }
            else
            {
                TiempoCuestionario.Stop();
                lbPregunta.Text = "Tuviste " + puntaje.ToString() + " respuestas correctas.";
                panelPreguntas.Hide();
                GraficaPuntosCorrectos.Show();
                int[] MisErrores = TemasIncorrectos(incorrecta);
                GraficaPuntosCorrectos.Titles.Add("Temas en que has tenido errores.");
                GraficaPuntosCorrectos.Series["Temas"].Points.AddXY("Tema 1", MisErrores[0]);
                GraficaPuntosCorrectos.Series["Temas"].Points.AddXY("Tema 2", MisErrores[1]);
                GraficaPuntosCorrectos.Series["Temas"].Points.AddXY("Tema 3", MisErrores[2]);
                GraficaPuntosCorrectos.Series["Temas"].Points.AddXY("Tema 4", MisErrores[3]);
            }
        }