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(); } }
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]); } }
private void btnSalir_Click(object sender, EventArgs e) { SalirCuestionario Salir = new SalirCuestionario(this, formPadre); if (lbPregunta.Text.Contains("Tuviste")) { TiempoCuestionario.Stop(); this.Close(); formPadre.btnCuestionario.Enabled = true; formPadre.lbPrincipal.Text = "Consulta FI"; } else { this.Enabled = false; TiempoCuestionario.Stop(); Salir.Show(); } }
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(); lbPregunta.Hide(); radboA.Hide(); radboB.Hide(); radboC.Hide(); Minutos.Hide(); Segundos.Hide(); label3.Hide(); btnSiguiente.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]); } }
private void Cuestionario_FormClosing(object sender, FormClosingEventArgs e) { TiempoCuestionario.Stop(); Program.consultaFI.Show(); }