Skip to content

ACM scoreboard developed for codeforces.com. Written purely in JavaScript/JQuery, HTML, and CSS

License

Notifications You must be signed in to change notification settings

ThunderStruct/ACM-Scoreboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ACM Scoreboard

developed for codeforces.com

PRs Welcome Release Version License

Usage

Hosted Version (recommended)

The scoreboard is already hosted, tested, and ready to use!

Note: the server sleeps for 1 hour daily at 1AM GMT. If that's an issue, consider the next option

Localhost

To ensure absolute control over the running environment, clone the project and run it on a local (or remote) HTTP server.

Note: Python is required for the following steps

  1. cd to a desired directory to contain all the project files
  2. git clone https://github.com/ThunderStruct/ACM-Scoreboard.git
  3. python -m SimpleHTTPServer for Python 2.x. Alternatively, use python -m http.server for Python 3.x
  4. The scoreboard is now accessible through port 8000 (localhost:8000)

This platform requires a CORS-enabled (or HTTP) server. Localhost servers do not normally have cross-origin resource sharing on, in that case one of the following browser plugins can be used:

Setup

There are 3 main components in the setup screen:

  1. User handles - can be inserted one at a time or using a '\n' separated file (carriage return '%0D' can also be used)
  2. Problem ID and color - the contest ID + letter pair that identify a Codeforces problem and optionally an associated color (set to White if not chosen). All problems' weights are 500 points by default, which can be changed by hovering over the inserted entry
  3. Contest duration - the contest's start and end times (GMT not local time!)

The verify button in the setup screen cross-references the given handle names' solved problems with the given listed problems (for the contest creator's awareness - requires at least 1 handle and 1 problem)

Once the setup is complete and the "START CONTEST" button is clicked, pre-contest preparations start. The preparations include:

  1. Fetching Missing Problem Names - in case the contest was copied from a running one, all previously fetched problem names will be copied, resulting in less preparation time. In case of an error during problem-name retrieval, an input toast will be shown to prompt for problem removal or manual name insertion (empty strings are allowed)
  2. User Handles Validation - the inserted user handles are recursively validated. All invalid user handles trigger a confirmation toast to remove or keep them

Scoreboard

  • The contest table's rows are dynamically sorted descendingly (top-scorer at the top) after each update

  • The scoreboard updates the data automatically once every 2.5 minutes from the last update

  • The scoreboard table shows the retrieved data in the form of (number of submissions / total problem penalties)

  • Color coding:

    • Red: only wrong submission(s)
    • Light green: at least 1 correct submission
    • Dark green: first submission of a sepcific problem
  • The scoreboard table wrapper is draggable (enable/disable this feature using the hotkey d). This feature was added to help with projectors' misalignment and similar cases

Tools

Some useful tools are found in the floating tools button at the bottom-right corner of the screen!

Hotkeys

Key Action Default
t Toggle the tools floating button On (visible)
d Enable/disable the contest table dragging Disabled
f Toggle fullscreen Off
m Mute/unmute contest ending sound Unmuted

Documentation

This method provides a reference by opening the website's documentation in a new tab

No Requirements

Light Mode

This tool toggles between Lights On/Off styles

No Requirements

Log Detailed Report

This method displays more detailed information corresponding to each entered Codeforces handle in the developer console.

note: this method logs potentially large amounts of data, and developer consoles on many browsers might hide part of the report if the console is not open. To avoid that issue, make sure the developer console is open while using this tool

Requirements:

  • At least 1 entered user handle
  • Setup start time and end time (optional - filters out the the details that do not fall in the given time range)

The results of the method per handle include:

  • Handle name
  • A table of total submissions count and correct submissions count grouped by day
  • A list of grouped details of each submission

getSubmissionDetails() example

Log Last Submission

This method displays the last accepted submission's data as of the time it's called in the developer console

Requirements:

  • At least 1 problem submission

The results of the method include:

  • Handle name
  • The last submission's problem details

