Skip to main content
In order to boost learner motivation, increase engagement and make educational experience more enjoyable and effective, Opigno Enterprise provides endpoints to implement challenges on your learner area. Challenges is a part of gamification. Every challenge is a set of time-limited questions that can optionally include bonus points for speed. Challenges can be created in the backoffice by administrators or content editors, and then be retrieved and processed with the API endpoints.
Challenges can not be accessed by user contexts that are not associated with any scope.

Challenge API object

Challenge object represents a single challenge data:
ParameterTypeDescription
attemptChallengeAttemptOptional. The challenge attempt (if it has already been taken by the current API user).
bonusPointsEnabledBooleanRequired. Indicator of bonus points that can be earned for the fast answer.
ctaCtaOptional. Contains the list of challenge Call To Action objects for the current API user.
descriptionStringRequired. A challenge description. Contains an HTML markup.
endDateIntRequired. The timestamp when a challenge ends. The challenge will not be available for completion after this time.
idIDRequired. A challenge ID.
imageMediaImageOptional. A challenge image data.
isRankingEnabledBooleanRequired. A marker to indicate if the ranking and leaderboard displaying is enabled for the challenge.
maxChallengeRankIntOptional. The max rank in the challenge. The value will be empty if the ranking and leaderboard displaying is not enabled for the challenge.
participantsNumberIntRequired. The number of users who took part in the challenge and completed it.
questionsNumberIntRequired. The total number of questions in a challenge.
startDateIntRequired. The timestamp when a challenge starts. The challenge will not be available for completion before this time.
statusChallengeStatusOptional. The challenge status for the current API user (completed/ongoing/upcoming). If empty, the challenge is already finished and missed by the user.
titleStringRequired. A challenge title.

Challenge CTA

The list of available CTAs can differ depending on the challenge status.
Action IDDescriptionCorresponding mutation/query
CREATE_CHALLENGE_ATTEMPTAllows to create a challenge attempt for the current API user. Available if the challenge is not started yet.createChallengeAttempt
VIEW_CHALLENGEAllows to access a challenge information.getChallenge
VIEW_CHALLENGE_RESULTSAllows to view a challenge results. Available when the challenge attempt is completed.getChallengeResult

Retrieve a challenge from API

To retrieve a single challenge data, execute the getChallenge query. The query has one incoming argument - challengeId and returns a Challenge object if the current API user have an access to view the requested entity.
query getChallenge {
  getChallenge(challengeId: 1) {
    title
    description
    image {
      alt
      title
      url
    }
    questionsNumber
    startDate
    endDate
    bonusPointsEnabled
    participantsNumber
    maxChallengeRank
    isRankingEnabled
    status
    cta {
      actionId
      title
      arguments {
        key
        value
      }
    }
  }
}