Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Classification user groups individual stats #25

Merged
merged 7 commits into from
Sep 6, 2023

Conversation

yuenmichelle1
Copy link
Collaborator

Continuation of #24

What this PR introduces

  • Logic for /classifications/user_groups/:id for ?individual_stats_breakdown=true param
  • Slight change in user group project_contributions for response to include session_time along with project_id and count
  • Slight change in user group top_contributors for response to include session_time along with user_id and count

Designs found here:

https://www.figma.com/file/qbqbmR3t5XV6eKcpuRj7mG/Group-Stats?type=design&node-id=0-1&mode=design

More details can be found in API docs here:

https://github.com/zooniverse/eras/wiki/API-Callout-Examples#classificationsuser_groupsid

(If don't feel like clicking above ^) here are example responses:

GET /classifications/user_groups/1234?individual_stats_breakdown=true

{
  "group_member_stats_breakdown": [
    {
      "user_id": 1234,
      "count": 12,
      "session_time": 71.304,
      "project_contributions": [
        {
          "project_id": 593,
          "count": 12,
          "session_time": 71.304
        }
      ]
    }
  ]
}

GET /classifications/user_groups/1234?top_contributors=1

{
  "total_count": 12,
  "time_spent": 71.304,
  "active_users": 1,
  "project_contributions": [
    {
      "project_id": 593,
      "count": 12,
      "session_time": 71.304
    }
  ],
  "top_contributors": [
    {
      "user_id": 1234,
      "count": 12,
      "session_time": 71
    }
  ]
}

@yuenmichelle1 yuenmichelle1 marked this pull request as ready for review August 11, 2023 01:11
@yuenmichelle1 yuenmichelle1 force-pushed the classification-user-groups-individual-stats branch from bfd9dae to 483cd9c Compare August 25, 2023 21:30
Copy link
Member

@zwolf zwolf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@yuenmichelle1 yuenmichelle1 merged commit d0ec241 into main Sep 6, 2023
3 checks passed
@yuenmichelle1 yuenmichelle1 deleted the classification-user-groups-individual-stats branch September 15, 2023 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants