Hello!
I’m breaking my head about finding a way to build a test app that shows random questions but with an option to not show questions that the user has already answered (answers saved on Firebase of course).
Thanks in advance…
Hello!
I’m breaking my head about finding a way to build a test app that shows random questions but with an option to not show questions that the user has already answered (answers saved on Firebase of course).
Thanks in advance…
create 2 columns in your database:
create a subroutine, getQList which returns a list of row_numbers, or row_id or some field that makes the question unique and can be used for obtaining a row from the database. allow 2 input parameters:
create the list of questions by calling getQList with the desired combination of filter_option and filter_type
randomize the list
iterate over the list - for each entry, obtain the corresponding row from table and present each question, ask for answer, update table.
Have to admit that I got a little confused with it. I sharpen the question a bit.
It’s going to be a personality test so there are no right or wrong answers.
I just want the answered questions that had been sent to firebase to not appear again (unless a toggle is on).
If so, do I still need the second column or just one column enough?
I am currently taking the questions from the locale db - I did not understand where I should put them now …
Thank you!
you’re right - you don’t need the 2nd column. you may not need the 2 parameters in the subroutine anymore. but you may want to replace them with one global variable to indicate (apply filter or not) and if filter is to be applied, you only need to check n_ans is zero or greater_than_zero.
the local db can contain your whole test. or you can store it in airtable, or firebase. you need the ability to help you get a specific record directly by using its “key” field.
I Used those blocks to create a folder in the realtime DB
and used this block to create get a random number that will be compared to the ones in the first blocks.
I have tried dozens of ways to pull data from the DB and if the information does not exist to create the requested functionality, but nothing works
Could you please explain to me in detail how to do it?
I’m pretty sure there is a smarter easier way to do this function.
thank you so much!