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

Related tags

Miscellaneous y3oj
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)
Owner
null
Homed - Light-weight, easily configurable, dockerized homepage

homed GitHub Repo Docker Hub homed is a light-weight customizable portal primari

Matt Walters 12 Dec 15, 2022
Coded in Python 3 - I make for education, easily clone simple website.

Simple Website Cloner - Single Page Coded in Python 3 - I make for education, easily clone simple website. How to use ? Install Python 3 first. Instal

Phạm Đức Thanh 2 Jan 13, 2022
Blender Light Manipulation - A script that makes it easier to work with light

Blender Light Manipulation A script that makes it easier to work with light 1. Wstęp W poniższej dokumentacji przedstawiony zostanie skrypt, który swo

Tomasz 1 Oct 19, 2021
Kolibri: the offline app for universal education

Kolibri This repository is for software developers wishing to contribute to Kolibri. If you are looking for help installing, configuring and using Kol

Learning Equality 564 Jan 2, 2023
This repository contains code for building education startup.

Learning Management System Overview It's the code for EssayBrain, a tool for teacher that automatically grades and validates essays. In order to valid

Shyam Das Shrestha 1 Nov 21, 2021
Python script to commit to your github for a perfect commit streak. This is purely for education purposes, please don't use this script to do bad stuff.

Daily-Git-Commit Commit to repo every day for the perfect commit streak Requirments pip install -r requirements.txt Setup Download this repository. Cr

JareBear 34 Dec 14, 2022
lets learn Python language with basic examples. highly recommended for beginners who just start coding.

Lets Learn Python ?? Learn python from basic programs. learn python from scratch. 1.Online python compiler: https://www.onlinegdb.com/online_python_co

Subhranshu Choudhury 1 Jan 18, 2022
A free and powerful system for awareness and research of the American judicial system.

CourtListener Started in 2009, CourtListener.com is the main initiative of Free Law Project. The goal of CourtListener.com is to provide high quality

Free Law Project 332 Dec 25, 2022
A tool for light-duty persistent memoization of API calls

JSON Memoize What is this? json_memoize is a straightforward tool for light-duty persistent memoization, created with API calls in mind. It stores the

null 1 Dec 11, 2021
A light library to build tiny websites

A light library to build tiny websites

BT.Q 1 Dec 23, 2021