Giter Site home page Giter Site logo

zjson's Introduction

zjson

快速產生可供 ZeroJudge 系統匯入題目格式之檔案

這是為了快速把吳邦一教授的 AP325 教材中的題目快速製作成可匯入格式的工具。因此,測資檔案格式為 {directory_$i}.{in|out}, for i in {1..5},假定皆為五筆測資。

匯入前記得檢查 「題目編號前置字元」 。匯成 a 開頭不理他,重匯即可。匯入後記得需手動公開。

Input

總共需要至多八個輸入:

  1. 目錄名稱
  2. 題目標題
  3. 範例程式碼名稱,如果沒有請直接 Enter⏎↩︎ 空行會跳過忽略
  4. 題目內容。因為可能有很多行,所以會讀取直到空行
  5. 輸入說明。因為可能有很多行,所以會讀取直到空行
  6. 輸出說明。因為可能有很多行,所以會讀取直到空行
  7. 範例輸入。因為可能有很多行,所以會讀取直到空行
  8. 範例輸出。因為可能有很多行,所以會讀取直到空行

Example

直接輸入

以下以 sum 為例。

python3 gen.py

輸入內容:

sum     // 目錄名稱
The Sum // 題目標題
        // 空行表無範例程式碼
Given $a$ & $b$, then $a + b = $?? // 題目內容開始
                                   // 題目內容結束
Two integrals respectively representing $a$ & $b$ in separated lines. // 輸入說明開始
                                                                      // 輸入說明結束
Result of $a + b$. // 輸出說明開始
                   // 輸出說明結束
1 // 範例輸入開始
1
  // 範例輸入結束
2 // 範例輸出開始
  // 範例輸出結束
cat sum.zjson

sum.zjson

重新定向

直接輸入顯然很不方便,有時我們需要對內容進行排版,畢竟PDF赴至好容易跑掉,當然別忘惹加上 LaTeX。這時,我們可以依照輸入順序存到文字檔裡,再重新定向到 stdin。以下以 P_4_7 為例。

vim P_4_7.txt
python3 gen.py < P_4_7.txt
cat P_4_7.zjson

P_4_7.txt P_4_7.zjson

zjson's People

Contributors

nevikw39 avatar

Stargazers

念誠 avatar  avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.