System.Text.Encoding y = System.Text.Encoding.GetEncoding(1251); System.IO.StreamReader yozish;
togri_javob = Convert.ToInt32(yozish.ReadLine()); radioButton1.Checked = false; radioButton2.Checked = false; radioButton3.Checked = false; radioButton4.Checked = false;
button1.Enabled = false;
savol_soni++;
if (yozish.EndOfStream == true) button1.Text = "tugadi";
}
private void izmcoctperekl(object sender, EventArgs e)
{
button1.Enabled = true;
// button1.Focus();
RadioButton pereklyuchatel = (RadioButton)sender; string tmp = pereklyuchatel.Name;
x = int.Parse(tmp.Substring(11));
}
private void button1_Click(object sender, EventArgs e)
{
if (x == togri_javob) togrilari_soni++;
if (x != togri_javob)
{
notogrilar_soni = notogrilar_soni + 1; notogri_savollar[notogrilar_soni] = label1.Text;
}
if (button1.Text == "Testni qaytadan boshlash")
{
button1.Text = "keyingi savol"; radioButton1.Visible = true; radioButton2.Visible = true; radioButton3.Visible = true; radioButton4.Visible = true; keyingitest(); return;
}
if (button1.Text == "tugadi")
{
yozish.Close(); radioButton1.Visible = false; radioButton2.Visible = false; radioButton4.Visible = false; radioButton3.Visible = false;
\n" +
label1.Text = string.Format("test tugatildi.\n" + "to`g`ri javob: {0} dan {1}.
"5 ballik sistemadagi bahoyingiz :{2:F2}.", savol_soni, togrilari_soni,
(togrilari_soni * 5F) / savol_soni);
button1.Text = "Testni qaytadan boshlash";
string str = "Asiz ushbu savollarga xato javob berdingiz: \n \n";
for (int i = 1; i <= notogrilar_soni; i++) str = str + notogri_savollar[i] + "\n"; if (notogrilar_soni != 0) MessageBox.Show(str, "test tugadi");
}