Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate a JSON tracker for player activities during game sessions #238

Open
franciscastro opened this issue Apr 7, 2022 · 5 comments
Open
Assignees
Labels
android game player Issues related to the player of the game logging

Comments

@franciscastro
Copy link
Contributor

Create a JSON file gamePlayLog.json that tracks all player activities for a session. gamePlayLog.json will get updated for all player actions on the app -- e.g., joining a game, movement from one state to the next, etc.

Updates to this JSON file will primarily be appends of player actions, formatted according to the specifications indicated in the GameInfo.kt utility class.

This JSON file works in tandem with playerTracker.json. While playerTracker.json will only store the current players in a session and will update those player records, gamePlayLog.json will append all player actions to generate a history track of player events.

An example snapshot for contents of gamePlayLog.json is as follows:

[
{
name: allison1
Team: 1
Player: 1
currState: 1
currTransition: 1
timeEnterState: 00:00
prevTransAnswer: null
},
{
name: allison1
Team: 1
Player: 1
currState: 2
currTransition: 2
timeEnterState: 00:05
prevTransAnswer: “dogs”
},
{
name: allison1
Team: 1
Player: 1
currState: 3
currTransition: 3
timeEnterState: 00:10
prevTransAnswer: “cats”
},
{
name: allison2
Team: 1
Player: 1
currState: 3
currTransition: 3
timeEnterState: 00:10
prevTransAnswer: “cats”
}
]

@franciscastro franciscastro added logging game player Issues related to the player of the game android labels Apr 7, 2022
@franciscastro franciscastro added this to the Winter 22 milestone Apr 7, 2022
@franciscastro franciscastro self-assigned this Apr 7, 2022
@apoh3
Copy link

apoh3 commented Apr 19, 2022

Example:

[{"name":"Allison","guest":true,"gamePin":"12","team":"1","player":"1","currState":"state_1","currTransition":"trans_1","timeEnterState":"2022-04-19T18:03:34.754Z","timeExitApp":""},{"name":"Allison","guest":true,"gamePin":"12","team":"1","player":"1","currState":"state_2","currTransition":"trans_2","timeEnterState":"2022-04-19T18:04:03.990Z","timeExitApp":"","prevTransAnswer":"RD"},{"name":"h","guest":true,"gamePin":"12","team":"1","player":"1","currState":"state_1","currTransition":"trans_1","timeEnterState":"2022-04-19T18:13:32.753Z","timeExitApp":""},{"name":"h","guest":true,"gamePin":"12","team":"1","player":"1","currState":"state_2","currTransition":"trans_2","timeEnterState":"2022-04-19T18:13:34.275Z","timeExitApp":"","prevTransAnswer":"BL"},{"name":"z","guest":true,"gamePin":"12","team":"1","player":"1","currState":"state_1","currTransition":"trans_1","timeEnterState":"2022-04-19T18:15:04.634Z","timeExitApp":""},{"name":"z","guest":true,"gamePin":"11","team":"1","player":"1","currState":"state_1","currTransition":"trans_1","timeEnterState":"2022-04-19T18:15:26.981Z","timeExitApp":""},{"name":"z","guest":true,"gamePin":"11","team":"1","player":"1","currState":"state_1","currTransition":"trans_1","timeEnterState":"2022-04-19T18:15:31.861Z","timeExitApp":"","prevTransAnswer":"BL"},{"name":"z","guest":true,"gamePin":"11","team":"1","player":"1","currState":"state_1","currTransition":"trans_1","timeEnterState":"2022-04-19T18:15:37.246Z","timeExitApp":"","prevTransAnswer":"BL"},{"name":"z","guest":true,"gamePin":"11","team":"1","player":"1","currState":"state_1","currTransition":"trans_1","timeEnterState":"2022-04-19T18:15:38.414Z","timeExitApp":"","prevTransAnswer":"BL"},{"name":"z","guest":true,"gamePin":"11","team":"1","player":"1","currState":"state_1","currTransition":"trans_1","timeEnterState":"2022-04-19T18:15:38.612Z","timeExitApp":"","prevTransAnswer":"BL"},{"name":"z","guest":true,"gamePin":"11","team":"1","player":"1","currState":"state_1","currTransition":"trans_1","timeEnterState":"2022-04-19T18:15:38.812Z","timeExitApp":"","prevTransAnswer":"BL"},{"name":"z","guest":true,"gamePin":"11","team":"1","player":"1","currState":"state_1","currTransition":"trans_1","timeEnterState":"2022-04-19T18:15:39.013Z","timeExitApp":"","prevTransAnswer":"BL"},{"name":"z","guest":true,"gamePin":"11","team":"1","player":"1","currState":"state_1","currTransition":"trans_1","timeEnterState":"2022-04-19T18:15:39.212Z","timeExitApp":"","prevTransAnswer":"BL"},{"name":"z","guest":true,"gamePin":"11","team":"1","player":"1","currState":"state_2","currTransition":"trans_2","timeEnterState":"2022-04-19T18:15:40.001Z","timeExitApp":"","prevTransAnswer":"GR"},{"name":"A","guest":true,"gamePin":"12","team":"1","player":"1","currState":"state_1","currTransition":"trans_1","timeEnterState":"2022-04-19T18:18:11.714Z","timeExitApp":""},{"name":"A","guest":true,"gamePin":"12","team":"1","player":"1","currState":"state_1","currTransition":"trans_1","timeEnterState":"2022-04-19T18:18:13.621Z","timeExitApp":"","prevTransAnswer":"BL"},{"name":"A","guest":true,"gamePin":"12","team":"1","player":"1","currState":"state_1","currTransition":"trans_1","timeEnterState":"2022-04-19T18:18:15.449Z","timeExitApp":"","prevTransAnswer":"BL"},{"name":"A","guest":true,"gamePin":"12","team":"1","player":"1","currState":"state_2","currTransition":"trans_2","timeEnterState":"2022-04-19T18:18:20.243Z","timeExitApp":"","prevTransAnswer":"RD"},{"name":"A","guest":true,"gamePin":"12","team":"1","player":"1","currState":"state_2","currTransition":"trans_2","timeEnterState":"2022-04-19T18:18:25.089Z","timeExitApp":"","prevTransAnswer":"RD&GR"},{"name":"A","guest":true,"gamePin":"12","team":"1","player":"1","currState":"state_2","currTransition":"trans_2","timeEnterState":"2022-04-19T18:18:29.708Z","timeExitApp":"","prevTransAnswer":"RD&GR&BK"},{"name":"A","guest":true,"gamePin":"12","team":"1","player":"1","currState":"state_3","currTransition":"trans_3","timeEnterState":"2022-04-19T18:18:35.613Z","timeExitApp":"","prevTransAnswer":"BK&BL"},{"name":"A","guest":true,"gamePin":"12","team":"1","player":"1","currState":"state_3","currTransition":"trans_3","timeEnterState":"2022-04-19T18:18:39.577Z","timeExitApp":"","prevTransAnswer":""},{"name":"A","guest":true,"gamePin":"12","team":"1","player":"1","currState":"state_3","currTransition":"trans_3","timeEnterState":"2022-04-19T18:18:42.127Z","timeExitApp":"","prevTransAnswer":"dog"},{"name":"A","guest":true,"gamePin":"12","team":"1","player":"1","currState":"state_3","currTransition":"trans_3","timeEnterState":"2022-04-19T18:18:45.578Z","timeExitApp":"","prevTransAnswer":"neow"},{"name":"A","guest":true,"gamePin":"12","team":"1","player":"1","currState":"state_4","currTransition":"trans_4","timeEnterState":"2022-04-19T18:18:50.127Z","timeExitApp":"","prevTransAnswer":"cat"},{"name":"A","guest":true,"gamePin":"12","team":"1","player":"1","currState":"state_4","currTransition":"trans_4","timeEnterState":"2022-04-19T18:18:52.813Z","timeExitApp":"","prevTransAnswer":"RD"},{"name":"A","guest":true,"gamePin":"12","team":"1","player":"1","currState":"state_4","currTransition":"trans_4","timeEnterState":"2022-04-19T18:18:53.383Z","timeExitApp":"","prevTransAnswer":"GR"},{"name":"A","guest":true,"gamePin":"12","team":"1","player":"1","currState":"state_4","currTransition":"trans_4","timeEnterState":"2022-04-19T18:18:54.467Z","timeExitApp":"","prevTransAnswer":"BK"},{"name":"A","guest":true,"gamePin":"12","team":"1","player":"1","currState":"state_5","currTransition":"trans_5","timeEnterState":"2022-04-19T18:18:55.473Z","timeExitApp":"","prevTransAnswer":"BL"},{"name":"A","guest":true,"gamePin":"12","team":"1","player":"1","currState":"state_6","currTransition":"trans_6","timeEnterState":"2022-04-19T18:18:58.725Z","timeExitApp":"","prevTransAnswer":"GR&RD&BK"},{"name":"A","guest":true,"gamePin":"12","team":"1","player":"1","currState":"state_6","currTransition":"trans_6","timeEnterState":"2022-04-19T18:19:06.789Z","timeExitApp":"","prevTransAnswer":"GR&GR"},{"name":"A","guest":true,"gamePin":"12","team":"1","player":"1","currState":"state_6","currTransition":"trans_6","timeEnterState":"2022-04-19T18:19:11.376Z","timeExitApp":"","prevTransAnswer":"BL&BL&BL"},{"name":"A","guest":true,"gamePin":"12","team":"1","player":"1","currState":"state_7","currTransition":"trans_7","timeEnterState":"2022-04-19T18:19:14.765Z","timeExitApp":"","prevTransAnswer":"BL&BL"},{"name":"A","guest":true,"gamePin":"12","team":"1","player":"1","currState":"state_7","currTransition":"trans_7","timeEnterState":"2022-04-19T18:19:16.697Z","timeExitApp":"","prevTransAnswer":"a"},{"name":"A","guest":true,"gamePin":"12","team":"1","player":"1","currState":"state_7","currTransition":"trans_7","timeEnterState":"2022-04-19T18:19:19.515Z","timeExitApp":"","prevTransAnswer":"🍎"}]

