Skip to content

bug:Align Profile/Share Scoring with Stats Hint-Cost Logic #465

@nitinawari

Description

@nitinawari

Issue Description

The CTF app shows inconsistent user scores across endpoints because point calculation logic is not fully aligned before the challenge is completed.

/ctf/api/v1/stats treats hint penalties as a user-wide deduction by summing hints_cost across all UserChallengeProgress rows.

In profile/share flows, challenge completion and hint deduction logic was previously tied too closely to completed progress filtering, which can undercount hint penalties when hints were used on challenges that are not yet completed.

Because of this, the same user can see different total_points depending on where the score is viewed (stats vs public profile vs share card). This creates confusion and reduces confidence in score accuracy.

Why this is a problem

  • Users expect one consistent score everywhere.
  • Public profile/share cards can appear to “overstate” points compared to stats.

Expected behavior

  • All score surfaces should follow the same rule:
  • Completed challenge points are based on completed challenges.
  • Hint penalties are deducted from all progress rows where hints were used.
  • Resulting total_points should match across stats, profile, and share endpoints.

Scope of impact

  • Public profile API response
  • Share profile card scoring metadata
  • Any UI consuming those values for display\
point.mp4

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions