`public partial class EvaluacioTableros : Form
{
public static int score = 0;
int i, c = 0;
string correctop;
public EvaluacioTableros()
{
InitializeComponent();
}
returnclass rc = new returnclass();
private void EvaluacioTableros_Load(object sender, EventArgs e)
{
i = Convert.ToInt32(rc.scalarReturn("select min(p_id) from preguntas where p_fk_crs=" + Indicadores_Antropometricos.exam_tbl));
label1.Text = rc.scalarReturn("Select p_title from preguntas where p_id=" + i + "and p_fk_crs=" + Indicadores_Antropometricos.exam_tbl);
radioButton1.Text = rc.scalarReturn("Select p_opa from preguntas where p_id=" + i + "and p_fk_crs=" + Indicadores_Antropometricos.exam_tbl);
radioButton2.Text = rc.scalarReturn("Select p_opb from preguntas where p_id=" + i + "and p_fk_crs=" + Indicadores_Antropometricos.exam_tbl);
radioButton3.Text = rc.scalarReturn("Select p_opc from preguntas where p_id=" + i + "and p_fk_crs=" + Indicadores_Antropometricos.exam_tbl);
radioButton4.Text = rc.scalarReturn("Select p_opd from preguntas where p_id=" + i + "and p_fk_crs=" + Indicadores_Antropometricos.exam_tbl);
correctop = rc.scalarReturn("select p_opcorrect from preguntas where p_id=" + i + "and p_fk_crs=" + Indicadores_Antropometricos.exam_tbl);
}`
` string s, selectedvalue = " ";
private void button1_Click(object sender, EventArgs e)
{
realizarEva();
}
`introducir el código aquí`
private void realizarEva()
{
c++;
if (radioButton1.Checked == true)
{
selectedvalue = radioButton1.Text;
}
else if (radioButton2.Checked == true)
{
selectedvalue = radioButton2.Text;
}
else if (radioButton3.Checked == true)
{
selectedvalue = radioButton3.Text;
}
else if (radioButton4.Checked == true)
{
selectedvalue = radioButton4.Text;
}
else
{
MessageBox.Show("Por favor selecciona una opción");
}
if (selectedvalue == correctop)
{
score++;
}`
`s = rc.scalarReturn("select min(p_id) from preguntas where p_id>" + i + "and p_fk_crs=" + Indicadores_Antropometricos.exam_tbl);
if (s.Equals(""))
{
MessageBox.Show("Finalizo su evaluación");
button1.Enabled = false;
}
else
{
i = Convert.ToInt32(s);
label1.Text = rc.scalarReturn("Select p_title from preguntas where p_id=" + i + "and p_fk_crs=" + Indicadores_Antropometricos.exam_tbl);
radioButton1.Text = rc.scalarReturn("Select p_opa from preguntas where p_id=" + i + "and p_fk_crs=" + Indicadores_Antropometricos.exam_tbl);
radioButton2.Text = rc.scalarReturn("Select p_opb from preguntas where p_id=" + i + "and p_fk_crs=" + Indicadores_Antropometricos.exam_tbl);
radioButton3.Text = rc.scalarReturn("Select p_opc from preguntas where p_id=" + i + "and p_fk_crs=" + Indicadores_Antropometricos.exam_tbl);
radioButton4.Text = rc.scalarReturn("Select p_opd from preguntas where p_id=" + i + "and p_fk_crs=" + Indicadores_Antropometricos.exam_tbl);
correctop = rc.scalarReturn("select p_opcorrect from preguntas where p_id=" + i + "and p_fk_crs=" + Indicadores_Antropometricos.exam_tbl);
}`
`raddbtn();
introducir`introducir el código aquí
string lastquestions = rc.scalarReturn("select max(p_id)from preguntas where p_fk_crs=" + Indicadores_Antropometricos.exam_tbl);
if (lastquestions.Equals(i.ToString()))
{
float per = (score / c + 1) * 100;
insertclass iC = new insertclass();
iC.insert_score(score.ToString(), FormLogin1.LoginNam, Indicadores_Antropometricos.exam_tbl, per.ToString(), System.DateTime.Now.ToShortDateString());;`