app.engine.socio_bee module

# noqa https://dreampuf.github.io/GraphvizOnline/#digraph%20G%20%7B%0A%20%20%20%20rankdir%3DTB%3B%0A%20%20%20%20%0A%20%20%20%20node%20%5Bshape%3Dbox%2C%20style%3Dfilled%2C%20fillcolor%3Dlightgray%5D%3B%0A%20%20%20%20edge%20%5Bfontsize%3D10%5D%3B%0A%0A%20%20%20%20start%20%5Blabel%3D%22Start%22%2C%20shape%3Dellipse%2C%20fillcolor%3Dlightgray%5D%3B%0A%20%20%20%20is1or2%20%5Blabel%3D%221st%20or%202nd%20Measure%3F%22%5D%3B%0A%20%20%20%20is2nd%20%5Blabel%3D%222nd%20Measure%3F%22%5D%3B%0A%20%20%20%20subseq%20%5Blabel%3D%22Subsequent%3F%22%5D%3B%0A%20%20%20%20evalTime%20%5Blabel%3D%22Eval%20Time%22%5D%3B%0A%20%20%20%20%0A%20%20%20%20case1%20%5Blabel%3D%22Case%201%22%2C%20shape%3Dparallelogram%2C%20fillcolor%3Dlightyellow%5D%3B%0A%20%20%20%20case2_1%20%5Blabel%3D%22Case%202.1%22%2C%20shape%3Dparallelogram%2C%20fillcolor%3Dlightyellow%5D%3B%0A%20%20%20%20case2_2%20%5Blabel%3D%22Case%202.2%22%2C%20shape%3Dparallelogram%2C%20fillcolor%3Dlightyellow%5D%3B%0A%20%20%20%20case3%20%5Blabel%3D%22Case%203%22%2C%20shape%3Dparallelogram%2C%20fillcolor%3Dlightyellow%5D%3B%0A%20%20%20%20case4_1%20%5Blabel%3D%22Case%204.1%22%2C%20shape%3Dparallelogram%2C%20fillcolor%3Dlightyellow%5D%3B%0A%20%20%20%20case4_2%20%5Blabel%3D%22Case%204.2%22%2C%20shape%3Dparallelogram%2C%20fillcolor%3Dlightyellow%5D%3B%0A%20%20%20%20case4_3%20%5Blabel%3D%22Case%204.3%22%2C%20shape%3Dparallelogram%2C%20fillcolor%3Dlightyellow%5D%3B%0A%20%20%20%20case4_4%20%5Blabel%3D%22Case%204.4%22%2C%20shape%3Dparallelogram%2C%20fillcolor%3Dlightyellow%5D%3B%0A%20%20%20%20default%20%5Blabel%3D%22Default%22%2C%20shape%3Dparallelogram%2C%20fillcolor%3Dlightyellow%5D%3B%0A%0A%20%20%20%20start%20-%3E%20is1or2%0A%20%20%20%20is1or2%20-%3E%20case1%20%5Blabel%3D%22Yes%22%5D%0A%20%20%20%20is1or2%20-%3E%20is2nd%20%5Blabel%3D%22No%22%5D%0A%20%20%20%20is2nd%20-%3E%20case2_1%20%5Blabel%3D%22Yes%2C%20%3C%20Global%22%5D%0A%20%20%20%20is2nd%20-%3E%20case2_2%20%5Blabel%3D%22Yes%2C%20%3E%3D%20Global%22%5D%0A%20%20%20%20is2nd%20-%3E%20subseq%20%5Blabel%3D%22No%22%5D%0A%20%20%20%20subseq%20-%3E%20evalTime%0A%20%20%20%20evalTime%20-%3E%20case3%20%5Blabel%3D%22%5B%3C%20Indiv%5D%22%5D%0A%20%20%20%20evalTime%20-%3E%20case4_1%20%5Blabel%3D%22%5B%3C%20Indiv%2C%20%3E%20Global%5D%22%5D%0A%20%20%20%20evalTime%20-%3E%20case4_2%20%5Blabel%3D%22%5B%3E%20Both%20Avgs%5D%22%5D%0A%20%20%20%20evalTime%20-%3E%20case4_3%20%5Blabel%3D%22%5B%3C%20Both%20Avgs%5D%22%5D%0A%20%20%20%20evalTime%20-%3E%20case4_4%20%5Blabel%3D%22%5B%3E%20Indiv%2C%20%3C%3D%20Global%5D%22%5D%0A%20%20%20%20evalTime%20-%3E%20default%20%5Blabel%3D%22Else%22%5D%0A%7D%0A

class app.engine.socio_bee.SocioBeeStrategy[source]

Bases: BaseStrategy

async calculate_points(externalGameId, externalTaskId, externalUserId, data=None)[source]

Score an event by comparing the user’s pace to the global average.

Until the task has enough history a flat basic award is granted (BasicEngagement). Once history exists, the user’s average time between tasks is compared to all users’ average and individual/global adjustment points are added or subtracted accordingly, returning the case name of the branch taken.

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.