Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
821b1b8
Change language.langid to auto increment integer
nickygerritsen Oct 24, 2025
64de025
Change public pages to use external IDs instead of internal IDs
nickygerritsen Oct 25, 2025
31b5d06
Change team pages to use external IDs instead of internal IDs
nickygerritsen Oct 26, 2025
f09e488
Change jury analysis pages to use external IDs instead of internal IDs
nickygerritsen Oct 26, 2025
6371dc7
Change jury audit log pages and logic to use external IDs instead of …
nickygerritsen Oct 26, 2025
3c8895d
Change jury balloon pages to use external IDs instead of internal IDs
nickygerritsen Oct 26, 2025
75e1799
Change jury clarification pages to use external IDs instead of intern…
nickygerritsen Oct 26, 2025
fefba55
Change config checker to use external IDs instead of internal IDs
nickygerritsen Oct 26, 2025
ea354b6
Change jury contest pages to use external IDs instead of internal IDs
nickygerritsen Oct 26, 2025
2c22819
Change jury executable pages to use external IDs instead of internal IDs
nickygerritsen Oct 26, 2025
d01e393
Update entity ID badge to display only one ID
nickygerritsen Oct 26, 2025
e1970f3
Fix refreshing scoreboard with external IDs
nickygerritsen Oct 30, 2025
b510a51
Change jury import/export pages to use external IDs instead of intern…
nickygerritsen Oct 30, 2025
7fb7b92
Change jury internal error pages to use external IDs instead of inter…
nickygerritsen Oct 30, 2025
15fccb6
Fix freeze display for balloons page with external ID
nickygerritsen Oct 30, 2025
5222b7a
Change jury misc pages to use external IDs instead of internal IDs
nickygerritsen Oct 30, 2025
b3f4661
Make sure we save the audit log with a string
nickygerritsen Oct 30, 2025
1a12659
Change jury language pages to use external IDs instead of internal IDs
nickygerritsen Oct 30, 2025
38f2975
Change jury problem pages to use external IDs instead of internal IDs
nickygerritsen Oct 30, 2025
6702b9c
Change jury queue task pages to use external IDs instead of internal IDs
nickygerritsen Oct 30, 2025
d590c34
Change jury rejudging pages to use external IDs instead of internal IDs
nickygerritsen Oct 30, 2025
02bd5cb
Change jury scoreboard page to use external IDs instead of internal IDs
nickygerritsen Oct 30, 2025
2d9333d
Change jury submission pages to use external IDs instead of internal IDs
nickygerritsen Nov 29, 2025
dd0d6dd
Change jury team affiliation and category pages to use external IDs i…
nickygerritsen Nov 11, 2025
928befb
Change jury team pages to use external IDs instead of internal IDs
nickygerritsen Nov 11, 2025
c2121c5
Change jury user pages to use external IDs instead of internal IDs
nickygerritsen Nov 11, 2025
2a97bfd
Make keyboard shortcuts work with external IDs
nickygerritsen Nov 29, 2025
7368c00
Do not expose internal IDs in public API
nickygerritsen Nov 29, 2025
290fa58
Use external submission ID in judgehost API
nickygerritsen Nov 29, 2025
13b1945
Fix tests to be in sync with external ID changes
nickygerritsen Nov 30, 2025
3960c35
Fix spelling errors
nickygerritsen Nov 30, 2025
7ff7b0b
Fix one final test
nickygerritsen Nov 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ChangeLog
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might deserve a changelog entry :-)

Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ Version 7.1.0 - 25 September 2019
- Upgrade Symfony and dependencies to version 4.3.
- Use Doctrine for migrations and initial data.
- Add option (enabled by default) to limit files passed to
language compilers by langauge extension list.
language compilers by language extension list.
- Add option to add a whole team category to a contest.
- Allow admin to specify print command using configuration setting.
- Show metadata for judging runs.
Expand Down
8 changes: 4 additions & 4 deletions judge/judgedaemon.main.php
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@