Copy Contest

This tool generates an encoded, compressed string and copies it to the clipboard. It is recommended to always have that encoded string in case of an accidental page-refresh or any technical issue to easily load the contest quickly without re-entering the data

Requirements:

  • At least 1 entered user handle
  • At least 1 entered problem data
  • Contest start and end times

note: the generated string does NOT contain cancelled submissions' data. All cancelled submissions must be re-entered! the generated string contains all cancelled submissions' data as of version 1.1.0

Load Contest

This tool takes a previously generated encoded setup string (using the Copy Contest tool), decodes it, and loads the setup data

Requirements:

  • To be in setup mode (contest not started)

Modify Contest Duration

This tool modifies a current contest's duration by adding or subtracting a given amount of time (in seconds)

For instance, to add an extra minute to the current contest, insert 60 (seconds). To subtract half an hour from the remaining duration, insert -1800

A confirmation toast will appear after insertion showing the timer value after the modification

Requirements:

  • A running contest

Cancel Submission

This tool takes a codeforces submission ID (can be found using Log Detailed Report or, alternatively, console.log(scores) in the developer console) to cancel it incase of an illegal submission or similar

As of version 1.2.0, a submission ID can be removed from the cancellation list simply by adding a negative - sign before the ID

Scores must be updated afterwards to see effect

note: currently, the only way to undo this action is to setup the contest again

Requirements:

  • At least 1 problem submission

Toggle Blind Mode

This method toggles the blind mode on and off. During blind time, automatic score updating is disabled (can still be manually updated, however)

Requirements:

  • Contest must be running

Update Scores

This method manually updates the scores and resets the automatic updater's interval

Requirements:

  • Contest must be running

Scoring

  • Difficulty (the points assigned to the problem, which is 500 by default and can be changed by hovering over the problem and choosing a new score)
  • The submission time relative to the contest start time
  • The number of wrong submissions
  • The submissions evaluation time (code efficiency; has minor weight)
  • All scoring components are based on a time-related factor.
  1. 20 minutes = [(problemPoints / 2) / (duration / 20)] points
  2. The above formula would penalize a last-second submission by half the problem points
  3. Each wrong submission is penalized by 10 minutes
  4. Problem evaluation time gives up to 20 minutes bonus (for a 15ms submission)
  • Wrong submissions on unsolved problems do not affect the total scores.

Title attributes are assigned to the contest table's cells for convenience

  • Hovering over any problem in the header row of the contest table will display its score points
  • Hovering over any submission cell will display the last submission's date/time
  • Hovering over any handle will display the user's current total score

note: the scoring equation can be customized in contest.js -> calculateScore()

Credits

  • This scoreboard is solely created by Mohamed Shahawy (ThunderStruct)
  • Hubspot's PACE loading screen is used
  • A modified version of jQuery-SimpleColorPicker (available here)
  • Matthew Crumley's SO post on LZW string compression

Happy ACMing!

Todos

  • Add a "legend" over the scoreboard to describe the color coding scheme (added in 1.1.0)

  • Add the cancelled submissions to the encoded setup string generated by the Copy Contest tool (added in 1.1.0)

  • Add a tool to edit the contest time (add or subtract x minutes from remaining duration) (added in 1.3.0)

  • Add a tool to enable/disable contest table dragging (added in 1.3.0 as a hotkey instead of a tool)

  • Show a confirmation alert on page-unloading attempts while a contest is running (added in 1.1.1)

  • Display scores data in the console when blind-mode is on (added in 1.4.0)

  • Auto retrieve the problems' names using the given problem IDs and replace the "Problem name" field with "Problem color" (added in 1.4.0)

Contribution Guide

Feel free to make a pull request if you find any room for enhancements or fixing bugs. The following brief file descriptions should be helpful! Please make sure to read the repo's CONTRIBUTING guide before making any changes

License

CC This work is licensed under a Creative Commons Attribution 4.0 International License