Trivia Scores
Calculates rank based on score and user names by looping through collected information.
When to use?
When you want to present the score for each player at the end of game of trivia quiz.
How to use:
- Make sure you've got an indexed array containing player names and their scores
- In the players field enter name of the the array, like this:
${players}
- In the Status variable name enter the name under which you'll be able to access player name, score, rank etc., for example: status
- In the Name field enter the name of the name field in the players array, for example: name
- In the Score field enter the name of the score field in the players array, for example: score
- The element has three containers - single, multiple and all
- You can put any amount of elements in both of them
- The single container will trigger when players have a unique score/rank
- The multiple container will trigger when players share a score/rank
- The all container will trigger when all players have the same score/rank (there has to be multiple users)
- You can access player names in the multiple/all container by using status variable name(in this example it's 'status') and an array key called 'names', like this:
${status.names}
- You can access player name in the the single container like this:
${status.name}
- To access player/s rank use this:
${status.rank}
- You can access player/s score like this:
${status.score}
- To check for the first place player/s use this:
${status.first}
- To check for the last place player/s use this:
${status.last}
Example of usage
We created a two-dimensional array in this format:
players[index]["name"]
players[index]["score"]
Component properties configuration example:
- players:
${players}
- Status variable name: status
- Name field: name
- Score field: score