Open rendon opened 6 years ago
I think we should add this end-point so we can know all the submitions of a problem.
/users/{user_id}/problem/{problem_id}/submitions/: For a given user return the Id's of all his submitions to a given problem.
{
"problem_id": "1234",
"source": "http://codeforces.com/problemset/problem/580/C",
"submitions": ["submitions_id_1", "submitions_id_2", "submitions_id_3"]
}
Also, we can add a filter to the request so we can get all the submitions for a problem with a particular status.
/users/{user_id}/problem/{problem_id}/submitions/status/{status}: For a given user return the Id's of all the submitions with a particular status for a given problem.
{
"problem_id": "1234",
"source": "http://codeforces.com/problemset/problem/580/C",
"submitions": ["submitions_id_1", "submitions_id_2", "submitions_id_3"]
}
@hopkins0 do we need ALL the submissions? Or do we only need to know if the user has solved the problem?
Also, the /usrs/{user_id}/problems/{problem_id}
is used to indicate that a given user owns a problem, but in our platform the user does not own the problem, he/she just solves problems. Just something we should keep in mind.
@hopkins0 Actually, yes, a user can own problems, at least it could in the future.
Therefore I propose this:
URI: /users/{user_id}/problems/{problem_id}
Reponse:
{
"problem_id": 123,
"owner_id": 456,
"title": "Kefa and Park",
"source": "http://codeforces.com/problemset/problem/580/C",
"has_solved": "NO",
"has_tried": "YES"
}
This solves the original problem: Determine if user X has solved problem Y.
Later on when retrieving data for the dashboard we'll need another operation to retrieve this information for a set of problems (o even for a set of users), instead of making one call for every problem in the set, but this will be addressed in a future story.
I would go with this last proposal /users/{user_id}/problems/{problem_id}, but also I like the original endpoint : /problems/{id}/ but I think it could contain more information about the users who tried it also.
{
"id": "123",
"source": "http://codeforces.com/problemset/problem/580/C",
"tags": ["dp", "trees"]
"users_list": [
{
"user_id": "user1",
"status": "AC|WA|NA"
},
{
"user_id": "user1",
"status": "AC|WA|NA"
}
]
}
We can have both, the one I propose is to solve this issue's problem. /problems/{problem_id}
could return general information about a problem, not tied to any particular user.
We have to come up with an URI and the response format.
Some ideas for the URI:
/problems/{id}/: For a given problem, return the list of users that have solved this particular proble
/users/{user_id}/solutions/{solution_id}: For a given user return the details of his solution, or indicate he has not solved the problem.