NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

package com.baratitos.myapplication;

import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;
import android.widget.Toast;

import java.util.ArrayList;


public class Main2Activity extends AppCompatActivity {
int contador = 0;
TextView txtPregunta;
TextView txtNumPregunta;
RadioButton rb1, rb2, rb3, rb4, rb5;
RadioGroup rgRespuestas;
String[] preguntas = {
"La limpieza de los vidrios",
"La limpieza de las instalaciones(aulas, talleres, pasillos, áreas verdes, parqueos y sanitarios",
"El orden en las instalaciones(aulas, talleres, pasillos, áreas verdes, parqueos y sanitarios)",
"El estado físico del mobiliario, maquinaria, herramienta y equipo.",
"La diagramación de los manuales(ilustraciones, fotos, dibujos, diagramas, esquemas) facilita la comprensión de los contenidos.",
"La rapidez en la atención de las gestiones administrativas.",
"La disponibilidad de los manuales, cuando se necesitan",
"La disponibilidad de los materiales para las practicas, cuando se necesitan",
"La puntualidad para iniciar y finalizar los periodos de clase",
"El domino del tema, de parte del instructor",
"El manejo del grupo, por parte del Instructor",
"La ayudas didacticas que utiliza el instructor, para facilitar el apredisaje (guias, libros,materiales impresos, esquemas, videos, diapositivas, imagenes, etc.)",
"La actualidad de los contenidos de los manuales",
"La igualdad de trato que prinda el personal del INTECAP, a todas las personas que atiende",
"El lenguaje apropiado que utiliza el personal del INTECAP, para expresarse",
"La cortesia, el respeto, con que el personal administrativo trata a los participantes",
"La cortesia y respeto, con que el instructor trata a los participantes",
};

ArrayList<String> respuestas;




@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main2);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);

respuestas = new ArrayList<>();




txtPregunta = (TextView) findViewById(R.id.txtPregunta);
txtNumPregunta = (TextView) findViewById(R.id.txtNumPregunta);
rgRespuestas = (RadioGroup) findViewById(R.id.rgRespuestas);


rb1 = (RadioButton) findViewById(R.id.rb1);
rb2 = (RadioButton) findViewById(R.id.rb2);
rb3 = (RadioButton) findViewById(R.id.rb3);
rb4 = (RadioButton) findViewById(R.id.rb4);
rb5 = (RadioButton) findViewById(R.id.rb5);

txtNumPregunta.setText("Pregunta #" + contador);
txtPregunta.setText(String.valueOf(preguntas[contador]));

FloatingActionButton fabNext = (FloatingActionButton) findViewById(R.id.fabNext);
fabNext.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
//verificar en Array si hay respuestas previas y marcarlas

if (respuestas.get(contador).equals(""))
Toast.makeText(Main2Activity.this, "EXITO", Toast.LENGTH_SHORT).show();
switch (respuestas.get(contador)) {
case "1":
rb1.setSelected(true);
break;
case "2":
rb2.setSelected(true);
break;
case "3":
rb3.setSelected(true);
break;
case "4":
rb4.setSelected(true);
break;
case "5":
rb5.setSelected(true);
break;
default:
//si no hay respuestas guardadas, limpiar controles para poder guardar siguiente respuesta
rgRespuestas.clearCheck();
break;
}

//Si se selecciono una respuesta, gaurdarla en el ArrayList respuestas
if (rb1.isChecked()) {
respuestas.add(contador,"1");
Toast.makeText(Main2Activity.this, respuestas.get(contador), Toast.LENGTH_SHORT).show();
}

if (rb2.isChecked()) {
respuestas.add(contador,"2");
Toast.makeText(Main2Activity.this, respuestas.get(contador), Toast.LENGTH_SHORT).show();
}

if (rb3.isChecked()) {
respuestas.add(contador,"3");
Toast.makeText(Main2Activity.this, respuestas.get(contador), Toast.LENGTH_SHORT).show();
}

if (rb4.isChecked()) {
respuestas.add(contador,"4");
Toast.makeText(Main2Activity.this, respuestas.get(contador), Toast.LENGTH_SHORT).show();
}
if (rb5.isChecked()) {
respuestas.add(contador,"5");
Toast.makeText(Main2Activity.this, respuestas.get(contador), Toast.LENGTH_SHORT).show();
}


// Aumentar +1 al contador y cambiar a la siguiente pregunta
if (contador < preguntas.length - 1) {
contador += 1;
txtPregunta.setText(String.valueOf(preguntas[contador]));
txtNumPregunta.setText("Pregunta #" + contador);
}




}



});

FloatingActionButton fabPrev = (FloatingActionButton) findViewById(R.id.fabPrev);
fabPrev.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {


// Restar +1 al contador y regresar a la siguiente pregunta
if (contador > 0) {
contador -= 1;
txtPregunta.setText(String.valueOf(preguntas[contador]));
txtNumPregunta.setText("Pregunta #" + contador);
}

//Si se selecciono una respuesta, gaurdarla en el ArrayList respuestas
if (rb1.isChecked()) {
respuestas.add(contador,"1");
Toast.makeText(Main2Activity.this, respuestas.get(contador), Toast.LENGTH_SHORT).show();
}

if (rb2.isChecked()) {
respuestas.add(contador,"2");
Toast.makeText(Main2Activity.this, respuestas.get(contador), Toast.LENGTH_SHORT).show();
}

if (rb3.isChecked()) {
respuestas.add(contador,"3");
Toast.makeText(Main2Activity.this, respuestas.get(contador), Toast.LENGTH_SHORT).show();
}

if (rb4.isChecked()) {
respuestas.add(contador,"4");
Toast.makeText(Main2Activity.this, respuestas.get(contador), Toast.LENGTH_SHORT).show();
}
if (rb5.isChecked()) {
respuestas.add(contador,"5");
Toast.makeText(Main2Activity.this, respuestas.get(contador), Toast.LENGTH_SHORT).show();
}



}
})

;
getSupportActionBar().setDisplayHomeAsUpEnabled(true);


}


}
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.