app.engine.constantEffortStrategy module¶
- class app.engine.constantEffortStrategy.ConstantEffortStrategy[source]¶
Bases:
BaseStrategy- async calculate_points(externalGameId, externalTaskId, externalUserId, data=None)[source]¶
Award points for sustained effort within a rolling time window.
If the user already has measurements in the last
variable_constant_effort_interval_minutesminutes, the award scales with how consistent they have been (ConstantEffortReward); otherwise a flat basic point is granted (BasicReward).- Parameters:
externalGameId – External identifier of the game.
externalTaskId – External identifier of the task.
externalUserId – External identifier of the user.
data – Optional event payload (unused by this strategy).
- Returns:
tuple[int, str] – The points to award and the case name describing which branch produced them.