本文共 3886 字,大约阅读时间需要 12 分钟。
本系统旨在帮助教师高效批改多选题,并统计学生对各题目选项的错误情况。系统支持以下评分规则:若学生选择了部分正确选项且未选择任何错误选项,则授予50%分数;若学生选择了任何错误选项,则不得分。
N 和 M,分别表示学生人数和多选题的个数。M 行:每行代表一道多选题,格式如下: a c 表示选项a和c正确。N 行:每行表示一个学生的答题情况,格式为 (选中选项个数 选项1 …),按题目顺序排列。problem 类存储每道题的满分、选项总数、正确选项数量及正确选项字符串。wrong 数组记录每道题每选项的错误次数。N 和 M。problem 数组中。Too simple。以下是代码的核心逻辑示例:
public class basicalLevel1073MultipleChoiceCount { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int m = in.nextInt(); problem[] pArr = new problem[m]; int[][] wrong = new int[m][5]; int max = -1; for (int i = 0; i < m; i++) { problem p = new problem(); p.score = in.nextInt(); p.optionNum = in.nextInt(); p.rightNum = in.nextInt(); p.rightAns = ""; for (int j = 0; j < p.rightNum; j++) { p.rightAns += in.next(); } pArr[i] = p; } for (int i = 0; i < n; i++) { double score = 0; for (int j = 0; j < m; j++) { String miss = in.next(); int k = miss.charAt(1) - '0'; String personAns = ""; for (int k2 = 0; k2 < k - 1; k2++) { personAns += in.next(); } personAns += in.next().charAt(0); if (personAns.equals(pArr[j].rightAns)) { score += pArr[j].score; } else { int l = 0; for (l = 0; l < personAns.length(); l++) { if (!pArr[j].rightAns.contains(personAns.substring(l, l + 1))) { wrong[j][personAns.charAt(l) - 'a']++; if (wrong[j][personAns.charAt(l) - 'a'] > max) { max = wrong[j][personAns.charAt(l) - 'a']; } } } int l2 = 0; for (l2 = 0; l2 < pArr[j].rightAns.length(); l2++) { if (!personAns.contains(pArr[j].rightAns.substring(l2, l2 + 1))) { wrong[j][pArr[j].rightAns.charAt(l2) - 'a']++; if (wrong[j][pArr[j].rightAns.charAt(l2) - 'a'] > max) { max = wrong[j][pArr[j].rightAns.charAt(l2) - 'a']; } } } if (flag == 1) { score += pArr[j].score / 2.0; } } } System.out.printf("%.1f\n", score); } if (max == -1) { System.out.println("Too simple"); } else { for (int o = 0; o < m; o++) { for (int o2 = 0; o2 < 5; o2++) { if (wrong[o][o2] == max) { System.out.printf("%d %d-%c\n", max, o + 1, o2 + 'a'); } } } } }}class problem { int score; int optionNum; int rightNum; String rightAns;} 输入样例1的输出结果如下:
3.56.02.52 2-e2 3-a2 3-b
输入样例2的输出结果如下:
5.05.0Too simple
希望这段文字能够清晰地传达多选题批改系统的功能和实现方法,同时满足技术写作的要求。
转载地址:http://lnnbz.baihongyu.com/