This repository has been archived on 2026-11-06. You can view files and clone it. You cannot open issues or pull requests or push a commit.
2024-05-21 11:26:57 +03:00
2023-07-10 22:22:06 +03:00
2023-07-16 21:00:40 +03:00
2023-07-10 12:59:58 +03:00
2023-07-10 12:59:58 +03:00
2023-07-10 12:59:58 +03:00
2023-07-10 12:59:58 +03:00
2023-07-16 00:52:18 +03:00
2023-07-10 22:22:06 +03:00
2023-07-16 21:00:40 +03:00
2024-05-21 11:26:57 +03:00
2023-07-10 14:34:10 +03:00

StyleForces

The Codeforces toolkit to make life easier for teachers and worse for students.

One year I made one thing, next year another. They're small but still useful, so I've bundled them.

Commands

One binary contains multiple commands, here is the listing.

log2StanD

Convert contest log to JSON with freeze-time.

Usage: styleforces log2StanD [options...]
Options:
    --freeze, -f      (INTEGER) : Freeze time counting from start in minutes.
    --log, -l         (STRING)  : Path to the contest log file.
    --domain, -d      (STRING)  : Path to the domain's user's file.
    --only-domain, -i           : Ignore everyone not in domain.
    --out-file, -O    <STRING>  : Path to the resulted serialization. (default: './result.json')
Example: styleforces log2StanD -f 120 -l ./log.txt -d ./domain.txt -o ./result.json

This one was used on a local team Olympiad to make it more exciting for participants.

ACM ICPC like experience powered by StanD.

fetch

Fetch contest submissions ("OK" or point-threshold).

Usage: styleforces fetch [options...]
Options:
    --contest, -i (STRING)  : Contest ID.
    --group, -g   <STRING>  : Group ID (if in group).
    --count, -c   <INTEGER> : Positive amount of submissions to fetch. (default: 100)
    --lookup, -l  <INTEGER> : Positive amount of submissions to lookup. (default: 200)
    --after, -a   <INTEGER> : Positive amount of submissions to skip. (default: 1)
    --points, -p  <INTEGER> : Positive amount of points to filter. (default: 100)
    --exclude, -e [STRING]  : Index of problems to exclude from fetching.
    --out-dir, -O <STRING>  : Path to the directory to write submissions to. (default: './result')
Example: styleforces fetch -i someId -g anotherId -c 50 -l 100 -a 10 -o './result'

Basically, you do this to make some cool stuff later.

copydetect

Copydetect wrapper compatible with fetch command.

Usage: styleforces copydetect [copydetect options...]
Example: styleforces copydetect -t ./data -o cpp -O ./result.html

⚠️ copydetect needs to be accessible in your environment!

This makes fabulous HTML copy paste reports over submissions. Easily catch cheaters in your contests.

Enviroment

More about usage!

Variables

  • CF_KEY - Codeforces API Key.
  • CF_SECRET - Codeforces API Secret.
  • CF_COOKIE - Cookies extracted from your session.

❔About cookies: some info isn't accessible through codeforces API, though we need to scrap HTML to access it.

❕Moreover contests require manager role to access participant's submissions.

Options

  • --help, -h - should work everywhere depending on context. Default:
Usage: styleforces (command) [arguments...]
Commands:
    - log2StanD  : Convert contest log to JSON with freeze-time.
    - fetch      : Fetch submission from contest.
    - copydetect : Compare submissions and generate copy report of them. (requires copydetect)
Environment:
    CF_KEY    : Codeforces API Key.
    CF_SECRET : Codeforces API Secret.
    CF_COOKIE : Cookies extracted from your session.

Bundles

Maybe later...

Postface

Licence

Thank you for your attention!

S
Description
No description provided
Readme MIT
189 KiB
0 Stars 1 Watchers 0 Forks
Languages
TypeScript 93.7%
Python 6.3%