Page MenuHomePhabricator

Add leaderboard based on user's edits using Commons Android app
Closed, ResolvedPublic

Description

About

The Wikimedia Commons Android app allows users to upload pictures from their Android phone/tablet to Wikimedia Commons. Commons is not only the image repository for Wikipedia, but an independent project that seeks to document the world with photos, videos and recordings.

Project

Github link: https://github.com/commons-app/apps-android-commons/issues/2074

Commons Android App Repo (for UI): https://github.com/commons-app/apps-android-commons/
Commons Misc Repo(for APIs): https://github.com/commons-app/commonsmisc

The project is about adding a leaderboard based on user's edits using Commons. The feature will include only edits made with the mobile app, and users who have shown interest in this activity.

Project schedule:

  1. Update UI of achievements activity to display level (current activity) in first tab and Leaderboard in second tab (based on uploads).
  2. Designing and implementing the APIs for calculating and displaying ranks of the User (all time, monthly, weekly). These would be Python APIs in commons-misc repo.
  3. Display user's Avatar and rank on Leaderboard screen fetched from API.
  4. Designing and implementing the APIs for displaying leaderborad (user list) based on 2 parameters - duration (all time, monthly, weekly), type (uploads, nearby, images used).
  5. Use the APIs to fetch leaderboard (user list) based on uploads via mobile app (all time) and display it in Leaderboard screen.
  6. Add pagination in the leaderboard screen to load more users on scrolling down.
  7. Add duration filters in leaderboard screen and show results based on selected filter (weekly, monthly, yearly, all time). Change the UI to show and select filter.
  8. Change the UI to show 3 different results (based on uploads, nearby, used). - add 2 more tabs
  9. Tapping the name of a user in the leaderboard should open the gallery of that user's pictures, probably as a browser URL for now.
  10. Write unit tests , documentation, fix bugs and Release (at least in alpha) - (2 weeks)
  11. If time permits, Add option for users to change Avatar, Store user's Avatar in cache for a month.

Idea

The score could reuse some numbers from achievements, but should only count edits done with the mobile app, because otherwise Vicuna/etc users will dominate the top of the leaderboard even if they don't use the mobile app.

Actually, I suggest listing in the leaderboard only the users who have ever opened the achievements activity. We must keep track of that information server-side. So the leaderboard would only list app users who have an interest in this kind of game.

Tapping the name of a user in the leaderboard should open the gallery of that user's pictures, probably as a browser URL for now. Knowing they are being watched by their peers will probably reduce the temptation to "cheat" (for instance by uploading 1000 pictures of the same spoon)

The user's name should be highligthed. Random idea: The length of the leaderboard could be dynamic, for instance if I am 3rd it could be 10 people, but if I am 13rd it could be 20 people. Or just make more people appear when scrolling down.

There could be weekly (last 30 days) rankings, yearly (last 365 days) rankings, all-time rankings.

To make it more visually attractive, I suggest using as a kind of avatar the user's most successful picture (the one which is used the most in the wikipedias/etc, or a random one if the user's pictures are not used yet anywhere). Random idea: Users like to personalize their avatar, so we could also offer the option to select one of the user's uploads as an avatar picture, but that may lead to more selfies, so this option could be an privilege to unlock (only users who are above level 5 for instance).

There is a lot of data to show, so we have to think the UI carefully. Here is just an idea:

53636749-94104080-3c64-11e9-90f1-f399dc8ff83f.png (877×904 px, 34 KB)

The vegetable is a placeholder for the user's avatar.
I forgot to write the position number (1, 2, 3, etc). It is important because I want to know whether I climbed from 37th to 36th, and counting is boring.

UI Mocks

58955017-66cdb400-87b8-11e9-8e3d-6bc79f7c3445.png (2×1 px, 164 KB)

58759956-8e6e1380-854f-11e9-95ca-5f3a69795ced.png (2×1 px, 90 KB)

Implementation

The leaderboard lists should probably be calculated on the server where we currently perform achievement calculations, and cached (re-serve the same results if less old than 1 hour). The user will probably upload a few more pictures in 5 minutes and come see the leaderboard again. So we could recalculate only that user's new scores (and let the other people's scores the same until the next hour comes). In other words, only the users who keep looking at the leaderboard would have their score grow at smaller intervals than 1 hour. That 1-user-only recalculation itself should be cached something like 1 minute because a picture can not be neatly uploaded in less time, and to avoid useless server load.

The avatar miniatures (generated by mediawiki) should be cached by the app for like a month.

How should the user start showing up in the leaderboard?

Automatically when the user performs one of the actions. We can automatically add the user in the leaderboard, once he performs any of these actions

  • login
  • or upload
  • or nearby upload

In our backend, we are planning to have:

  • a list of users(with option 1 or 2) for whom we need to calculate statistics
  • periodically fetch the statistics (every 1 or 4 hours). Update the statistics in our tools forge DB
  • When the Commons app does an API call to get leaderboard info, serve the statistics using tools forge DB instead of calculating real-time.

Skills required

  • Android SDK
  • Android UI design
  • Understanding of RxJava
  • Basic knowledge of Wikimedia APIs
  • Familiarity with Python
  • Unit testing for Android

Nice to have skills

  • Familiarity with Kotlin
  • Retrofit

Mentor(s)

@maskaravivek and @Nicolas_Raoul

Get started

Event Timeline

@maskaravivek Is there anything remaining in the project to do before this task can be closed?

Ignore my previous comment, just recalled we couldn't make progress on this project via the previous round. @maskaravivek @Ujjwalagrawal17 would you two be interested in mentoring/promoting this project via GSoC 2020 or Outreachy Round 20?

@srishakatux I have pinged my other team members. I will comment here once I hear back from them.

I checked with @josephine_l and @Ashishkumar468 and they are fine with having this as GSoC project this year.

@srishakatux Should I add it to the GSoC 2020 phabricator board?

PS: There would be some changes to the project description. I will update the task summary in a couple of days.

@maskaravivek yay :) please update the project description as soon as you can!

@Nicolas_Raoul This is a friendly reminder to sign up as a co-mentor for this project on the Outreachy Website. :)

srishakatux changed the visibility from "acl*outreachy-mentors (Project)" to "Public (No Login Required)".Mar 5 2020, 6:17 PM

Hello everyone!!
Actually i was just filling out final application for outreachy and it has a section for community specific questions. Could you please confirm is there any additional information i need to provide in it?

@318anushka: Whatever is written on https://www.mediawiki.org/wiki/Outreachy/Participants#Application_process_steps should be followed, I'd say. :)

(The comment does not seem to be related to the topic of this specific proposal but a general question about any Outreachy projects, so it might be better asked in Zulip.)

@318anushka You are probably referring to the application form you will be submitting on the Outreachy site. There aren't any community-specific questions, and you can leave that field blank.