项目预览
在线预览不可以用啦,服务器到期啦
在线预览(基本功能已经完成,博主正在逐步完善) :CodeSky 代码在线评测系统
项目图片:
图1、题库
图2、比赛题目选择
图3、作弊检测
图4、竞赛排名
图5、竞赛列表
前情提要
废话少说直接开始,判题机使用docker容器当作沙箱,系统打开流程图是这样的
运行代码原理就是使用Processbuilder运行docker容器然后运行代码,具体执行命令如下
#创建容器
create = docker,run,-id,-v,%h:%d,%name
#编译
compile = docker,exec,%id,/bin/sh,-c,cd %code && %c,
#shell执行语句
shell = timeout 2s time -ao time/time%i.txt -f %U:%M %name < in/in%i.txt > out/out%i.txt
#执行shell
execute = docker,exec,-i,%id,/bin/sh,-c,cd %code && chmod 777 do.sh && ./do.sh
#删除停止容器
stop = docker,stop,%id
delete= docker,rm,%id
时间计算直接简单粗暴用linux的 time -v命令
目前已经完成判题计算时空功能
源码追踪(前端 + 后端)
项目开源,详细代码请追踪.
博主以github更新为主,gitee同步可能会有延迟
后端:
github:https://github.com/ckw0812/Springboot_OnlineJudge_Systeam.git
gitee:基于Springboot + Vue3的Onlinejudge在线判题系统: 基于Springboot + Vue的Onlinejudge在线判题系统
前端:
vue3 + ts + vite前端:GitHub - 1stMarine/onlineJudgeVue3 (github)
vue3 + ts + vite 前端 :onlineJudgeVue3: onlineJudge前端 (gitee)