bitnampham / testwiki

0 stars 0 forks source link

Apply feedback #201 #1

Open bitnampham opened 2 months ago

bitnampham commented 1 month ago

In reference to https://github.com/lifemax/i2unet.com/issues/146

Could you tell me summary how we change them?

When start match category

There are no rating changes

When start a match

There are no rating changes

When finish a match

In https://github.com/lifemax/i2unet.com/issues/146

試合終了 - Match Ended - Button

Spec: https://github.com/lifemax/i2unet.com/issues/146 ※ use calculateEloRating() function and old data to calculate new rating $rating1 = result_singles.rating_1_pre $rating2 = result_singles.rating_2_pre $score1 = Set to 0 or 1 based on the win_flag of the newly edited data $kFactor = ($win_user_point_sum - $lose_user_point_sum) (newRating, newOrgRating) = calculateEloRating($rating1, $rating2, $score1, $kFactor)

試合終了 - Match Ended - Button - When edit a match after finished

Spec: https://github.com/lifemax/i2unet.com/issues/146 ※ use calculateEloRating() function and old data to calculate new rating $rating1 = result_singles.rating_1_pre $rating2 = result_singles.rating_2_pre $score1 = Set to 0 or 1 based on the win_flag of the newly edited data $kFactor = ($win_user_point_sum - $lose_user_point_sum) (newRating, newOrgRating) = calculateEloRating($rating1, $rating2, $score1, $kFactor)

Note : For matches with flag=9, we update ratings based on the previous match results. For matches with flag=0, 2, 5, we use the results from the last match that has flag=9 to update the ratings. Ex :


> result_singles 1 試合終了(flag=9)   match_end_time at 10:00
> result_singles 2 試合終了(flag=9)   match_end_time at 10:10
> result_singles 3 試合終了(flag=9)   match_end_time at 10:20
> result_singles 4 試合終了(flag=9)   match_end_time at 10:30
> result_singles 5 試合中(flag=5)
> result_singles 6 試合前(flag=2 or 0)

If organizer edit result_singles2 score
result_singles 1 → not change
result_singles 2 → rating_after = new result_singles 2.rating_after
result_singles 3 → rating_pre = result_singles 2.rating_after AND rating_after = new result_singles 3.rating_after
result_singles 4 → rating_pre = result_singles 3.rating_after AND rating_after = new result_singles 4.rating_after
result_singles 5 → rating_pre =  result_singles 4.rating_after
result_singles 6 → rating_pre =  result_singles 4.rating_after

不戦敗 - Lose by Default - Button

When finish match category

There are no rating changes

Note

「試合終了」ボタンを押すだけで、レーティングはuser_profile に保存されます。

swiss_score behavior

2024/06/20 plz check swiss_score behavior also

In https://github.com/lifemax/i2unet.com/issues/146

  1. Calculate swiss_score: abs( (user1_win - user1_lose in the event) - (user2_win - user2_lose in the event) )

  2. Get user_id_1 player win and lose count:

  1. Search result_singles:

    (user_id_1={user_id_1 of current data} OR user_id_2={user_id_1 of current data})
    AND 
    (result_singles.flag=0 OR result_singles.flag=2)
    AND 
    result_singles.event_id={current event.id}
    AND 
    result_singles.event_match_category_id={current category id}
  2. Update swiss_score:

  1. Repeat the same process for user_id_2 player