A simple, light-weight and highly maintainable online judge system for secondary education

Related tags

Miscellaneousy3oj
Overview

y³OJ

a simple, light-weight and highly maintainable online judge system for secondary education

一个简单、轻量化、易于维护的、为中学信息技术学科课业教学设计的 Online Judge 系统。

Online Judge?

在线评测系统(Online Judge,缩写 OJ)是一种在算法竞赛竞赛中用来测试参赛程序的在线系统,也可以用于平时练习。许多 OJ 网站会自发组织一些竞赛。此外,OJ 网站通常会设立用户排名,以用户的提交答案通过数多少或某个题目执行时间快慢为排名依据。(来源:维基百科

该项目从传统 OJ 的设计出发,针对中学信息技术学科课业教学进行优化:如支持在 Python 中进行文件读取、引入第三方库等操作;同时原生支持交互式测评,并提供了一套 testlib API。

Deploy

环境配置

由于 Sandbox 技术限制,评测端必须部署在 Linux 中。环境需求如下:

  • Python 3.6+
  • NodeJS 12+
  • 包管理器 pip & npm
  • 命令行工具 wget & cmake

配置文件为 ./config.yml,请复制 ./config.sample.yml./config.yml 并填写配置。为了网站安全,请务必填写 secret_key 选项为随机秘钥,登录插件等都依赖于此。

数据目录为 ./data,你可以从 @y3oj/demo-data 从下载示例数据。

为运行 Sandbox 请按照 @t123yh/simple-sandbox 配置系统。

网页端

使用 Flask & jinja2 开发,需要安装相关依赖。

pip install -r requirements.txt
python build-frontend.py
python run.py      # start server

前端

使用 Less 生成样式,第三方包托管在 @y3oj/thirdparty-host

npm install -g less uglifyjs
python build-frontend.py      # build static

build-frontend.py 提供两个参数:

  • --force,构建时强制重新下载第三方包,复制静态文件时强行覆盖。
  • --watch,启用 Watch Mode,依赖于系统 API 检测文件更改时自动重新构建。

评测端

使用 NodeJS 开发,沙盒由 @t123yh/simple-sandbox 提供,使用 websocket 与主程序通信。

再次提醒,请确保已经按照 @t123yh/simple-sandbox 配置系统。

cd y3oj-judger
git clone https://github.com/t123yh/simple-sandbox.git  # repo mirror: https://e.coding.net/memset0/y3oj/simple-sandbox.git
cd simple-sandbox && CXX=clang++-9 yarn install && yarn run build && cd ..
npm install
npm run judge-test      # run test
npm run judge-start     # start judge server

Sandbox Rootfs

另外需要构建一个沙盒所使用的 rootfs。这里用的是 archlinux,参考代码如下

/etc/pacman.d/mirrorlist pacman -Syy pacman-key --init && pacman-key --populate archlinux pacman -S python3 python-pip --noconfirm pip install flask numpy matplotlib pandas flask_wtf requests pyyaml flask_login --index-url https://pypi.douban.com/simple ">
wget -c https://mirrors.tuna.tsinghua.edu.cn/archlinux/iso/latest/archlinux-bootstrap-2021.10.01-x86_64.tar.gz -O sandbox-rootfs.tar.gz
mkdir -p ./sandbox-rootfs
sudo tar -zxvf sandbox-rootfs.tar.gz -C ./sandbox-rootfs  # remember `sudo`
cd ./sandbox-rootfs
mount ./root.x86_64/ ./root.x86_64/ --bind
sudo ./root.x86_64/usr/bin/arch-chroot ./root.x86_64/
mkdir -p /sandbox/working
echo "Server = https://mirrors.tuna.tsinghua.edu.cn/archlinux/\$repo/os/\$arch" > /etc/pacman.d/mirrorlist
pacman -Syy
pacman-key --init && pacman-key --populate archlinux
pacman -S python3 python-pip --noconfirm
pip install flask numpy matplotlib pandas flask_wtf requests pyyaml flask_login --index-url https://pypi.douban.com/simple

Docs

请访问 y3oj-docs

You might also like...
A python package that computes an optimal motion plan for approaching a red light

redlight_approach redlight_approach is a Python package that computes an optimal motion plan during traffic light approach. RLA_demo.mov Given the par

Waydroid is a container-based approach to boot a full Android system on a regular GNU/Linux system like Ubuntu.

Waydroid is a container-based approach to boot a full Android system on a regular GNU/Linux system like Ubuntu.

System Design Assignments as part of Arpit's System Design Masterclass
System Design Assignments as part of Arpit's System Design Masterclass

System Design Assignments The repository contains a set of problem statements around Software Architecture and System Design as conducted by Arpit's S

This is an online course where you can learn and master the skill of low-level performance analysis and tuning.
This is an online course where you can learn and master the skill of low-level performance analysis and tuning.

Performance Ninja Class This is an online course where you can learn to find and fix low-level performance issues, for example CPU cache misses and br

Oppia is an online learning tool that enables anyone to easily create and share interactive activities
Oppia is an online learning tool that enables anyone to easily create and share interactive activities

Oppia is an online learning tool that enables anyone to easily create and share interactive activities (called 'explorations'). These activities simulate a one-on-one conversation with a tutor, making it possible for students to learn by doing while getting feedback.

The code for 2021 MGTV AI Challenge Anti Stealing Link, and the online result ranks 10th.

赛题介绍 芒果TV-第二届“马栏山杯”国际音视频算法大赛-防盗链 随着业务的发展,芒果的视频内容也深受网友的喜欢,不少视频网站和应用开始盗播芒果的视频内容,盗链网站不经过芒果TV的前端系统,跳过广告播放,且消耗大量的服务器、带宽资源,直接给公司带来了巨大的经济损失,因此防盗链在日常运营中显得尤为重要

Dot Browser is a privacy-conscious web browser with smarts built-in for protection against trackers and advertisments online.
Dot Browser is a privacy-conscious web browser with smarts built-in for protection against trackers and advertisments online.

🌍 Take back your privacy with Dot Browser, the privacy-conscious web browser that protects you from being tracked and monitored online.

Bring A Trailer(BAT) is a popular online auction website for enthusiast cars. This traverse auction results and saves them as CSV

BaT Data Grabber Bring A Trailer(BAT) is a popular online auction website for enthusiast cars. This traverse auction results and saves them as CSV Bri

pspsps(1) is a compyuter software to call an online catgirl to the Linux terminyal.
pspsps(1) is a compyuter software to call an online catgirl to the Linux terminyal.

pspsps(1): call a catgirl from the Internyet to the Linux terminyal show processes: ps show catgirls: pspsps —@[email protected] pspsps(1) is a compyute

Releases(v1.4.4)
edgetest is a tox-inspired python library that will loop through your project's dependencies, and check if your project is compatible with the latest version of each dependency

Bleeding edge dependency testing Full Documentation edgetest is a tox-inspired python library that will loop through your project's dependencies, and

Capital One 16 Dec 07, 2022
Research on how Gboard Stickers work.

Google-Sticker-Mashup-Research Research on how Gboard Stickers work. Contribute Contributing is nice, and you will be listed below for contributing. C

Jeremiah 45 Oct 28, 2022
More routines for operating on iterables, beyond itertools

More Itertools Python's itertools library is a gem - you can compose elegant solutions for a variety of problems with the functions it provides. In mo

2.8k Jan 02, 2023
Simple python code for compile brainfuck program.

py-brainf*ck Just a basic compiled that compiles your brainf*ck codes and gives you informations about memory, used cells, dumped version, logs etc...

4 Jun 13, 2021
Py4J enables Python programs to dynamically access arbitrary Java objects

Py4J Py4J enables Python programs running in a Python interpreter to dynamically access Java objects in a Java Virtual Machine. Methods are called as

Barthelemy Dagenais 1k Jan 02, 2023
NasaApod - Astronomy Picture of the Day

Astronomy Picture of the Day Get interesting Astronomical pictures with a brief

Shripad Rao 1 Feb 15, 2022
SMS-b0mber VANDALIZM developed for VK group

VANDALIZM SMS-b0mber VANDALIZM developed for VK group https://vk.com/dark__code if you come across this code, you can use it for your own purposes) ус

5 Jun 24, 2022
Handwrite - Type in your Handwriting!

Handwrite - Type in your Handwriting! Ever had those long-winded assignments, that the teacher always wants handwritten?

coded 7 Dec 06, 2022
Doom o’clock is a website/project that features a countdown of “when will the earth end” and a greenhouse gas effect emission prediction that’s predicted

Doom o’clock is a website/project that features a countdown of “when will the earth end” and a greenhouse gas effect emission prediction that’s predicted

shironeko(Hazel) 4 Jan 01, 2022
BloodCheck enables Red and Blue Teams to manage multiple Neo4j databases and run Cypher queries against a BloodHound dataset.

BloodCheck BloodCheck enables Red and Blue Teams to manage multiple Neo4j databases and run Cypher queries against a BloodHound dataset. Installation

Mr B0b 16 Nov 05, 2021
Custom SLURM wrapper scripts to make finding job histories and system resource usage more easily accessible

SLURM Wrappers Executables job-history A simple wrapper for grabbing data for completed and running jobs. nodes-busy Developed for the HPC systems at

Sara 2 Dec 13, 2021
A Microsoft reward automator, designed to work headless on a raspberry pi

MsReward A Microsoft reward automator, designed to work headless on a raspberry pi. Tested with a pi 3b+ and a pi 4 2Gb . Using a discord bot to log e

10 Dec 21, 2022
An easy python calculator for those who want's to know how if statements, loops, and imports works give it a try!

A usefull calculator for any student or anyone who want's to know how to build a simple 2 mode python based calculator.

Antonio Sánchez 1 Jan 06, 2022
This project is about for notifying moderators about uploaded photos on server.

This project is about for notifying moderators (people who moderate data from photos) about uploaded photos on server.

1 Nov 24, 2021
🎅🏻 Helping santa understand ✨ python ✨

☃️ Advent of code 2021 ☃️ Helping santa understand ✨ python ✨

Fluffy 2 Dec 25, 2021
A "multiclipboards" script for an efficient way to improve the original clipboards which are only able to save one string at a time

A "multiclipboards" script for an efficient way to improve the original clipboards which are only able to save one string at a time. Works on both Windows and Linux.

1 Jan 24, 2022
Banking management project using Tkinter GUI in python.

Bank-Management Banking management project using Tkinter GUI in python. Packages required Tkinter - Tkinter is the standard GUI library for Python. sq

Anjali Kumawat 7 Jul 03, 2022
Using graph_nets for pion classification and energy regression. Contributions from LLNL and LBNL

nbdev template Use this template to more easily create your nbdev project. If you are using an older version of this template, and want to upgrade to

3 Nov 23, 2022
Meaningful and minimalist release notes for developers

Managing manual release notes is hard. Therefore, everyone tends to generate release notes from commit messages. But, you won't get a meaningful release note at the end.

codezri 31 Dec 30, 2022
A basic DIY-project made using Python and MySQL

Banking-Using-Python-MySQL This is a basic DIY-project made using Python and MySQL. Pre-Requisite needed:-- MySQL command Line:- creating a database

ABHISHEK 0 Jul 03, 2022