public ExamenRespuestaMultipleViewModel() { preguntasExamen = new List <PreguntaMultirespuesta>(); posicion = -1; tiempoTranscurrido = new Stopwatch(); servicioExamen.getExanenCompletado += (s, a) => { preguntasExamen = a.preguntas.Cast <PreguntaMultirespuesta>().ToList(); if (preguntasExamen.Count != 0) { PreguntaMostrada = preguntasExamen[0]; posicion = 0; } NumeroPregunta = 1 + "/" + preguntasExamen.Count; respuestas = new List <bool[]>(); colorBotones = new SolidColorBrush[preguntasExamen.Count, 5]; for (int i = 0; i < preguntasExamen.Count; i++) { respuestas.Add(new bool[5]); for (int j = 0; j <= 4; j++) { colorBotones[i, j] = new SolidColorBrush(Colors.Transparent); respuestas.ElementAt(i)[j] = false; } } avisarCambioPreguntaVisivilidad(); }; }
public void anteriorPregunta() { if (posicion > 0) { posicion--; PreguntaMostrada = preguntasExamen[posicion]; ColorBoton1 = colorBotones[posicion, 0]; ColorBoton2 = colorBotones[posicion, 1]; ColorBoton3 = colorBotones[posicion, 2]; ColorBoton4 = colorBotones[posicion, 3]; ColorBoton5 = colorBotones[posicion, 4]; NumeroPregunta = (posicion + 1) + "/" + preguntasExamen.Count; avisarCambioPreguntaVisivilidad(); } }
public void siguientePregunta() { if (posicion < preguntasExamen.Count - 1 && posicion != -1) { posicion++; PreguntaMostrada = preguntasExamen[posicion]; ColorBoton1 = colorBotones[posicion, 0]; ColorBoton2 = colorBotones[posicion, 1]; ColorBoton3 = colorBotones[posicion, 2]; ColorBoton4 = colorBotones[posicion, 3]; ColorBoton5 = colorBotones[posicion, 4]; NumeroPregunta = (posicion + 1) + "/" + preguntasExamen.Count; avisarCambioPreguntaVisivilidad(); } }