new ChallengeInstance(instanceId, configId)
ChallengeInstance object.
Parameters:
Name | Type | Description |
---|---|---|
instanceId |
string | Challenge instance ID |
configId |
string | Challenge configuration ID |
Methods
-
getConfigId() → {string}
-
Return the challenge configuration identifier of the instance (challengeConfigId).
Returns:
Challenge configuration ID
- Type
- string
-
getDetails(parameters, handlers)
-
Get details of the challenge.
Parameters:
Name Type Description parameters
object key/value pair of query string parameters
handlers
module:Scoreflex.SDK.Handlers request callbacks
-
getInstanceId() → {string}
-
Return the challenge instance identifier (challengeInstanceId).
Returns:
Challenge instance ID
- Type
- string
-
getPlayers(parameters, handlers, noCache)
-
Request challenge players and call the onload handler with a list of Player.
Parameters:
Name Type Description parameters
object key/value pair of query string parameters
handlers
module:Scoreflex.SDK.Handlers request callbacks
noCache
boolean if true, bypass the local cache
-
getTurns(parameters, handlers)
-
Get turn details of a challenge instance.
Parameters:
Name Type Description parameters
object key/value pair of query string parameters
handlers
module:Scoreflex.SDK.Handlers request callbacks
-
showDetails(parameters, options)
-
Display a web client with the details of a challenge instance.
Parameters:
Name Type Description parameters
object key/value pair of query string parameters
options
object key/value pair of WebClient options
-
submitTurn(turnBody, parameters, handlers)
-
Generic function to submit a challenge player's turn.
Parameters:
Name Type Description turnBody
object parameters
object key/value pair of query string parameters
handlers
module:Scoreflex.SDK.Handlers request callbacks
- Source:
- To Do:
-
- set link to challenge's turns documentation
-
submitTurnScore(score, parameters, handlers)
-
Specialized function to submit a challenge player's turn with score only.
Parameters:
Name Type Description score
int raw score
parameters
object (facultative, the score metadata) 'meta':{string}
handlers
module:Scoreflex.SDK.Handlers request callbacks