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 current app session players #237

Open
franciscastro opened this issue Apr 7, 2022 · 5 comments
Open

Generate a JSON tracker for current app session players #237

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

Comments

@franciscastro
Copy link
Contributor

Create a JSON file playerTracker.json that tracks the current players for a session. playerTracker.json will get updated for each player that uses the app for a session, as well as whenever there are updates to a player currently active in a game.

Use case example:

  1. Player allison1 logs into game PIN 1 as Team 1 Player 1 and then plays the game until state number 3 (her previous input to get from state 2 to state 3 was "cats"). She entered the state at time 00:10.
  • Current state of playerTracker.json as of this point will be:
    {
    name: allison1
    Team: 1
    Player: 1
    currState: 3
    currTransition: 3
    timeEnterState: 00:10
    prevTransAnswer: “cats”
    }
  1. Player allison1 presses back and gets redirected to the game PIN screen. Player allison2 logs into game PIN 1 as Team 2 Player 2 and then plays the game until state number 1 (the first state of the game). She entered the state at time 00:02
  • Current state of playerTracker.json as of this point will be:
    {
    name: allison1
    Team: 1
    Player: 1
    currState: 3
    currTransition: 3
    timeEnterState: 00:10
    prevTransAnswer: “cats”
    },
    {
    name: allison2
    Team: 2
    Player: 2
    currState: 1
    currTransition: 1
    timeEnterState: 00:02
    prevTransAnswer: null
    }
@apoh3
Copy link

apoh3 commented Apr 19, 2022

Example:

[{"name":"Allison","guest":true,"gamePin":"12","team":"1","player":"1","currState":"state_2","currTransition":"trans_2","timeEnterState":"2022-04-19T18:22:43.630Z","timeExitApp":"2022-04-19T18:22:43.630Z","prevTransAnswer":"BK"},{"name":"Allison2","guest":true,"gamePin":"12","team":"2","player":"1","currState":"state_4","currTransition":"trans_4","timeEnterState":"2022-04-19T18:23:05.674Z","timeExitApp":"2022-04-19T18:23:05.674Z","prevTransAnswer":"cat"}]

Re-login as Allison updates the name=Allison entry:

[{"name":"Allison2","guest":true,"gamePin":"12","team":"2","player":"1","currState":"state_4","currTransition":"trans_4","timeEnterState":"2022-04-19T18:23:05.674Z","timeExitApp":"2022-04-19T18:23:05.674Z","prevTransAnswer":"cat"},{"name":"Allison","guest":true,"gamePin":"12","team":"1","player":"1","currState":"state_5","currTransition":"trans_5","timeEnterState":"2022-04-19T18:23:53.911Z","timeExitApp":"","prevTransAnswer":"BL"}]

@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 playerTracker.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