【单选题与多选题判断得分】
【核心代码】
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 Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
int fenshu = 0;
if (radioButton1.Checked)
{
fenshu = 5;
}
if (radioButton6.Checked)
{
fenshu = 5;
}
if (radioButton9.Checked)
{
fenshu = 5;
}
if (radioButton12.Checked)
{
fenshu = 5;
}
if (radioButton15.Checked)
{
fenshu = 5;
}
if (checkBox3.Checked)
{
fenshu = 0;
}
else if (checkBox1.Checked && checkBox2.Checked)
{
fenshu = 10;
}
if (checkBox4.Checked)
{
fenshu = 0;
}
else if (checkBox5.Checked && checkBox6.Checked)
{
fenshu = 10;
}
if (checkBox7.Checked)
{
fenshu = 0;
}
else if (checkBox8.Checked && checkBox9.Checked)
{
fenshu = 10;
}
if (checkBox10.Checked)
{
fenshu = 0;
}
else if (checkBox11.Checked && checkBox12.Checked)
{
fenshu = 10;
}
if (checkBox13.Checked)
{
fenshu = 0;
}
else if (checkBox14.Checked && checkBox15.Checked)
{
fenshu = 10;
}
label12.Text = fenshu.ToString();
}
}
}