Case Study: Designing a Secure Online Examination Platform | 案例分析:安全在线考试平台的设计

📚 Case Study: Designing a Secure Online Examination Platform | 案例分析:安全在线考试平台的设计

In this Pre‑U case study, we walk through the complete lifecycle of building a secure, scalable online examination platform – from initial requirements to deployment and ethical considerations. The system is designed for a large university, aiming to serve thousands of concurrent students, deliver randomised questions, auto‑grade answers, and prevent academic dishonesty through robust technical safeguards. The analysis integrates key Cambridge Pre‑U Computer Science concepts, including systems analysis, algorithm design, data structures, database normalisation, network security, and software development models.

在这篇 Pre‑U 案例研究中,我们将完整走过一个安全、可扩展的在线考试平台的构建生命周期——从最初的需求到部署与伦理考量。该系统为某大型大学设计,目标是为数千名并发学生服务, 推送随机化题目、自动评分, 并通过强大的技术防护手段防止学术不端。分析融合了剑桥 Pre‑U 计算机科学的核心概念, 包括系统分析、算法设计、数据结构、数据库规范化、网络安全以及软件开发模型。


1. Introduction and Project Scope | 项目背景与范围

The university currently relies on paper‑based invigilated exams, which incur high logistical costs and limit the use of interactive question types. The new platform must host both formative quizzes and high‑stakes summative examinations, supporting question formats such as multiple‑choice, short‑text, code‑entry, and drag‑and‑drop. An essential constraint is that the system must operate reliably under peak load when 5000 students start an exam simultaneously.

该大学目前依赖纸笔监考考试, 物流成本高且限制了交互式题型的采用。新平台需同时承载形成性测验与高风险终结性考试, 支持选择题、短文本题、代码输入题和拖放题等多种题型。关键约束是系统必须在 5000 名学生同时开考的峰值负载下可靠运行。


2. Requirements Elicitation and Analysis | 需求获取与分析

Functional requirements were gathered through interviews with faculty, examination officers, and students. Key features include: candidate authentication via university SSO, a responsive exam timer, automatic saving of answers every 30 seconds, a proctoring dashboard that flags suspicious browser activity, and detailed post‑exam analytics. Non‑functional requirements mandate 99.9% uptime during exam windows, page‑load times under two seconds, and end‑to‑end encryption of all submitted data.

通过与教师、考务人员和学生的访谈, 收集了功能需求。关键功能包括: 通过大学单点登录进行考生认证、响应式考试计时器、每 30 秒自动保存答案、标记可疑浏览器活动的监考控制台, 以及详细的考后分析。非功能性需求要求考试窗口期间 99.9% 的正常运行时间、页面加载时间低于两秒, 以及对所有提交数据进行端到端加密。

Using a use‑case diagram, the team identified three primary actors: Student, Lecturer, and Proctor. Each actor interacts with distinct modules such as Exam Engine, Question Bank Manager, and Report Generator. The system boundary excludes video streaming for remote invigilation, which is handled by a third‑party solution integrated via API.

团队通过用例图确定了三个主要角色: 学生、讲师和监考员。每个角色与不同的模块交互, 如考试引擎、题库管理器和报告生成器。系统边界不包括用于远程监考的视频流——该功能通过 API 集成第三方方案实现。


3. System Architecture Overview | 系统架构概览

A layered architecture was selected to separate concerns and facilitate independent scaling. The presentation layer uses a React‑based single‑page application, while the business logic layer is implemented as RESTful micro‑services written in Python and Go. The data layer consists of a primary PostgreSQL cluster and a Redis cache for session state. To handle burst traffic, message queues (RabbitMQ) decouple exam submission from the grading pipeline, allowing asynchronous processing of long‑running tasks like plagiarism detection.

选定分层架构以分离关注点并便于独立扩容。表示层采用基于 React 的单页应用, 业务逻辑层以 Python 和 Go 编写的 RESTful 微服务实现。数据层包含一个主 PostgreSQL 集群和用于会话状态的 Redis 缓存。为应对突发流量, 消息队列(RabbitMQ)将答卷提交与评分管道解耦, 得以异步处理抄袭检测等长时间任务。

The system deploys on a cloud infrastructure using Kubernetes, with horizontal pod auto‑scaling triggered when CPU utilisation exceeds 70%. Load balancers distribute traffic across multiple availability zones. All inter‑service communication is secured with mutual TLS, and secrets (database passwords, API keys) are managed through a vault service.

系统部署在云端基础设施上, 使用 Kubernetes, 当 CPU 利用率超过 70% 时触发水平 Pod 自动扩缩。负载均衡器将流量分布至多个可用区。所有服务间通信均通过双向 TLS 保护, 密钥(数据库密码、API 密钥)通过密钥管理服务保管。


