In episodes collection, add numbers field and update to 1 if completed, then to check if all episodes in that program are completed use current program>episodes>numbers>sum equal to current program>episodes>numbers>count.
So count will tell how many episodes and sum will tell how many that are equal to 1 which is completed.
Thank you for the solution! The only problem is that I don’t know where (which screen and which component) to check if all episodes in that program are completed (by indeed using current program>episodes>numbers>sum equal to current program>episodes>numbers>count)
→ I have 2 screens:
The first one with the list of episodes
The second one with the audio player when I click on an episode
I have put the following rules in the audio player:
Adding an andio in the Listened audios Collection when an audio is listened for the first time
Adding a program in the Listened programmes Collection when all audios of a programma are listened (by using current program>episodes>numbers>sum equal to current program>episodes>numbers>count)
The thing is when all audios are listened, the program is not added to the Listened programmes Collection, I need to listen again one audio so the program can be added to the Listened programmes Collection
You could mark an episode completed action before link to the next screen or you can use countdown with few seconds located in the next screen to mark completed. Probably more ways that you can experiment to make it more sense for users.
Even you can have button below the audio player that says completed.
And for checking sum=count, you can do that whenever user go back from next screen, it takes a bit delay to get sum and count, because these are calculated fields, need further checking in database, so for user experience separate their process between marking and checking.
Thank you for the suggestions, I am going to try them
“you can use countdown with few seconds located in the next screen to mark completed” → you mean the countdown component?
When I use the “button below the audio player that says completed”, it works for 1 action (example: marking an audio as listened) but not for 2 actions (example: marking an audio as listened + marking a program as listened when all audios are listened), probably because it does both actions at the same time