Skip to main content
User ranking by the number of passed trainings is available as a part of gamification in Opigno Enterprise. Calculation rules:
  1. The ranking is calculated based on the number of successfully completed (passed) trainings.
  2. The average score is used as a secondary factor for the ranking calculation.
  3. Users associated with an ANONYMOUS scope are excluded from the ranking system.

PassedTrainingsRanking object

On the API level user ranking based on the passed trainings is represented by PassedTrainingsRanking data type.
ParameterTypeDescription
rankIntRequired. The user’s rank based on the number of passed trainings and an average score.
averageScoreFloatRequired. The average score obtained by the user for all completed (passed and failed) trainings.
passedTrainingsNumberIntRequired. The number of the trainings successfully passed by the user associated with the context.
completedTrainingsNumberIntRequired. The number of the trainings completed by the user associated with the context.

Retrieve the ranking

UserContext API object contains property passedTrainingsRanking. Also, ranking can be retrieved by calling the getUserPassedTrainingsRanking query. It has one optional argument - userContextId. If it’s not set, the current API user context will be used by default. The query returns a PassedTrainingsRanking object as a response.
  query getUserPassedTrainingsRanking {
    getUserPassedTrainingsRanking {
      rank
      averageScore
    }
  }