4. Database Design and Normalisation | 数据库设计与规范化

The core entities are User, Exam, Question, Attempt, and Answer. To minimise redundancy and maintain data integrity, the relational schema is normalised to Third Normal Form (3NF). For instance, the Exam table stores exam metadata, while a separate Question table holds each item’s type, mark scheme, and difficulty; a junction table Exam_Question links exams to their constituent questions with ordering fields. Candidate responses are stored in the Answer table, which references both the Attempt and the Question.

核心实体包括 User(用户)、Exam(考试)、Question(试题)、Attempt(作答记录)和 Answer(答案)。为减少冗余并保持数据完整性, 关系模式规范到第三范式(3NF)。例如, Exam 表存储考试元数据, 独立的 Question 表保存每道题的类型、评分方案和难度; 连接表 Exam_Question 通过排序字段将考试与其包含的试题关联。考生答卷存放在 Answer 表中, 同时引用 Attempt 和 Question。

Indexes are created on high‑read columns such as user_id, exam_id, and submission_time. A full‑text search index on question_text allows lecturers to quickly query the question bank. To satisfy the requirement of randomised question order, the application layer generates a pseudorandom permutation using the Fisher‑Yates shuffle, with a seed derived from the student’s ID and exam session key, ensuring reproducibility for fairness audits.

在 user_id、exam_id、submission_time 等高读取列上创建了索引。question_text 上的全文索引允许讲师快速检索题库。为满足随机出题顺序的需求, 应用层使用 Fisher‑Yates 洗牌算法生成伪随机排列, 种子来自学生 ID 与考试会话密钥的组合, 确保排列可重现以便公平性审计。


5. Key Data Structures and Algorithms | 关键数据结构与算法

A priority queue (min‑heap) is used by the auto‑saving scheduler, where each element contains the next save timestamp and the associated attempt ID. This allows the server to efficiently trigger saves for thousands of concurrent candidates with a time complexity of O(log n) per insertion or extraction. The exam timer on the client side is implemented with a countdown state machine that verifies against the server’s authoritative timestamp every 60 seconds to prevent clock manipulation.

自动保存调度器使用优先队列(最小堆), 每个元素包含下次保存的时间戳及相关联的作答记录 ID。这使得服务器能够高效地为数千名并发考生触发保存, 每次插入或提取的时间复杂度为 O(log n)。客户端考试计时器通过倒计时状态机实现, 每 60 秒与服务器的权威时间戳核对一次, 以防时钟篡改。

For the proctoring integrity module, a Bloom filter maintains a space‑efficient set of forbidden IP ranges and known web‑proxy addresses. Though it allows false positives, the probability is tuned to 0.1%, drastically reducing database lookups. The grading engine utilises deterministic finite automata (DFA) for pattern‑matching in short‑text answers, permitting sophisticated variations such as optional whitespace and synonym matching represented as regular expressions compiled to DFA states.

在监考完整性模块中, 布隆过滤器维护着一份空间高效的禁止 IP 范围和已知代理地址集合。尽管它允许误报, 但概率已调校为 0.1%, 大幅减少了数据库查找。评分引擎使用确定有限自动机(DFA)对短文本答案进行模式匹配, 支持可选空白和同义词匹配等复杂变体——这些表示为编译至 DFA 状态的正则表达式。


6. Security Implementation: Authentication & Encryption | 安全实现:认证与加密

Authentication relies on OAuth 2.0 with OpenID Connect, issuing signed JWT access tokens. Tokens are short‑lived (15 minutes) and refreshed silently using rotating refresh tokens stored as salted hashes in the database. All transmitted data is protected by TLS 1.3 with forward secrecy. Answers are encrypted at rest using AES‑256 in Galois/Counter Mode (GCM), with per‑exam data encryption keys managed by a key management service.

认证依赖 OAuth 2.0 与 OpenID Connect, 颁发签名的 JWT 访问令牌。令牌寿命短暂(15 分钟), 并使用数据库中储存的加盐哈希轮换刷新令牌静默续期。所有传输数据由 TLS 1.3 保护并具备前向保密性。答卷在存储层面使用 AES‑256 伽罗瓦/计数器模式(GCM)加密, 每个考试的密钥由密钥管理服务管理。

To prevent common web vulnerabilities, the platform incorporates strict Content Security Policy headers, input sanitisation, and parameterised queries to thwart SQL injection. Cross‑site request forgery (CSRF) tokens are embedded in all state‑changing requests. A Web Application Firewall (WAF) blocks suspicious patterns, and rate limiting protects login endpoints against brute‑force attacks. The proctoring service runs isolated in a sandboxed browser extension that hashes the current tab URL, sending only the hash to the server to verify exam‑authorised pages without revealing the user’s browsing history.

为防范常见 Web 漏洞, 平台集成了严格的 Content Security Policy 头部、输入清洗和参数化查询以阻止 SQL 注入。所有状态变更请求均嵌入 CSRF 令牌。Web 应用防火墙(WAF)阻断可疑模式, 速率限制保护登录端点免遭暴力破解。监考服务在沙箱化浏览器扩展中独立运行, 对当前标签页 URL 进行哈希, 仅将哈希值发送至服务器以验证已授权考试页面, 而不泄露用户的浏览历史。


7. User Interface and User Experience Design | 用户界面与体验设计

The student exam interface follows the principle of minimal cognitive load: a single‑column layout displays the current question prominently, with a subtle progress bar and a persistent timer. Distraction‑free mode is enforced – the browser’s right‑click context menu and keyboard shortcuts such as Ctrl+C/V are disabled during the exam. Colour coding communicates remaining time: green (>30 min), amber (10‑30 min), red (<10 min). WCAG 2.1 AA accessibility standards are met, including keyboard navigation and screen‑reader support.

学生考试界面遵循最小认知负荷原则: 单列布局突出当前题目, 配有淡雅的进度条和常驻计时器。考试期间强制无干扰模式——禁用浏览器右键菜单和 Ctrl+C/V 等快捷键。色彩编码传达剩余时间: 绿色(>30 分钟)、琥珀色(10‑30 分钟)、红色(<10 分钟)。符合 WCAG 2.1 AA 无障碍标准, 包括键盘导航和屏幕阅读器支持。

The lecturer’s dashboard provides drag‑and‑drop question authoring with live preview and difficulty analysis based on past candidate performance. Analytics visualise the distribution of marks, discrimination index per question, and reliability coefficients (e.g. Cronbach’s α). These insights help refine future assessments iteratively.

讲师控制台提供拖放式试题编写, 带有实时预览和基于过往考生表现的难度分析。分析工具可视化分数分布、每道题的区分度指数以及信度系数(如克隆巴赫 α)。这些洞察帮助迭代改进未来的测评。


8. Testing Strategies: Unit, Integration, and Load Testing | 测试策略:单元、集成与负载测试

A comprehensive test plan spans unit tests (Jest for front‑end, PyTest for back‑end), integration tests for database interactions and API contracts, and end‑to‑end tests using Cypress. Mock services simulate external dependencies such as the university identity provider. Continuous Integration pipelines run the entire test suite on every push, blocking merges if coverage drops below 85%.

全面测试计划涵盖单元测试(前端 Jest, 后端 PyTest)、针对数据库交互和 API 约定的集成测试, 以及使用 Cypress 的端到端测试。模拟服务模拟外部依赖项, 如大学身份提供者。持续集成管道在每次推送时运行完整测试套件, 若覆盖率低于 85% 则阻止合并。

Load testing is critical. Using k6, the team simulated 5000 virtual users logging in and answering questions over a 30‑minute ramp period. The observed 95th‑percentile response time for answer submission was 420 ms, within the acceptable threshold. Stress tests revealed that the grading message queue lag grew beyond acceptable limits when concurrent submissions exceeded 8000, prompting optimisation of the grading worker pool and database connection pooling.

负载测试至关重要。团队使用 k6 模拟了 5000 名虚拟用户在 30 分钟加压期内登录并作答。观察到的答案提交 95% 分位响应时间为 420 毫秒, 处于可接受阈值内。压力测试揭示, 当并发提交超过 8000 时, 评分消息队列延迟超出可接受范围, 从而促使评分工作线程池和数据库连接池的优化。


9. Deployment and Cloud Considerations | 部署与云端考量

Blue‑green deployment minimises downtime during updates. A staging environment mirrors production and is used for final smoke tests before the live switch. Configuration is externalised via environment variables, and infrastructure is provisioned as code using Terraform. Automated database migrations handle schema changes without manual intervention.

蓝绿部署在更新期间最小化停机时间。预发布环境镜像生产环境, 用于上线切换前的最终冒烟测试。配置通过环境变量外置, 基础设施使用 Terraform 作为代码自动置备。自动化数据库迁移无需人工干预即可处理模式变更。

Data sovereignty requirements dictate that all exam answers remain within the country’s jurisdiction. Hence, cloud regions are selected accordingly, with geo‑redundant backups encrypted and stored in a separate region for disaster recovery. Monitoring via Prometheus and Grafana tracks system health, while centralised logging with ELK stack assists forensic analysis in case of anomalies.

数据主权要求规定所有考卷答案必须留在该国司法辖区内。因此, 相应地选择云区域, 并将加密的地理冗余备份存储在另一区域用于灾难恢复。通过 Prometheus 和 Grafana 进行监控以追踪系统健康状况, 而借助 ELK 技术栈的集中式日志记录则有助于在出现异常时进行取证分析。


