Page MenuHomePhabricator

Add leaderboard based on user's edits using Commons Android app
Open, Needs TriagePublic

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:

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

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

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 1 2019, 7:34 PM
maskaravivek updated the task description. (Show Details)Mar 1 2019, 7:35 PM
maskaravivek updated the task description. (Show Details)Mar 1 2019, 7:39 PM

@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!

maskaravivek updated the task description. (Show Details)Jan 25 2020, 5:48 PM
srishakatux removed a project: Outreachy Mentors.
srishakatux changed the visibility from "Public (No Login Required)" to "Outreachy Mentors (Project)".
srishakatux removed subscribers: Kbhardwaj13, Aroravanshika.
Pavithraes added a comment.EditedFeb 24 2020, 8:31 PM

@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 "Outreachy Mentors (Project)" to "Public (No Login Required)".Mar 5 2020, 6:17 PM
maskaravivek updated the task description. (Show Details)Mar 8 2020, 12:12 AM

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?

Aklapper added a comment.EditedApr 5 2020, 2:08 PM

@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.

yeah right @srishakatux, Thanks a lot!!