Это тест, по его завершению должно появиться сообщение, в котором будут показаны ошибки и оценка, сообщение появляется, но количество ошибок выдавать не хочет, хотя вроде бы все правильно:
Код:
Код:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace курсач
{
public partial class Form2 : Form
{
public int A;//подсчитывает результаты
public Form2()
{
InitializeComponent();
this.button1.Click += new EventHandler(second);
}
private void Form2_Load(object sender, EventArgs e)
{
label2.Text = "В мировоззрении эмоциональный опыт людей представлен в:";
radioButton1.Text = "миропонимании";
radioButton2.Text = "психике";
radioButton3.Text = "мироощущении";
if (radioButton3.Checked==true)
{
A = A + 1;
}
else
{
A = A+0;
}
}
private void second(object sender, EventArgs e)
{
label2.Text = "Религия являются:";
radioButton1.Text = "необходим результат становления и развития общественных отношений";
radioButton2.Text = "способ преодоления человеческого же отчуждения";
radioButton3.Text = "феномен искусства";
this.button1.Click -= new EventHandler(second);
this.button1.Click += new EventHandler(third);
if (radioButton1.Checked==true)
{
A = A + 1;
}
else
{
A = A + 0;
}
}
private void third(object sender, EventArgs e)
{
label2.Text = "Мифологическое мировоззрение — это:";
radioButton1.Text = "магия";
radioButton2.Text = "первая форма человеческого самосознания";
radioButton3.Text = "религиозное мировоззрение";
this.button1.Click -= new EventHandler(third);
this.button1.Click += new EventHandler(fourth);
if (radioButton2.Checked==true)
{
A = A + 1;
}
else
{
A = A + 0;
}
}
private void fourth(object sender, EventArgs e)
{
label2.Text = "В мировоззрении интеллектуальной опыт людей представлен в:";
radioButton1.Text = "миропонимании";
radioButton2.Text = "психике";
radioButton3.Text = "мироощущении";
this.button1.Click -= new EventHandler(fourth);
this.button1.Click += new EventHandler(fifth);
if (radioButton1.Checked==true)
{
A = A + 1;
}
else
{
A = A + 0;
}
}
private void fifth(object sender, EventArgs e)
{
label2.Text = "Изначальным признаком религиозного мировоззрения является вера в:";
radioButton1.Text = "в единого бога — творца";
radioButton2.Text = "сверхъестественное";
radioButton3.Text = "добро";
this.button1.Click -= new EventHandler(fifth);
this.button1.Click += new EventHandler(sixth);
if (radioButton3.Checked)
{
A = A + 1;
}
else
{
A = A+0;
}
}
private void sixth(object sender, EventArgs e)
{
string B="0";//оценка
if (A == 0 || A == 1)
{
B = "Отвратительно. Оценка '2'";
}
if (A == 2 || A==3)
{
B = "Плохо. Оценка '3'";
}
if (A == 4)
{
B = "Хорошо. Оценка '4'";
}
if (A == 5)
{
B = "Отлично. Оценка '5'";
}
MessageBox.Show("Результат: \n"+"Количество верных ответов: "+A+"\n"+B);
this.button1.Click -= new EventHandler(sixth);
this.button1.Click += new EventHandler(sixth);
}