Code Monkey home page Code Monkey logo

compscript's Introduction

CompScript

CompScript is a tool for assigning groups and staff assignments for WCA Rubik's Cube competitions. Other similar tools include Groupifier, AGE, and Delegate Dashboard. Those tools are intended to be user-friendly, automated systems that give you a few configuration options, let you click a button to generate all assignments, then allow for fine-tuning. This is a power-user tool -- it is designed for competitions where the organizer would consider spending multiple hours assigning groups, due to complicated constraints like multiple stages, dedicated staff, a live stream, and a desire to have a large amount of control over how groups should be assigned. Competitions with up to ~200 competitors and only one stage are likely served better by another tool.

CompScript is designed primarily for CubingUSA Nationals and other large championships. Requirements for other competitions may not be prioritized.

Running

Node must be installed on your machine.

$ npm install
$ npm run dev-server

Running the development server will use uses a dev WCA environment running on the same machine. If you would like to use the production WCA site, you need to:

  1. Make an OAuth application here. For "Scopes", use public manage_competitions; for "Callback Urls" use http://localhost:3033/auth/oauth_response.
  2. Make a copy of the .env.DEV file, such as .env.PROD. This file should not be committed; .gitignore should automatically ignore it.
  3. Replace WCA_HOST, API_KEY, and API_SECRET with the production values. You should also consider changing the COOKIE_SECRET to a new value, and to change PORT to 3033 to distinguish from the dev version.
  4. Run with $ ENV=PROD node main.js, using the file suffix you used above.

Scripts

You can enter scripts in the script box, using a custom language called CompScript. See docs/scripts.md for full documentation.

Some examples:

The Luke psych sheet

Table(
  Sort(Persons(And(Registered(), (FirstName() == "Luke"))),
       PersonalBest(_333, "average")),
  [Column("Name", Name()),
   Column("WCA ID", WcaId(), WcaLink()),
   Column("Average", PersonalBest(_333)),
   Column("Single", PersonalBest(_333, "single")),
   Column("psych sheet ranking", PsychSheetPosition(_333))])

Defining a custom function

Define(
  "SumOfRankings",
  (PsychSheetPosition({1, Event}, "average") + PsychSheetPosition({1, Event}, "single")))

which can then be called by:

SumOfRankings(_333)

Google Sheets integration

We use the google-spreadsheets NPM package to read from Google Sheets. Please refer to this page for how to create a Service Account with Google Sheets access. Move the generated JSON file to google-credentials.json in the top-level project directory, and make sure to grant the service account access to the spreadsheet you'd like it to read.

Do not share the service account credentials with anyone who should not have access to the spreadsheets you'd like to read.

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.