10. Ethical and Legal Issues | 伦理与法律问题

Privacy‑by‑design principles are embedded: candidates are informed that browser activity metadata (tab switches, copy attempts) is collected, and explicit consent is obtained via the exam entry screen. Data retention policies specify that raw proctoring logs are deleted 90 days after the exam board’s finalisation, in compliance with GDPR. Algorithmic grading for high‑stakes assessment always includes a human‑moderation layer to contest borderline scores.

设计中融入了隐私遍在原则: 告知考生将收集浏览器活动元数据(切换标签、尝试复制), 并通过考试入口屏幕征得明确同意。数据保留政策规定, 原始监考日志在考试委员会最终确认 90 天后删除, 符合 GDPR 要求。高风险评估的算法评分始终包含人工复核层, 以对临界分数提出异议。

Accessibility is an ethical imperative; additional time allowances and alternative formats (e.g. larger fonts, read‑aloud) are configurable per candidate’s documented needs. The system does not use facial recognition or emotion AI, avoiding algorithmic bias concerns. Audit trails log every administrative access to student data, supporting accountability.

包容无障碍是一项伦理要务; 可以根据考生存档的需求配置额外时间与替代格式(如较大字体、朗读)。系统不使用人脸识别或情感 AI, 从而避免算法偏见问题。审计跟踪记录每一次对学生数据的管理访问, 以支持问责制。


11. Maintenance and Future Scalability | 维护与未来可扩展性

Post‑launch, the team adopts an iterative enhancement model, prioritising feedback from end‑of‑term surveys. Feature flags allow gradual rollout of risky changes, such as a new anti‑plagiarism engine based on cosine similarity on vectorised answers. Technical debt is tracked in the backlog, with refactoring sprints scheduled every four iterations.

上线后, 团队采用迭代增强模型, 优先考虑期末调查的反馈。特性标志(feature flags)允许逐步推出高风险更改, 例如基于向量化答案余弦相似度的新反抄袭引擎。技术债务记录在待办事项中, 每四次迭代安排一次重构冲刺。

To accommodate future growth, the architecture supports sharding of the Answer table by exam_id, and a read‑replica strategy for analytics. The messaging system can be scaled by partitioning queues. Modular design of the question‑rendering engine makes it feasible to introduce new question types (e.g. interactive simulation) without altering the core exam flow. Regular penetration testing and dependency vulnerability scans are embedded in the maintenance cycle.

为容纳未来增长, 架构支持按 exam_id 对 Answer 表进行分片, 以及为分析服务的只读副本策略。消息系统可通过分区队列进行扩展。试题渲染引擎的模块化设计使其能够在不更改核心考试流程的前提下引入新题型(如交互式模拟)。定期渗透测试和依赖项漏洞扫描嵌入维护周期中。


12. Conclusion and Exam Tips | 总结与考试技巧

This case study illustrates how theoretical computer science concepts underpin the design of a real‑world secure system. For Pre‑U exams, candidates should be ready to discuss the trade‑offs involved in architectural decisions, the justification for specific data structures (e.g. choosing a Bloom filter over a hash table), and the application of normalisation to ensure database integrity. Be prepared to evaluate security measures critically and to suggest alternative testing strategies under different constraints.

本案例研究展示了理论计算机科学概念如何支撑现实世界安全系统的设计。在 Pre‑U 考试中, 考生应准备好讨论架构决策中的权衡、特定数据结构的选用理据(例如选择布隆过滤器而非哈希表), 以及规范化在确保数据库完整性方面的应用。要能够批判性地评估安全措施, 并提出在不同约束条件下的替代测试策略。

When answering case‑study questions, always reference the scenario details provided. Draw explicit links to syllabus topics – for instance, connect the auto‑saving scheduler to priority queues and complexity analysis, or link user authentication to cryptographic principles. Structure your answer using the system lifecycle stages: analysis, design, implementation, testing, and evaluation, just as we have modelled here.

在回答案例研究问题时, 务必引用所提供的情境细节。将内容与教学大纲主题明确联系——例如, 将自动保存调度器与优先队列及复杂度分析关联, 或将用户认证与密码学原理挂钩。像本文所演示的那样, 按照系统生命周期阶段组织答案: 分析、设计、实现、测试和评估。

Published by TutorHao | Computer Science Revision Series | aleveler.com

更多咨询请联系16621398022(同微信)

Comments

屏轩国际教育cambridge primary/secondary checkpoint, cat4, ukiset,ukcat,igcse,alevel,PAT,STEP,MAT, ibdp,ap,ssat,sat,sat2课程辅导,国外大学本科硕士研究生博士课程论文辅导Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from aleveler.com

Subscribe now to keep reading and get access to the full archive.

Continue reading

Exit mobile version