Skip to main content

Submit your work to JOJ via cli.

Project description

JOJ-Submitter

Submit your work to JOJ via CLI. Greatly improve your efficiency when uploading to JOJ.

Getting Started

Setup venv (Optional)

python3 -m venv env
source env/Scripts/activate

Install

$ pip install joj-submitter
$ joj-submit --help
Usage: joj-submit [OPTIONS] PROBLEM_URL COMPRESSED_FILE_PATH
                  LANG:[c|cc|llvm-c|llvm-cc|cmake|make|ocaml|matlab|cs|pas|jav
                  a|py|py3|octave|php|rs|hs|js|go|rb|other] [SID]

Arguments:
  PROBLEM_URL                     [required]
  COMPRESSED_FILE_PATH            [required]
  LANG:[c|cc|llvm-c|llvm-cc|cmake|make|ocaml|matlab|cs|pas|java|py|py3|octave|php|rs|hs|js|go|rb|other]
                                  other: other | c: C | cc: C++ | llvm-c: C
                                  (Clang, with memory check) | llvm-cc: C++
                                  (Clang++, with memory check) | cmake: CMake
                                  | make: GNU Make | ocaml: OCaml | matlab:
                                  MATLAB | cs: C# | pas: Pascal | java: Java |
                                  py: Python | py3: Python 3 | octave: Octave
                                  | php: PHP | rs: Rust | hs: Haskell | js:
                                  JavaScript | go: Go | rb: Ruby  [required]

  [SID]                           [env var: JOJ_SID;default: <EMPTY>]

Options:
  -s, --skip  Return immediately once uploaded.  [default: False]
  --version   Show version.
  --help      Show this message and exit.

Example

First get your JOJ_SID with https://github.com/BoYanZh/JI-Auth or via browser on your own.

Replace <YOUR_JOJ_SID> in the following methods with your actual SID.

Method 1 Call directly via CLI

  1. Mark JOJ_SID shell variable.
  2. Run joj-submit with arguments.
$ export JOJ_SID=<YOUR_JOJ_SID>
$ joj-submit -w https://joj.sjtu.edu.cn/d/vg101_fall_2020_manuel/homework/5fb1f1379fedcc0006622a06/5fb1ee8b9fedcc00066229d9 ans.zip cc
ans.zip upload succeed, record url https://joj.sjtu.edu.cn/d/vg101_fall_2020_manuel/records/60e42b17597d580006c571d6
status: Accepted, accept number: 49, score: 980, total time: 6167 ms, peak memory: 33.684 MiB

Method 2 Call from Makefile

  1. Add export JOJ_SID=<YOUR_JOJ_SID> to your ~/.bashrc or ~/.zshrc. Do not forget to restart the shell to load the variable.
  2. Edit and add this Makefile to your project https://gist.github.com/BoYanZh/6ee60b76f0fc70389c9ac0988fd16885.
  3. Run make joj.
$ make joj
tar -cvzf p4-src.tar.gz main.cpp
main.cpp
joj-submit https://joj.sjtu.edu.cn/d/ve281_summer_2021_hongyi/homework/60ed8820597d590006d91e44/60ed869b597d590006d91dad p4-src.tar.gz cc -w
p4-src.tar.gz upload succeed, record url https://joj.sjtu.edu.cn/d/ve281_summer_2021_hongyi/records/60f4451537f07210064b8c20
status: Accepted, accept number: 49, score: 980, total time: 6167 ms, peak memory: 33.684 MiB

Acknowledgements

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

joj-submitter-0.0.3.tar.gz (8.2 kB view details)

Uploaded Source

File details

Details for the file joj-submitter-0.0.3.tar.gz.

File metadata

  • Download URL: joj-submitter-0.0.3.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.8

File hashes

Hashes for joj-submitter-0.0.3.tar.gz
Algorithm Hash digest
SHA256 8bca58dee5616f1731f697049c13f66ec16980a4044ab34efc2246e1d104072e
MD5 a26029699238318598fc9bd21a0bc784
BLAKE2b-256 d8f62b3be9840504b2fa974acf58a7fc104a38a788e09a8bdb3132c43a2a7f37

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page