Get next question
The questions appear for both battle rivals in the same order and can be retrieved one by one, by execution ofgetNextBattleQuestion query.
Like in case of a challenge, battle questions will be returned not as iframe, but as a
ChallengeQuestion object.
The question form should and the answer submission should be implemented on the frontend.Submit the answer
To submit a battle answer, execute thesaveBattleQuestionAnswer mutation.
It has one argument - answerData:
Here is an example of the mutation execution:
BattleQuestionAnswer object will be returned.
When the answer for the last question is submitted, a battle attempt will be automatically closed,
and the user will be able to check their results.
BattleQuestionAnswer object
A question answer is represented in Opigno Enterprise API as a BattleQuestionAnswer object:
Terminate battle attempt
Battles designed the same way as challenges, and all questions must be answered in a single attempt, without possibility to stop and resume it later. In this flow, a battle attempt should be terminated immediately if the user leaves the question page. To do this, execute theterminateBattleAttempt mutation.
Use
extraTimeSpent parameter to add an extra time (in seconds) to the general time that the current API user spent on the given battle.