components.UserScore¶
- class components.UserScore¶
Bases:
components.picklablebase.PicklableBase
The high score of a single user. Keeps track of their game stats.
components.UserScore
instances are subscriptable: For each dateday
,score[day]
is acomponents.Score
instance with the number of answers and correct answers given by the user on that day. To add values,add_to_score()
should be the preferred method.- add_to_score(answers, correct, date=None)¶
Adds the given answers to the score of the given date.
- property months_score: components.score.Score¶
The overall score, that the user achieved during the current month.
- Return type
- property overall_score: components.score.Score¶
The overall score of the user.
- Return type
- property todays_score: components.score.Score¶
Gives the score, that the user achieved today.
- Return type
- property weeks_score: components.score.Score¶
The overall score, that the user achieved during the current week.
- Return type
- property years_score: components.score.Score¶
The overall score, that the user achieved during the current year.
- Return type