前言
- 💖💖作者:计算机程序员小杨
- 💙💙个人简介:我是一名计算机相关专业的从业者,擅长Java、微信小程序、Python、Golang、安卓Android等多个IT方向。会做一些项目定制化开发、代码讲解、答辩教学、文档编写、也懂一些降重方面的技巧。热爱技术,喜欢钻研新工具和框架,也乐于通过代码解决实际问题,大家有技术代码这一块的问题可以问我!
- 💛💛想说的话:感谢大家的关注与支持!
- 💕💕文末获取源码联系 计算机程序员小杨
- 💜💜
- 网站实战项目
- 安卓/小程序实战项目
- 大数据实战项目
- 深度学习实战项目
- 计算机毕业设计选题
- 💜💜
一.开发工具简介
- 开发语言:Java+Python(两个版本都支持)
- 后端框架:Spring Boot(Spring+SpringMVC+Mybatis)+Django(两个版本都支持)
- 前端:Vue+ElementUI+HTML
- 数据库:MySQL
- 系统架构:B/S
- 开发工具:IDEA(Java的)或者PyCharm(Python的)
二.系统内容简介
本考务管理系统是一套基于Spring Boot+Vue技术架构的教育考试综合管理平台,采用B/S架构设计,旨在为各类教育机构提供完整的考试管理解决方案。系统围绕考试全流程构建,涵盖学生信息管理、考试信息发布、考试类型分类、在线报名、考场智能分配、成绩录入统计、试题库建设、试卷组织、考场监管等多个业务模块。通过Vue+ElementUI构建的前端界面实现了友好的用户交互体验,后端采用Spring+SpringMVC+Mybatis框架确保系统稳定性和扩展性,MySQL数据库为各类考试数据提供可靠存储。系统支持多角色权限管理,能够满足管理员、教师、学生等不同用户群体的操作需求,实现了从考试计划制定到成绩发布的全程数字化管理,有效提升了考务工作效率,减少了人工操作错误,为现代化教育管理提供了有力的技术支撑。
三.系统功能演示
四.系统界面展示
五.系统源码展示
import org.apache.spark.sql.SparkSession;
import org.apache.spark.sql.Dataset;
import org.apache.spark.sql.Row;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
import java.time.LocalDateTime;
@Service
public class ExamManagementService {
@Autowired
private SparkSession sparkSession = SparkSession.builder().appName("ExamManagement").master("local[*]").getOrCreate();
public void processExamRegistration(Long examId, Long studentId, Map<String, Object> registrationData) {
Dataset<Row> examDataset = sparkSession.read().option("header", "true").csv("exam_data.csv");
Dataset<Row> studentDataset = sparkSession.read().option("header", "true").csv("student_data.csv");
Dataset<Row> filteredExam = examDataset.filter(examDataset.col("exam_id").equalTo(examId));
Dataset<Row> filteredStudent = studentDataset.filter(studentDataset.col("student_id").equalTo(studentId));
if (filteredExam.count() == 0) {
throw new RuntimeException("考试信息不存在");
}
if (filteredStudent.count() == 0) {
throw new RuntimeException("学生信息不存在");
}
Row examInfo = filteredExam.first();
Row studentInfo = filteredStudent.first();
LocalDateTime registrationDeadline = LocalDateTime.parse(examInfo.getAs("registration_deadline"));
if (LocalDateTime.now().isAfter(registrationDeadline)) {
throw new RuntimeException("报名时间已截止");
}
Integer maxCapacity = examInfo.getAs("max_capacity");
Dataset<Row> currentRegistrations = sparkSession.read().option("header", "true").csv("registration_data.csv")
.filter(sparkSession.read().option("header", "true").csv("registration_data.csv").col("exam_id").equalTo(examId));
if (currentRegistrations.count() >= maxCapacity) {
throw new RuntimeException("考试报名人数已满");
}
Dataset<Row> duplicateCheck = currentRegistrations.filter(
currentRegistrations.col("student_id").equalTo(studentId).and(
currentRegistrations.col("exam_id").equalTo(examId)
)
);
if (duplicateCheck.count() > 0) {
throw new RuntimeException("学生已报名该考试");
}
String registrationId = UUID.randomUUID().toString();
Map<String, Object> registrationRecord = new HashMap<>();
registrationRecord.put("registration_id", registrationId);
registrationRecord.put("exam_id", examId);
registrationRecord.put("student_id", studentId);
registrationRecord.put("student_name", studentInfo.getAs("name"));
registrationRecord.put("exam_name", examInfo.getAs("exam_name"));
registrationRecord.put("registration_time", LocalDateTime.now().toString());
registrationRecord.put("status", "registered");
saveRegistrationRecord(registrationRecord);
updateExamCapacity(examId, (int) currentRegistrations.count() + 1);
sendNotificationToStudent(studentId, "报名成功", "您已成功报名" + examInfo.getAs("exam_name"));
}
public Map<String, Object> allocateExamRooms(Long examId) {
Dataset<Row> examDataset = sparkSession.read().option("header", "true").csv("exam_data.csv");
Dataset<Row> roomDataset = sparkSession.read().option("header", "true").csv("room_data.csv");
Dataset<Row> registrationDataset = sparkSession.read().option("header", "true").csv("registration_data.csv");
Dataset<Row> examInfo = examDataset.filter(examDataset.col("exam_id").equalTo(examId));
if (examInfo.count() == 0) {
throw new RuntimeException("考试信息不存在");
}
Dataset<Row> examRegistrations = registrationDataset.filter(
registrationDataset.col("exam_id").equalTo(examId)
.and(registrationDataset.col("status").equalTo("registered"))
);
long totalStudents = examRegistrations.count();
if (totalStudents == 0) {
throw new RuntimeException("该考试暂无报名学生");
}
Dataset<Row> availableRooms = roomDataset.filter(
roomDataset.col("status").equalTo("available")
.and(roomDataset.col("exam_date").equalTo(examInfo.first().getAs("exam_date")))
);
List<Row> roomList = availableRooms.collectAsList();
List<Row> studentList = examRegistrations.collectAsList();
Map<String, List<Map<String, Object>>> roomAllocations = new HashMap<>();
int currentRoomIndex = 0;
int studentsInCurrentRoom = 0;
String currentRoomId = null;
Integer currentRoomCapacity = 0;
for (Row student : studentList) {
if (currentRoomIndex >= roomList.size()) {
throw new RuntimeException("可用考场数量不足");
}
if (studentsInCurrentRoom == 0 || studentsInCurrentRoom >= currentRoomCapacity) {
Row currentRoom = roomList.get(currentRoomIndex);
currentRoomId = currentRoom.getAs("room_id");
currentRoomCapacity = currentRoom.getAs("capacity");
roomAllocations.put(currentRoomId, new ArrayList<>());
studentsInCurrentRoom = 0;
currentRoomIndex++;
}
Map<String, Object> allocation = new HashMap<>();
allocation.put("student_id", student.getAs("student_id"));
allocation.put("student_name", student.getAs("student_name"));
allocation.put("room_id", currentRoomId);
allocation.put("seat_number", studentsInCurrentRoom + 1);
allocation.put("exam_id", examId);
roomAllocations.get(currentRoomId).add(allocation);
studentsInCurrentRoom++;
saveRoomAllocation(allocation);
}
Map<String, Object> result = new HashMap<>();
result.put("total_students", totalStudents);
result.put("rooms_used", roomAllocations.size());
result.put("allocations", roomAllocations);
result.put("allocation_time", LocalDateTime.now().toString());
updateRoomStatus(roomAllocations.keySet(), "occupied");
return result;
}
public Map<String, Object> processExamScores(Long examId, List<Map<String, Object>> scoreData) {
Dataset<Row> examDataset = sparkSession.read().option("header", "true").csv("exam_data.csv");
Dataset<Row> registrationDataset = sparkSession.read().option("header", "true").csv("registration_data.csv");
Dataset<Row> examInfo = examDataset.filter(examDataset.col("exam_id").equalTo(examId));
if (examInfo.count() == 0) {
throw new RuntimeException("考试信息不存在");
}
Dataset<Row> examStudents = registrationDataset.filter(
registrationDataset.col("exam_id").equalTo(examId)
.and(registrationDataset.col("status").equalTo("registered"))
);
Map<Long, Row> studentMap = new HashMap<>();
for (Row student : examStudents.collectAsList()) {
studentMap.put(student.getAs("student_id"), student);
}
List<Map<String, Object>> processedScores = new ArrayList<>();
double totalScore = 0;
int validScoreCount = 0;
double maxScore = 0;
double minScore = 100;
Map<String, Integer> gradeDistribution = new HashMap<>();
gradeDistribution.put("A", 0);
gradeDistribution.put("B", 0);
gradeDistribution.put("C", 0);
gradeDistribution.put("D", 0);
gradeDistribution.put("F", 0);
for (Map<String, Object> scoreEntry : scoreData) {
Long studentId = (Long) scoreEntry.get("student_id");
Double score = (Double) scoreEntry.get("score");
if (!studentMap.containsKey(studentId)) {
continue;
}
if (score < 0 || score > 100) {
throw new RuntimeException("学生ID: " + studentId + " 的成绩无效");
}
Row studentInfo = studentMap.get(studentId);
Map<String, Object> processedScore = new HashMap<>();
processedScore.put("score_id", UUID.randomUUID().toString());
processedScore.put("exam_id", examId);
processedScore.put("student_id", studentId);
processedScore.put("student_name", studentInfo.getAs("student_name"));
processedScore.put("score", score);
processedScore.put("grade", calculateGrade(score));
processedScore.put("input_time", LocalDateTime.now().toString());
processedScore.put("status", "recorded");
processedScores.add(processedScore);
totalScore += score;
validScoreCount++;
maxScore = Math.max(maxScore, score);
minScore = Math.min(minScore, score);
String grade = calculateGrade(score);
gradeDistribution.put(grade, gradeDistribution.get(grade) + 1);
saveScoreRecord(processedScore);
updateStudentExamStatus(studentId, examId, "completed");
}
double averageScore = validScoreCount > 0 ? totalScore / validScoreCount : 0;
Map<String, Object> statistics = new HashMap<>();
statistics.put("total_students", validScoreCount);
statistics.put("average_score", Math.round(averageScore * 100.0) / 100.0);
statistics.put("max_score", maxScore);
statistics.put("min_score", minScore);
statistics.put("grade_distribution", gradeDistribution);
statistics.put("pass_rate", calculatePassRate(processedScores));
Map<String, Object> result = new HashMap<>();
result.put("processed_scores", processedScores);
result.put("statistics", statistics);
result.put("process_time", LocalDateTime.now().toString());
updateExamStatus(examId, "scored");
return result;
}
}
六.系统文档展示
结束
💕💕文末获取源码联系 计算机程序员小杨