private function judgingDirectory(string $workdirpath, array $judgeTask): string
{
if (filter_var($judgeTask['submitid'], FILTER_VALIDATE_INT) === false ||
if (filter_var($judgeTask['submitid'], FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => '/^[a-zA-Z0-9_.-]+$/']]) === false ||
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we define this somewhere more generally?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, what do submission URLs look like after this change?

filter_var($judgeTask['jobid'], FILTER_VALIDATE_INT) === false) {
error("Malformed data returned in judgeTask IDs: " . var_export($judgeTask, true));
}
Expand Down Expand Up @@ -857,7 +857,7 @@
return trim(ob_get_clean());
}

private function runCommandSafe(array $command_parts, & $retval = DONT_CARE, $log_nonzero_exitcode = true): bool

Check failure on line 860 in judge/judgedaemon.main.php

View workflow job for this annotation

GitHub Actions / phpcs

Expected 0 spaces after reference operator for argument "$retval"; 1 found
{
if (empty($command_parts)) {
logmsg(LOG_WARNING, "Need at least the command that should be called.");
Expand All @@ -869,7 +869,7 @@

logmsg(LOG_DEBUG, "Executing command: $command");
system($command, $retval_local);
if ($retval !== DONT_CARE) $retval = $retval_local;

Check failure on line 872 in judge/judgedaemon.main.php

View workflow job for this annotation

GitHub Actions / phpcs

Inline control structures are not allowed

if ($retval_local !== 0) {
if ($log_nonzero_exitcode) {
Expand All @@ -889,7 +889,7 @@
int $judgeTaskId,
bool $combined_run_compare = false
): array
{

Check failure on line 892 in judge/judgedaemon.main.php

View workflow job for this annotation

GitHub Actions / phpcs

The closing parenthesis and the opening brace of a multi-line function declaration must be on the same line
[$execrunpath, $error, $buildlogpath] = $this->fetchExecutableInternal($workdirpath, $type, $execid, $hash, $combined_run_compare);
if (isset($error)) {
$extra_log = null;
Expand Down Expand Up @@ -918,7 +918,7 @@
string $hash,
bool $combined_run_compare = false
): array
{

Check failure on line 921 in judge/judgedaemon.main.php

View workflow job for this annotation

GitHub Actions / phpcs

The closing parenthesis and the opening brace of a multi-line function declaration must be on the same line
$execdir = join('/', [
$workdirpath,
'executable',
Expand Down Expand Up @@ -1123,12 +1123,12 @@
private function disable(
string $kind,
string $idcolumn,
$id,

Check failure on line 1126 in judge/judgedaemon.main.php

View workflow job for this annotation

GitHub Actions / phpcs

Multi-line function declaration not indented correctly; expected 8 spaces but found 16
string $description,
?int $judgeTaskId = null,
?string $extra_log = null
): void
{

Check failure on line 1131 in judge/judgedaemon.main.php

View workflow job for this annotation

GitHub Actions / phpcs

The closing parenthesis and the opening brace of a multi-line function declaration must be on the same line
$disabled = dj_json_encode(['kind' => $kind, $idcolumn => $id]);
$judgehostlog = $this->readJudgehostLog();
if (isset($extra_log)) {
Expand Down Expand Up @@ -1198,7 +1198,7 @@
?string $daemonid,
int $output_storage_limit
): bool
{

Check failure on line 1201 in judge/judgedaemon.main.php

View workflow job for this annotation

GitHub Actions / phpcs

The closing parenthesis and the opening brace of a multi-line function declaration must be on the same line
// Reuse compilation if it already exists.
if (file_exists("$workdir/compile.success")) {
return true;
Expand Down Expand Up @@ -1289,7 +1289,7 @@

// Revoke readablity for domjudge-run user to this workdir.
chmod($workdir, 0700);
logmsg(LOG_NOTICE, "Judging s$judgeTask[submitid], task $judgeTask[judgetaskid]: compile error");
logmsg(LOG_NOTICE, "Judging $judgeTask[submitid], task $judgeTask[judgetaskid]: compile error");
return false;
}

Expand Down Expand Up @@ -1353,7 +1353,7 @@
// What does the exitcode mean?
if (!isset($this->EXITCODES[$retval])) {
alert('error');
$description = "Unknown exitcode from compile.sh for s$judgeTask[submitid]: $retval";
$description = "Unknown exitcode from compile.sh for $judgeTask[submitid]: $retval";
logmsg(LOG_ERR, $description);
$this->disable('compile_script', 'compile_script_id', $judgeTask['compile_script_id'], $description, $judgeTask['judgetaskid'], $compile_output);

Expand Down Expand Up @@ -1568,7 +1568,7 @@
// What does the exitcode mean?
if (!isset($this->EXITCODES[$retval])) {
alert('error');
error("Unknown exitcode ($retval) from testcase_run.sh for s$judgeTask[submitid]");
error("Unknown exitcode ($retval) from testcase_run.sh for $judgeTask[submitid]");
}
$result = $this->EXITCODES[$retval];

Expand Down
141 changes: 141 additions & 0 deletions webapp/migrations/Version20251024122021.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
<?php

declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20251024122021 extends AbstractMigration
{
public function getDescription(): string
{
return 'Change language ID to be an auto increment integer';
}

public function up(Schema $schema): void
{
// We need to do some juggling to get this to work:
// - First we drop the foreign keys from tables referencing langid. We also drop compound
// - Then we add a temporary integer langid column to all these tables, since we can't
// change the langid column itself, because MySQL will try to convert the strings to
// integers and fail. We set the langid column in the language table to auto increment,
// so it's filled by MySQL.
// - Now we copy the langid_int values to other tables.
// - Then we drop the old langid columns and drop any (compound) primary keys that use it.
// - Next, we rename the langid_int columns back to langid.
// - Finally we add back all primary and foreign keys.

$this->addSql('ALTER TABLE submission DROP FOREIGN KEY submission_ibfk_4');
$this->addSql('ALTER TABLE problemlanguage DROP FOREIGN KEY FK_46B150BB2271845');
$this->addSql('ALTER TABLE version DROP FOREIGN KEY FK_BF1CD3C32271845');
$this->addSql('ALTER TABLE contestlanguage DROP FOREIGN KEY FK_ADCB43232271845');

$this->addSql('ALTER TABLE language ADD langid_int INT UNSIGNED AUTO_INCREMENT UNIQUE AFTER langid');
$this->addSql('ALTER TABLE contestlanguage ADD langid_int INT UNSIGNED NOT NULL AFTER langid');
$this->addSql('ALTER TABLE problemlanguage ADD langid_int INT UNSIGNED NOT NULL AFTER langid');
$this->addSql('ALTER TABLE submission ADD langid_int INT UNSIGNED DEFAULT NULL AFTER langid');
$this->addSql('ALTER TABLE version ADD langid_int INT UNSIGNED DEFAULT NULL AFTER langid');

$this->addSql('UPDATE contestlanguage c JOIN language l ON c.langid = l.langid SET c.langid_int = l.langid_int');
$this->addSql('UPDATE problemlanguage p JOIN language l ON p.langid = l.langid SET p.langid_int = l.langid_int');
$this->addSql('UPDATE submission s JOIN language l ON s.langid = l.langid SET s.langid_int = l.langid_int WHERE s.langid IS NOT NULL');
$this->addSql('UPDATE version v JOIN language l ON v.langid = l.langid SET v.langid_int = l.langid_int WHERE v.langid IS NOT NULL');
$this->addSql('UPDATE auditlog a JOIN language l ON a.dataid = l.langid AND a.datatype = "language" SET a.dataid = l.langid_int WHERE a.dataid IS NOT NULL');

$this->addSql('ALTER TABLE language DROP PRIMARY KEY');
$this->addSql('ALTER TABLE language DROP COLUMN langid');
$this->addSql('ALTER TABLE contestlanguage DROP PRIMARY KEY');
$this->addSql('ALTER TABLE contestlanguage DROP COLUMN langid');
$this->addSql('ALTER TABLE problemlanguage DROP PRIMARY KEY');
$this->addSql('ALTER TABLE problemlanguage DROP COLUMN langid');
$this->addSql('ALTER TABLE submission DROP COLUMN langid');
$this->addSql('ALTER TABLE version DROP COLUMN langid');

$this->addSql('ALTER TABLE language CHANGE langid_int langid INT UNSIGNED AUTO_INCREMENT NOT NULL COMMENT \'Language ID\'');
$this->addSql('ALTER TABLE contestlanguage CHANGE langid_int langid INT UNSIGNED NOT NULL COMMENT \'Language ID\'');
$this->addSql('ALTER TABLE problemlanguage CHANGE langid_int langid INT UNSIGNED NOT NULL COMMENT \'Language ID\'');
$this->addSql('ALTER TABLE submission CHANGE langid_int langid INT UNSIGNED DEFAULT NULL COMMENT \'Language ID\'');
$this->addSql('ALTER TABLE version CHANGE langid_int langid INT UNSIGNED DEFAULT NULL COMMENT \'Language ID\'');

$this->addSql('ALTER TABLE language ADD PRIMARY KEY (langid), DROP INDEX langid_int');
$this->addSql('ALTER TABLE contestlanguage ADD PRIMARY KEY (cid, langid)');
$this->addSql('ALTER TABLE problemlanguage ADD PRIMARY KEY (probid, langid)');

$this->addSql('ALTER TABLE submission ADD INDEX langid (langid), ADD CONSTRAINT submission_ibfk_4 FOREIGN KEY (langid) REFERENCES language (langid) ON DELETE CASCADE');
$this->addSql('ALTER TABLE problemlanguage ADD INDEX IDX_46B150BB2271845 (langid), ADD CONSTRAINT FK_46B150BB2271845 FOREIGN KEY (langid) REFERENCES language (langid) ON DELETE CASCADE');
$this->addSql('ALTER TABLE version ADD INDEX IDX_BF1CD3C32271845 (langid), ADD CONSTRAINT FK_BF1CD3C32271845 FOREIGN KEY (langid) REFERENCES language (langid) ON DELETE CASCADE');
$this->addSql('ALTER TABLE contestlanguage ADD INDEX IDX_ADCB43232271845 (langid), ADD CONSTRAINT FK_ADCB43232271845 FOREIGN KEY (langid) REFERENCES language (langid) ON DELETE CASCADE');
}

public function down(Schema $schema): void
{
// When migrating back, we do the logic in reverse but we have custom logic for setting
// the string langid. We set it to the external ID except for a set of 10 known languages
// where the external ID differs from our previously used langid.

$this->addSql('ALTER TABLE submission DROP FOREIGN KEY submission_ibfk_4');
$this->addSql('ALTER TABLE problemlanguage DROP FOREIGN KEY FK_46B150BB2271845');
$this->addSql('ALTER TABLE version DROP FOREIGN KEY FK_BF1CD3C32271845');
$this->addSql('ALTER TABLE contestlanguage DROP FOREIGN KEY FK_ADCB43232271845');

$this->addSql('ALTER TABLE language ADD langid_str VARCHAR(32) NOT NULL AFTER langid');
$this->addSql('ALTER TABLE contestlanguage ADD langid_str VARCHAR(32) NOT NULL AFTER langid');
$this->addSql('ALTER TABLE problemlanguage ADD langid_str VARCHAR(32) NOT NULL AFTER langid');
$this->addSql('ALTER TABLE submission ADD langid_str VARCHAR(32) DEFAULT NULL AFTER langid');
$this->addSql('ALTER TABLE version ADD langid_str VARCHAR(32) DEFAULT NULL AFTER langid');

$this->addSql("UPDATE language SET langid_str = CASE externalid
WHEN 'ada' THEN 'adb'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

huh, ada -> adb? Is that what you want?

WHEN 'haskell' THEN 'hs'
WHEN 'javascript' THEN 'js'
WHEN 'kotlin' THEN 'kt'
WHEN 'pascal' THEN 'pas'
WHEN 'prolog' THEN 'plg'
WHEN 'python3' THEN 'py3'
WHEN 'python2' THEN 'py2'
WHEN 'ruby' THEN 'rb'
WHEN 'rust' THEN 'rs'
ELSE externalid
END");

$this->addSql('UPDATE contestlanguage c JOIN language l ON c.langid = l.langid SET c.langid_str = l.langid_str');
$this->addSql('UPDATE problemlanguage p JOIN language l ON p.langid = l.langid SET p.langid_str = l.langid_str');
$this->addSql('UPDATE submission s JOIN language l ON s.langid = l.langid SET s.langid_str = l.langid_str WHERE s.langid IS NOT NULL');
$this->addSql('UPDATE version v JOIN language l ON v.langid = l.langid SET v.langid_str = l.langid_str WHERE v.langid IS NOT NULL');
$this->addSql('UPDATE auditlog a JOIN language l ON a.dataid = l.langid AND a.datatype = "language" SET a.dataid = l.langid_str WHERE a.dataid IS NOT NULL');

$this->addSql('ALTER TABLE language DROP PRIMARY KEY');
$this->addSql('ALTER TABLE language DROP COLUMN langid');
$this->addSql('ALTER TABLE contestlanguage DROP PRIMARY KEY');
$this->addSql('ALTER TABLE contestlanguage DROP COLUMN langid');
$this->addSql('ALTER TABLE problemlanguage DROP PRIMARY KEY');
$this->addSql('ALTER TABLE problemlanguage DROP COLUMN langid');
$this->addSql('ALTER TABLE submission DROP COLUMN langid');
$this->addSql('ALTER TABLE version DROP COLUMN langid');

$this->addSql('ALTER TABLE language CHANGE langid_str langid VARCHAR(32) NOT NULL COMMENT \'Language ID\'');
$this->addSql('ALTER TABLE contestlanguage CHANGE langid_str langid VARCHAR(32) NOT NULL COMMENT \'Language ID\'');
$this->addSql('ALTER TABLE problemlanguage CHANGE langid_str langid VARCHAR(32) NOT NULL COMMENT \'Language ID\'');
$this->addSql('ALTER TABLE submission CHANGE langid_str langid VARCHAR(32) DEFAULT NULL COMMENT \'Language ID\'');
$this->addSql('ALTER TABLE version CHANGE langid_str langid VARCHAR(32) DEFAULT NULL COMMENT \'Language ID\'');

$this->addSql('ALTER TABLE language ADD PRIMARY KEY (langid)');
$this->addSql('ALTER TABLE contestlanguage ADD PRIMARY KEY (cid, langid)');
$this->addSql('ALTER TABLE problemlanguage ADD PRIMARY KEY (probid, langid)');

$this->addSql('ALTER TABLE submission ADD INDEX langid (langid), ADD CONSTRAINT submission_ibfk_4 FOREIGN KEY (langid) REFERENCES language (langid) ON DELETE CASCADE');
$this->addSql('ALTER TABLE problemlanguage ADD INDEX IDX_46B150BB2271845 (langid), ADD CONSTRAINT FK_46B150BB2271845 FOREIGN KEY (langid) REFERENCES language (langid) ON DELETE CASCADE');
$this->addSql('ALTER TABLE version ADD INDEX IDX_BF1CD3C32271845 (langid), ADD CONSTRAINT FK_BF1CD3C32271845 FOREIGN KEY (langid) REFERENCES language (langid) ON DELETE CASCADE');
$this->addSql('ALTER TABLE contestlanguage ADD INDEX IDX_ADCB43232271845 (langid), ADD CONSTRAINT FK_ADCB43232271845 FOREIGN KEY (langid) REFERENCES language (langid) ON DELETE CASCADE');
}

public function isTransactional(): bool
{
return false;
}
}
66 changes: 66 additions & 0 deletions webapp/migrations/Version20251026092516.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?php

declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
use phpDocumentor\Reflection\Types\Static_;

final class Version20251026092516 extends AbstractMigration
{
protected const ENTITIES = [
'clarification' => 'clarid',
'contest' => 'cid',
'language' => 'langid',
'problem' => 'probid',
'submission' => 'submitid',
'team' => 'teamid',
'team_affiliation' => 'affilid',
'team_category' => 'categoryid',
'user' => ['userid', 'username'],
];

public function getDescription(): string
{
return 'Make auditlog IDs reference external IDs';
}

public function up(Schema $schema): void
{
// Note: this migration only works for entities that still exist. For others, it will not work but there is nothing we can do
$this->addSql('ALTER TABLE auditlog CHANGE cid cid VARCHAR(255) DEFAULT NULL COMMENT \'External contest ID associated to this entry\', CHANGE dataid dataid VARCHAR(64) DEFAULT NULL COMMENT \'(External) identifier in reference table\'');
$this->addSql('UPDATE auditlog INNER JOIN contest ON CAST(contest.cid AS CHAR) = auditlog.cid SET auditlog.cid = contest.externalid');
foreach (static::ENTITIES as $table => $fields) {
if (!is_array($fields)) {
$fields = [$fields];
}
foreach ($fields as $field) {
$this->addSql(sprintf(
'UPDATE auditlog INNER JOIN %s ON CAST(%s.%s AS CHAR) = auditlog.dataid AND auditlog.datatype = "%s" SET auditlog.dataid = %s.externalid',
$table, $table, $field, $table, $table
));
}
}
}

public function down(Schema $schema): void
{
// Note: this migration only works for entities that still exist. For others, it will not work but there is nothing we can do
$this->addSql('UPDATE auditlog INNER JOIN contest ON contest.externalid = auditlog.cid SET auditlog.cid = contest.cid');
foreach (static::ENTITIES as $table => $fields) {
$field = is_array($fields) ? $fields[0] : $fields;
$this->addSql(sprintf(
'UPDATE auditlog INNER JOIN %s ON %s.externalid = auditlog.dataid AND auditlog.datatype = "%s" SET auditlog.dataid = %s.%s',
$table, $table, $table, $table, $field
));
}
$this->addSql('ALTER TABLE auditlog CHANGE cid cid INT UNSIGNED DEFAULT NULL COMMENT \'Contest ID associated to this entry\', CHANGE dataid dataid VARCHAR(64) DEFAULT NULL COMMENT \'Identifier in reference table\'');
}

public function isTransactional(): bool
{
return false;
}
}
32 changes: 19 additions & 13 deletions webapp/public/js/domjudge.js
Original file line number Diff line number Diff line change
Expand Up @@ -998,14 +998,16 @@ function initializeKeyboardShortcuts() {
var parts = window.location.href.split('/');
var lastPart = parts[parts.length - 1];
var params = lastPart.split('?');
var currentNumber = parseInt(params[0]);
if (isNaN(currentNumber)) {
return;
}
if (key === 'j') {
parts[parts.length - 1] = currentNumber + 1;
if (!window.nextEntity) {
return;
}
parts[parts.length - 1] = window.nextEntity;
} else if (key === 'k') {
parts[parts.length - 1] = currentNumber - 1;
if (!window.previousEntity) {
return;
}
parts[parts.length - 1] = window.previousEntity;
}
if (params.length > 1) {
parts[parts.length - 1] += '?' + params[1];
Expand Down Expand Up @@ -1039,9 +1041,13 @@ function initializeKeyboardShortcuts() {
sequence = '';
return;
}
if (e.key >= '0' && e.key <= '9') {
if (/^[a-zA-Z0-9_.-]$/.test(e.key)) {
sequence += e.key;
box.text(type + sequence);
} else if (e.key === 'Backspace') {
e.preventDefault();
sequence = sequence.slice(0, -1);
box.text(type + sequence);
} else {
ignore = false;
if (box) {
Expand Down Expand Up @@ -1302,8 +1308,8 @@ function initScoreboardSubmissions() {
const linkEl = e.currentTarget;
e.preventDefault();
const $modal = $('[data-submissions-modal] .modal').clone();
const $teamEl = $(`[data-team-external-id="${linkEl.dataset.teamId}"]`);
const $problemEl = $(`[data-problem-external-id="${linkEl.dataset.problemId}"]`);
const $teamEl = $(`tr[data-team-id="${linkEl.dataset.teamId}"]`);
const $problemEl = $(`th[data-problem-id="${linkEl.dataset.problemId}"]`);
$modal.find('[data-team]').html($teamEl.data('teamName'));
$modal.find('[data-problem-badge]').html($problemEl.data('problemBadge'));
$modal.find('[data-problem-name]').html($problemEl.data('problemName'));
Expand Down Expand Up @@ -1403,7 +1409,7 @@ function initDiffEditor(editorId) {
'onDiffSelectChange': (f) => {
select.change((e) => {
const noDiff = e.target.value === "";
const submitId = parseInt(e.target.value);
const submitId = e.target.value;
f(submitId, noDiff);
});
}
Expand Down Expand Up @@ -1432,10 +1438,10 @@ function initDiffEditor(editorId) {
diffTitle.style.display = 'inline';
diffTag.innerText = selected.dataset.tag;
diffLink.href = selected.dataset.url;
diffLink.innerText = `s${submitId}`;
diffLink.innerText = submitId;
}
};
updateSelect(parseInt(select[0].value), select[0].value === "");
updateSelect(select[0].value, select[0].value === "");
editor.onDiffSelectChange(updateSelect);
}

Expand Down Expand Up @@ -1559,7 +1565,7 @@ function initDiffEditorTab(editorId, diffId, submissionId, models) {
return;
}

const submitId = parseInt(editors[editorId].getDiffSelection());
const submitId = editors[editorId].getDiffSelection();
const noDiff = editors[editorId].getDiffSelection() === "";
if (noDiff) {
setIcon('file');
Expand Down
4 changes: 2 additions & 2 deletions webapp/src/Controller/API/BalloonController.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ public function listAction(
foreach ($balloonsData as $b) {
/** @var Team $team */
$team = $b['data']['team'];
$teamName = "t" . $team->getTeamid() . ": " . $team->getEffectiveName();
$teamName = $team->getExternalid() . ": " . $team->getEffectiveName();
$balloons[] = new Balloon(
balloonid: $b['data']['balloonid'],
time: $b['data']['time'],
problem: $b['data']['problem'],
contestproblem: $b['data']['contestproblem'],
team: $teamName,
teamid: $team->getTeamid(),
teamid: $team->getExternalid(),
location: $b['data']['location'],
affiliation: $b['data']['affiliation'],
affiliationid: $b['data']['affiliationid'],
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/Controller/API/ClarificationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ public function addAction(
$this->em->persist($clarification);
$this->em->flush();

$this->dj->auditlog('clarification', $clarification->getClarid(), 'added', null, null, $contestId);
$this->dj->auditlog('clarification', $clarification->getExternalid(), 'added', null, null, $contest->getExternalid());
$this->eventLogService->log('clarification', $clarification->getClarid(), 'create', $contestId);

// Refresh the clarification since the event log service will have unloaded it.
Expand Down
Loading
Loading