Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6215181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:00:31+00:00 2026-05-24T07:00:31+00:00

I am developing a little game (I’m using Play! framework ). In this game,

  • 0

I am developing a little game (I’m using Play! framework).

In this game, the players answer technical questions, and win points when they answer correctly.
In addition to that, they may win some awards, which give additional points.
This is similar to the SO badges, except that the player wins points for that awards.

I am wondering what is the best way to store user score and the history of them, especially since I want to be able to display “Top player” for last week, for last month, etc.?
These “tops” will be similar to the “Week reputation ranking in SO” (ex: https://stackoverflow.com/users?tab=reputation&filter=week)

Today, I have:

  • A User entity, where I have a score attribute, which stores the current score of the user;
  • A QuestionHistory entity, where I put every question answered by the user, which has the following properties: user, answeredOn, correctAnswer, etc. (I can add a pointsAwarded, but for the moment, all questions give the same amount of points).

Thanks to QuestionHistory entity, I am able to calculate the score won by one player for a given time period.
However, it will not include the score received by the awards.

I was thinking of replacing the QuestionHistory entity by another entity, for example UserActivity, which will store any activity for this user:

  • when he answers a question, with the result;
  • when the player submit a new question;
  • when he wins an award;
  • etc.

The structure of this entity may look like:

@Entity
public class PlayerActivity extends Model {

    public User user;
    public Date activityDate;
    public ActivityType type; // Define the type of activity: "QUESTION_ANSWERED", "AWARD_RECEIVED", "QUESTION_SUBMITTED", etc.
    public int score; // Points won by this activity.

}

With such entity, I would be also able to display an activity history like the one provided on SO site (ex: https://stackoverflow.com/users/22656/jon-skeet?tab=activity)

What do you think of that new proposition, or is there a smater way of doing that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T07:00:32+00:00Added an answer on May 24, 2026 at 7:00 am

    I think this is definitely a better way to calculate the points, as you are managing events and you are “future proof” in case you want to extend the activities that reward users.

    Yes, probably you may find more convoluted designs to do this. But the one you propose is simple and it works, so… go for it 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing a little snake game written in C++ and using SFML 2D library.
For a school project we're developing a game that's a little like Conway's game
I am using VS 2008 WebDeveloper Express edition. And i'm developing a little aplication,
I am currently interested in game developing. I know a little bit of C#
I'm developing a little script using ash shell (not bash). Now i have a
I'm developing a little game. I use the following code to detect the keys
Currently I'm developing a game in which I've an imageView which I'm scaling little
I'm developing a little Twitter application on iOS 5. I'm using Twitter and Accounts
I'm developing a little game (test) for Android, but I don't understand the logic
My friend and I are developing a little game and we want to share

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.