scoreboard
scoreboard copied to clipboard
MapRoulette + Scoreboard Integration
Integrate MapRoulette (MR) into Scoreboard and display a user’s active MapRoulette tasks on their dashboard.
Subtasks
- [x] Decide on Semantics of what is a "campaign" on the frontend in MR terms; is it a challenge? a single task to complete?
- [x] Perform Gap Analysis between Scoreboard database schema and the MR api. Are any columns or tables missing or mismatched?
- [x] Add any database migrations to scoreboard, if any new columns or tables needed.
- [ ] Implement MR Task Manager classes (see tm_clock.js, tm.js for task manager abstraction)
- [ ] Update the user-facing UI to display MR data in Dashboard
- [ ] Update the admin UI to enable create/config of MR tasking manager
MapRoulette api docs https://maproulette.org/docs/swagger-ui/index.html?url=/assets/swagger.json
Decide on Semantics of what is a "campaign" on the frontend in MR terms; is it a challenge? a single task to complete?
Decision
After discussion and whiteboarding with @LanesGood , we decided that MapRoulette's Challenge entity is the appropriate level to source data from, into Scoreboard's Campaign entity.
Background
Scoreboard has, at a high level, the entities Tasker, Campaign and Assignments. Tasker is an abstraction for sourcing data from a concrete Tasking Manager instance.
Currently, Scoreboard can utilize Campaigns that originate from Projects in OpenStreetMap US Tasking Manager (tasks.openstreetmap.us). Some of the project data is cherry-picked and copied into the Scoreboard database, and also tm_id is used as a foreign key to the Task Manager's Project.
example project tm_id
Campaign <- tm_id (117) <- https://tasks.openstreetmap.us/project/117
Tasker can be extended to support additional Tasking Manager instances, for example:
- HOT Tasking Manager
- MapRoulette
- Other Tasking Managers...
MapRoulette has different terminology and different data model entities, so here are some concepts:
- MapRoulette Project: seems to be a grouping mechanism for a set of challenges created by an admin or power user. Almost like a Folder. Existing Projects have names like "[username]'s project". Note this is different than the OSM Tasking Manager's concept of a Project.
- MapRoulette Challenge: This is similar to an OSM Tasking Manager Project, but additionally it defines a generator for rule-based generation of mapping tasks. (Using a data file for new OSM elements, or a query expression for existing OSM elements)
- MapRoulette Task: tasks are auto-generated by the rules specified in the Challenge definition. There can be hundreds or thousands of tasks in a Challenge.
Therefore the MapRoulette Challenge appears to be the most appropriate entity to link the Scoreboard schema with the MapRoulette schema.
Perform Gap Analysis between Scoreboard database schema and the MR api. Are any columns or tables missing or mismatched?
Recommendation: Skip this
There are 86 tables (relations) in the Scoreboard database, and perhaps many more in the MR database and api. Reconciling them would be a big task and it also may not even make sense.
In practice I think any new Tasking Manager implementations in Scoreboard are going to cherry-pick only the desired properties from a Challenge/Project, and then store a link to the original so it's probably fine if fields or tables are missing or named differently in Scoreboard.
Add any database migrations to scoreboard, if any new columns or tables needed.
None identified so far.
Recommendation: If there are any database changes required, do this as needed as part of the next task (Implement MapRoulette Task Manager classes).
Here are some next steps for my PR #458
- Continue refactor of the TaskingManagerFactory class and implement the MapRouletteAPI class. The intent of the new Factory class is to make it possible to cleanly add not just MapRoulette API class but also other Tasking Managers in future.
- Fix broken tests in
api/tests/api/servicesand support new TaskingManagerFactory. - Add new tests for MapRouletteAPI.
- Update Admin UI and elsewhere in the app to use dynamically generated list of Tasking Manager types instead of hardcoded 'tm2', 'tm3', etc.
- Get a MapRoulette connection going and actually talk to the API! Continue development.
Updated integration plan:
- MapRoulette should be imported as a TaskingManager, as proposed above
- MapRoulette Challenge cards should be visible on the Campaigns page
- Users should be able to toggle between seeing TM Campaign cards and MR Challenge cards
- Unique MR Challenge pages should show users' stats: #tasks fixed, skipped, noted etc (need to determine whether these are surfaced in API)
- Team moderators should be able to assign MR challenges to users
- MR Challenges do not need to display AOI (but perhaps they still should for visual consistency?)
MR Challenges do not need to display AOI (but perhaps they still should for visual consistency?)
I believe MR itself displays the AOI with a clustering symbology, rather than a BBox. Ideally we could do the same.
@guidorice as we start on this work again, are there items that require opening a new ticket?
I responded to @LanesGood on Slack re: resource scheduling.
@jvntf @necoline can you determine what edit statistics are available per user for each MR challenge? Does the API expose the number of tasks completed/skipped/marked too hard by a user for that challenge?
@LanesGood This endpoint returns the tasks existing for each challenge and exposes a
status : 0 - Created, 1 - Fixed, 2 - False Positive, 3 - Skipped, 4 - Deleted, 5 - Already Fixed, 6 - Too Hard
priority: 0 - High, 1 - Medium, 2 - Low
review" 0 - Requested, 1 - Approved, 2 - Rejected, 3 - Assisted, 4 - Disputed
I don't see how to identify the user
@jvntf as mentioned, we still need to bring in the user data for each challenge. Is it possible to integrate the challenge leaderboards from this endpoint into the challenge page? I see that challengeId is an optional query.
@jvntf for user data extraction from OSMesa using MapRoulette hashtags, it looks like a changeset hashtag is available but optional. On a task for this challenge I see #maproulette #Kaart-MR-8968 in the changeset field in iD which would definitely be queryable in OSMesa However I see only Unmapped places in DRC #maproulette autopopulated in the changeset when editing in iD from this task - which is likely not queryable from OSMesa.
In the setup for a challenge on MapRoulette, users are presented with the following options:

And in the MR github, I see that this exists as an issue: https://github.com/osmlab/maproulette3/issues/178 and an open PR: https://github.com/osmlab/maproulette3/pull/849
cc/@guidorice
@jvntf below is one approach to a potential MapRoulette challenge page if this data is available. If we are able to connect the MapRoulette challenge changeset hashtag to an OSMesa query, we can also display the feature stats currently visible on all Tasking Manager campaign pages.
If the data from the user/leaderboard endpoint is the only data available, we can have the table headings display a user's score, tasksCompleted and avgTimeSpent - if we think this information is useful
.

@jvntf reviewing your comment above, I realize that the overall challenge task breakdown is still available
To recap available data, I see that we have:
- Challenge tasks
- Challenge leaderboard
- Challenge hashtag (optional)
This could allow the following tables for each challenge page:
- Challenge task status breakdown - a single row of values for these categories: [Skipped/Too Hard/Not an Issue/Fixed/Already Fixed]
- Challenge user leaderboard table - rows for each user's breakdown of: [Rank/Score/AvgTimeSpent/CompletedTasks]
- (if challenge hashtag exists in OSMesa) Feature table with per user breakdown of all feature data currently available for TM campaigns (Roads, Buildings, etc.)
Does the above look correct and feasible to you?
@LanesGood correct and feasible
Dev notes on how to do the above:
Revise #593 as:
Implement MapRouletteAPI.getProjectStats(id), MapRouletteAPI.getProjectUserStats(id)
On load of any /campaign -> if task manager has getProjectStats -> do that (challenge task status breakdown, undefined for Task Manager tasks)
if task manager has getProjectStats-> do that (challenge user leaderboard table, undefined for Task Manager tasks)
if has hashtag and hashtag is in OSMesa -> return feature table (will exist for TM tasks, may exist for MR tasks)
Frontend Refactor -> Parse returned data for available tables -> construct accordingly. As of now this section of the front end is more hardcoded than perhaps is necessary cc @necoline
@jvntf the updated mockup for the Scoreboard MapRoulette Challenge page:

@LanesGood thanks for update, one question -> in the case that osmesa stats exist for a MR challenge, the participants and total edits section will be relevant, should we include those in the Panel or drop them?
