예제 #1
0
파일: Form2.cs 프로젝트: akouvach/autoeva
        private void Form2_Load(object sender, EventArgs e)
        {
            //Cargando el archivo Json de configuración de la autoevaluación

            this.miAutoeva = this.LoadJson();

            this.Text         = this.miAutoeva.Nombre;
            this.lbl_nro.Text = this.preguntaActual.ToString();

            this.btn_izq.Enabled = false;
            this.btn_der.Enabled = false;
            this.btn_fin.Enabled = false;


            //Cargo los alumnos
            foreach (Alumno alu in this.miAutoeva.Alumnos)
            {
                this.cmb_alumnos.Items.Add(alu.Nombre + ", " + alu.Apellido);
            }
        }
예제 #2
0
파일: Form2.cs 프로젝트: akouvach/autoeva
        private Autoevaluacion LoadJson()
        {
            Autoevaluacion preguntas = new Autoevaluacion();

            try
            {
                using StreamReader r = new StreamReader("autoeva.json");
                string json = r.ReadToEnd();

                //dynamic array = JsonConvert.DeserializeObject(json);

                preguntas = JsonConvert.DeserializeObject <Autoevaluacion>(json);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }

            return(preguntas);
        }