winform文本内容对比
2021-07-02 19:03
标签:wing for array button 题目 windows 获取 raw ace using System; namespace WindowsFormsApp3 private void pictureBox1_Click(object sender, EventArgs e) } private void richTextBox1_TextChanged(object sender, EventArgs e) } private void richTextBox2_TextChanged(object sender, EventArgs e) } private void button1_Click(object sender, EventArgs e) winform文本内容对比 标签:wing for array button 题目 windows 获取 raw ace 原文地址:https://www.cnblogs.com/Lee597/p/14962542.html
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;
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
{
{
{
{
//题目计数,共75题
int count = 0;
//得分计数,满分115
double piont = 0;
//用于存放获取填写的答案
List
//真实的题库答案,用于对比找出正确与错误的答案
List
List
//用于存放错题
List
char[] c = richTextBox1.Text.ToCharArray();
foreach (char i in c)
{
if(i.ToString() != "\n")
{
answer.Add(i.ToString());
}
}
while (count {
//答案正确,则加分
if (answer[count] == question[count])
{
if (count {
piont += 1.5;
}
else if (count {
piont += 1;
}
else if (count {
piont += 1.5;
}
else if (count {
piont += 2;
}
//count += 1;
}
//回答错误,连带题号计入错题集
else
{
//count += 1;
if (count {
wrong.Add("\n错题号为:" + (count + 1) + "\n" + "您填的错误选项为:" + answer[count] + "\n" + "正确选项为:" + question[count] + "\n" + "该题目扣1.5分\n" + "该题解析:" + solve[count] + "\n");
}
else if (count {
wrong.Add("\n错题号为:" + (count + 1) + "\n" + "您填的错误选项为:" + answer[count] + "\n" + "正确选项为:" + question[count] + "\n" + "该题目扣1分\n" + "该题解析:" + solve[count] + "\n");
}
else if (count {
wrong.Add("\n错题号为:" + (count + 1) + "\n" + "您填的错误选项为:" + answer[count] + "\n" + "正确选项为:" + question[count] + "\n" + "该题目扣1.5分\n" + "该题解析:" + solve[count] + "\n");
}
else if (count {
wrong.Add("\n错题号为:" + (count + 1) + "\n" + "您填的错误选项为:" + answer[count] + "\n" + "正确选项为:" + question[count] + "\n" + "该题目扣2分\n" + "该题解析:" + solve[count] + "\n");
}
}
count += 1;
//Task.Delay(200);
}
richTextBox2.AppendText("选择题总分为:115 分" + "\n");
richTextBox2.AppendText("您的选择题得分为:" + piont + " 分\n");
count = 0;
while (count {
richTextBox2.AppendText(wrong[count]);
count += 1;
}
}
}
}
下一篇:winform简易计算器