@apoh3
Copy link

apoh3 commented May 3, 2022

Updated/Added Logging Fields:

name
The player's name is either the name they inputted as a guest or the username they inputted with an account during login.

guest
If the player is a guest then this field is true. Otherwise it's false.

gamePin
Value inputted by player in MainActivity.

team
The team number selected by the player in ChooseTeamActivity.

player
The player number selected by the player in ChooseTeamActivity.

currState
The state currently visible to the player.

currTransition
The transition currently visible to the player.

prevTransAnswer
The answer to the previous transition. For example, if the current state is state 2 then prevTransAnswer is the answer to state 1 (assuming linear game: start -> state 1 -> state 2).

currTransAnswer
The input to the current transition at the time of a logged interaction. There are two cases: 1) the player clears the response (currTransAnswer = answer right before clearing, and 2) the player inputs a wrong answer and the game does not have a wrong answer transition.

interactionType
The interaction that triggered logging: clearButton, submitButton, backButton, or colorButtonPress.

interactionTime
The timestamp of when the interaction happened (i.e. when the log is created).

timeEnterState
The timestamp of when the current state was entered. If multiple interactions happen within one state, all logs for that one state will have the same currStateStartTime.

timeExitApp
The timestamp of when the user leaves the game.

@apoh3
Copy link

apoh3 commented May 3, 2022

Log file is deleted from device after 2 hours of the app being closed. This should give enough time for the log data to be transmitted to the server and database.

@apoh3
Copy link

apoh3 commented May 17, 2022

Added new field to logs:

prevTransType
The type of the previous transition. For example, if the current state is state 2 then prevTransType is the type of state 1 (assuming linear game: start -> state 1 -> state 2).

@apoh3
Copy link

apoh3 commented Jul 28, 2022

Testing Scenarios

There are no testing scenarios for external testers.

Scenario 1

n/a

Steps for testing
n/a

Expected behavior
n/a

Screenshots
n/a


Additional context

In the device file explorer in android studio, one can check both json tracker files by going to data -> data -> com.example.wearablelearning -> files.
image

See above comments for a dictionary of the fields in gamePlayLog.json.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android game player Issues related to the player of the game logging
Projects
None yet
Development

No branches or pull requests

3 participants