Error saving and retrieving data from TinyDB

First of all, excuse my English, I'm using the translator.
I am creating a quiz game, where the answer is typed by the player, but I have a problem loading the score when re-entering the game.

While playing it saves the score, but when the player leaves and enters the game it starts from 0 again. The levels are enabled when the player has a certain number of correct answers and it is also reset to 0.
It's my first time making a game and I don't know what I'm doing wrong, I'm following tutorials but there are none like the game I want to make.

You need to show the relevant blocks, probably one by one, that save the players level and score, and how these are supposed to be retrieved when the app is restarted (presumably by entering the player's name ?)

It's possible to avoid the pain of having to synchronize your global variables and their TinyDB copies at app startup and save time.

The secret here is to totally eliminate global variables, replacing them with getter/setter procedures that dynamically access TinyDB or component lists behind the scenes.

Before replacing global variables with procedures:

After replacing global variables with procedures:

I'll try to explain myself better, sorry if it's a bit long.

This is the home screen and the blocks as I have understood that it should be done.

When the player clicks on the button of the category he wants to play, the following screen opens:

And when he selects the level the following screen opens:

And these are the blocks that I am using:

This is how I understood that I had to call the database

This is for you to go from one question to the next and from one level to the next

With this the correct answers are added

This is for the levels to be enabled

And this is the one for the questions, what is inside the levels.

I hope it hasn't been too long and that it can be understood well. I don't know what the relevant blocks are, that's why I put them all, sorry.