> ## Documentation Index
> Fetch the complete documentation index at: https://docs.opigno.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get challenge results

Once the challenge attempt completed, the user retrieve their result by calling the `getChallengeResult` query.
The query returns a [`ChallengeAttempt`](/OpignoEnterpriseAPI/Challenge/TakeChallenge/#challenge-attempt) object in the response:

<CodeGroup>
  ```filename GraphQL theme={null}
  query getChallengeResult {
    getChallengeResult(challengeId: 1) {
      score
      completedOn
      rank
      timeSpent
      higherThanScorePercentage
    }
  }
  ```

  ```File Query result [expandable] theme={null}
  {
    "data": {
      "getChallengeResult": {
        "score": 80,
        "completedOn": 1771193604,
        "rank": 3,
        "timeSpent": 93,
        "higherThanScorePercentage": 65,
      }
    }
  }
  ```
</CodeGroup>

## Ranking calculation

If the ranking displaying disabled in the challenge, it will not be returned in API responses.

Ranking is calculated based on the earned score which depends on the number of correct answers,
and (if bonus points enabled for the challenge) on the time that is spent on each answer.

If N users have the same score they will have the same ranking (R), the next user with a lower score will have rank (R+N).

## Related Features

<CardGroup cols={2}>
  <Card title="Authentication" icon="key" href="/OpignoEnterpriseAPI/ConsumerUserAuthentication">
    Understand the authentication requirements and how to properly authenticate your requests.
  </Card>
</CardGroup>
