Problems
API Methods at /problems route
Last updated
API Methods at /problems route
Last updated
GET
https://sort-me.org/api/problems/getByID
.
id*
int
ID of the problem
translations
[]string
GET
https://sort-me.org/api/problems/getPublic
GET
https://sort-me.org/api/problems/getTags
Returns all the tags which can be assigned to problems, and count of public problems which has the tags.
GET
https://sort-me.org/api/problems/getManaged
POST
https://sort-me.org/api/problems/create
Create a new problem from scratch.
initial_translation
string
If passed, problem will init with this language as first translation.
POST
https://sort-me.org/api/problems/import
Import problem from another platform.
You must include ZIP archive with your problem in form-data document
field.
source*
string
From where you are import problem.
For now, the only supported value is polygon
- for imports from Polygon or Codeforces.
POST
https://sort-me.org/api/problems/setStatement
Set problem statement for specific language/translation.
id*
int
Problem ID
translation*
string
Language code of the translation
statement*
string
Actual statement
POST
https://sort-me.org/api/problems/dropStatement
Drop problem statement for specific language/translation.
id*
int
Problem ID
translation*
string
Language code of the translation
POST
https://sort-me.org/api/problems/setSubtasks
Set subtasks for a problem.
Some problems on Sort Me are visually divided into subtasks, while others are not. However, internally, every problem on Sort Me is split into subtasks. If a problem isn't visually divided, it's because it's actually has just one subtask.
So, if you pass an empty list, problem will still preserve one subtask.
id*
int
Problem ID
subtasks*
[]subtask
GET
https://sort-me.org/api/problems/getAdmins
Get all admins of specific problems. Available only if you are admin of the problem.
id*
int
Problem ID
POST
https://sort-me.org/api/problems/setAdmin
Get all admins of specific problems. Available only if you are admin of the problem.
id*
int
Problem ID
Admin levels are interpreted as integers:
5 - Creator 4 - Administrator 3 - Editor 2 - Just look
GET
https://sort-me.org/api/problems/getTests
Get tests of the problem. Returns both tests and their subtasks.
problem_id
int
ID of the problem
GET
https://sort-me.org/api/problems/getTest
Get specific test of the problem. Be careful, sometimes tests can be very large (around tens of MBs).
problem_id*
int
ID of the problem
POST
https://sort-me.org/api/problems/setTest
Set specific test for the problem.
problem_id*
int
ID of the problem
test_id
int
Test number to insert, counted from 1.
If presented, the test will replace existing test with test_id number. If not, adds new test.
stdin*
string
Content of the test stdin
stdout*
string
Content of the test stdout
POST
https://sort-me.org/api/problems/setSamplesCount
Set count of the sampled - subslice of tests available within task's public page. By the design of Sort Me, there is no way to set samples separate from the actual tests.
problem_id*
int
ID of the problem
samples_count*
int
Count of the samples
POST
https://sort-me.org/api/problems/reorderTests
This method can help you to efficiently change the order of tests, without downloading or re-uploading it.
problem_id*
int
ID of the problem
new_order
[]int
IDs of the tests. Must be valid permutation from 1 to N, where N is tests count.
POST
https://sort-me.org/api/problems/dropTest
Delete test from problem.
problem_id*
int
ID of the problem
test_id*
int
ID of the test
POST
https://sort-me.org/api/problems/setTestComment
Set comment for specific test.
problem_id*
int
ID of the problem
test_id*
int
ID of the test
comment*
string
New comment for the test
POST
https://sort-me.org/api/problems/importTests
Upload ZIP archive with tests, previously downloaded from Sort Me or exported from another platform.
For now, import handler supports two formats:
01, 01.a, 02, 02.a...
input001.txt, output001.txt, input002.txt, output002.txt...
You must include your ZIP archive in form-data document
field.
problem_id*
int
ID of the problem
erase_existing
bool
For future use. Just set it to true
and remember that, after importing, all old tests will be erased.
GET
https://sort-me.org/api/problems/exportTests
Download ZIP archive with tests of the problem.
Exported tests have such format: input001.txt, output001.txt, input002.txt, output002.txt...
.
problem_id*
int
ID of the problem
See page.
Returns all the public problems available at Sort Me .
Returns all the problems where you are an admin of any level. The same list at Sort Me under "Managed" tab.
Subtasks to set. Object in the same form as in