private void TiempoCuestionario_Tick(object sender, EventArgs e)
 {
     if (MinutosRestantes >= 0)
     {
         if (SegundosRestantes >= 0)
         {
             SegundosRestantes = SegundosRestantes - 1;
             if (SegundosRestantes < 10)
             {
                 Segundos.Text = "0" + SegundosRestantes.ToString();
             }
             else
             {
                 Segundos.Text = SegundosRestantes.ToString();
             }
         }
         else
         {
             SegundosRestantes = 60;
             MinutosRestantes  = MinutosRestantes - 1;
             if (MinutosRestantes < 10)
             {
                 Minutos.Text = "0" + MinutosRestantes.ToString();
             }
             else
             {
                 Minutos.Text = MinutosRestantes.ToString();
             }
         }
     }
     else
     {
         TiempoCuestionario.Stop();
         MessageBox.Show("Se te ha acabado el tiempo.", "Tiempo");
         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]);
     }
 }
        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();
        }
        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]);
            }
        }