-
Notifications
You must be signed in to change notification settings - Fork 40
Description
In the JSON response for the API call /api/v2/challenge/{id} the keys .tasksRemaining and .completionPercentage sometimes show slightly wrong values. The correct values can be seen in the challenge web page (e.g. https://maproulette.org/browse/challenges/{id}) or by making a request at /api/v2/challenge/view/{id} and doing the math.
Here is a bunch of examples:
- Challenge 5556 (both values are wrong, 3% difference of completion):
$ curl -s 'https://maproulette.org/api/v2/challenge/5556' | jq -r .completionPercentage
76
$ curl -s 'https://maproulette.org/api/v2/challenge/5556' | jq -r .tasksRemaining
132
Web page https://maproulette.org/browse/challenges/5556 shows 79% and 118
- Challenge 43716 (both values are wrong, 1% difference of completion):
$ curl -s 'https://maproulette.org/api/v2/challenge/43716' | jq -r .completionPercentage
38
$ curl -s 'https://maproulette.org/api/v2/challenge/43716' | jq -r .tasksRemaining
286
Web page https://maproulette.org/browse/challenges/43716 shows 39% and 282
- Challenge 28186 (only .completionPercentage is wrong, 1% difference of completion):
$ curl -s 'https://maproulette.org/api/v2/challenge/28186' | jq -r .completionPercentage
19
$ curl -s 'https://maproulette.org/api/v2/challenge/28186' | jq -r .tasksRemaining
5598
Web page https://maproulette.org/browse/challenges/28186 shows 20% and 5598
- Challenge 42381 (only .completionPercentage is wrong, 1% difference of completion):
$ curl -s 'https://maproulette.org/api/v2/challenge/42381' | jq -r .completionPercentage
3
$ curl -s 'https://maproulette.org/api/v2/challenge/42381' | jq -r .tasksRemaining
26193
Web page https://maproulette.org/browse/challenges/42381 shows 4% and 26193
- Challenge 48926 (both values are wrong, 1% difference of completion):
$ curl -s 'https://maproulette.org/api/v2/challenge/48926' | jq -r .completionPercentage
48
$ curl -s 'https://maproulette.org/api/v2/challenge/48926' | jq -r .tasksRemaining
11552
Web page https://maproulette.org/browse/challenges/48926 shows 49% and 11510
I suppose that when .tasksRemaining contains the correct value it's just a problem of rounding to the nearest integer (because the .completionPercentage seems to be offset to just 1%), but what about the case where the difference is greater than 1%?
Kind regards,
Marco.