feat(codechef): implement full CodeChef support (#354)

## Problem

CodeChef had no working login, submit, or contest list. The browser
selectors were wrong, the contest list was missing present/past
contests,
and problem/contest URLs were unset.

## Solution

Fix login and submit selectors for the Drupal-based site. Paginate
`/api/list/contests/past` to collect all 228 Starters, then expand each
parent contest into individual division entries (e.g. `START228 (Div.
4)`).
Add language IDs, correct `url`/`contest_url`/`standings_url` in
metadata,
and make `:CP <platform>` open the contest picker directly.
This commit is contained in:
Barrett Ruth 2026-03-06 23:10:44 -05:00 committed by GitHub
parent c7f2af16d4
commit 3c11d609f5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
26 changed files with 336 additions and 158 deletions

View file

@ -38,6 +38,7 @@ local function prompt_credentials(platform, callback)
end)
end
---@param opts { language?: string }?
function M.submit(opts)
local platform = state.get_platform()
local contest_id = state.get_contest_id()
@ -64,13 +65,13 @@ function M.submit(opts)
local eff = plat_effective and plat_effective[language]
if eff then
if eff.submit_id then
submit_language = eff.submit_id
submit_language = eff.submit_id or submit_language
else
local ver = eff.version or constants.DEFAULT_VERSIONS[language]
if ver then
local versions = (constants.LANGUAGE_VERSIONS[platform] or {})[language]
if versions and versions[ver] then
submit_language = versions[ver]
submit_language = versions[ver] or submit_language
end
end
end