My latest app is exhibiting some strange behaviour and I’m not even sure I can describe it:
This is how it should look. It’s an educational [ESL] app for use in the classroom to prompt conversation in pairs or small groups. At the press of the big square button with a green dot, it loads the name of the next speaker at random as well as a random prompt word:
It works most of the time [see below] in Adalo Preview but, when I upload to Apple Test Flight, after inputting the players’ names, it will show one name once then it stops loading names completely on subsequent taps. It continues to load the random prompt words though. Logging out then logging back in and setting up the Player list repeats the behaviour of displaying the Player once, then nothing.
Now, I said it works most of the time in the Adalo Previewer. Once in a while, however, it stops displaying Player names in the Previewer as well. This seems to happen when I have 5 or 6 users in the database. When I log out, delete all the Users and delete all of the Players then log in again and create a Player list, it begins working again, that is, displaying a random player and a random prompt in the Previewer but not Test Flight.
For the record, I’m using an automated sign up and log in routine so no one has to share personal details: push a button and you’re logged in.
The correct Logged in User [LIU] Player Count [4] is displayed, meaning four players have been added to the game by the LIU.The other 2 Users have Player counts of 3 and 5 respectively.
The Logged in User Player# [2] is also working correctly as a random pick from the LIU Player Count of 4. It updates dynamically as the RAND is evoked. So far so good.
The problem is with the Current Player being Player #9. This is why nothing will display in the list. In order for anything to display this value has to be a 1, 2, 3 or 4.
There are a total of 12 players in the database so why is the number 9 being displayed. It should display one of 4 on a random basis as per:
The real question is, how can I get that LIUplayer# [a USER value] to randomize my list since the filter is clearly not working? I also tried using the input field Value in the filter but still it doesn’t work.
I traced the problem to the player creation routine and the numbering system I had set up. I was using the count of ALL Players instead of those of the LIU, so numbering could reach to infinity and beyond! I kind of thought that because the User was defined as Logged In numbering would just start over. Clearly not the case.
So when searching for a random player I was looking for an integer from among 20 or 30 names in the database rather than limiting the RAND operation to the handful of players belonging to the LIU. Doh!