Creating team and user accounts in batch mode

Jaap Eldering jaap at jaapeldering.nl
Wed Sep 30 20:09:44 CEST 2015


Hi Howard,

On 30-09-15 14:10, Howard Cheng wrote:
> Hi,
>
> I would like to create teams and user accounts in batch (e.g. from a
> spreadsheet). I'm using DOMjudge 4.0.5 and I see that there is an
> "Import / export" option, but I can't find much documentation on
> this.

You're right, the documentation on the import/export format is
missing. We're using the file formats as documented here:

https://clics.ecs.baylor.edu/index.php/Contest_Control_System#Appendix:_File_formats

There is a small difference wrt. that documentation though: instead of
the first field of the first line of each TSV file containing "label",
it should contain the literal string "File_Version" (without quotes),
i.e. the first line of teams.tsv should look like:

File_Version	1

This is due to some previous inconsistencies in that documentation.

Also, I now notice that in the 4.0 branch we do not support importing
accounts.tsv, only teams and groups. In 5.0 accounts can also be
imported.

> I have also somewhat successfully crafted my own SQL statements to
> insert tuples into the tables directly, but the problem is that I
> have to ask for the current id for the auto_increment fields of
> various tables and match them up. It's not a big deal, but if there
> is an easier option then I would like to know about it.

Unfortunately, (assuming DOMjudge >= 5.0) the above import method
allows you to create teams and accounts, but *not* to automatically
couple them. You could create and import teams.tsv and accounts.tsv
files with the team "external ID" field (note that DOMjudge accepts
strings, not just integers) matching the user "username" field. Then
you can write a simple SQL query to create entries in the DOMjudge
userrole table to couple these.

Creating a better interface for this is still on our todo list...

Jaap



More information about the DOMjudge-devel mailing list