Estoy realizando un quiz de preguntas rápidas basado en el de vaidrollteam.
Lo conseguí programar y funciona genial, pero decidí que la fuente de las preguntas fuera mediante un archivo csv y no consigo que funcione.
Esta captura recoge la estructura de listas de vaidrollteam para las preguntas y las respuestas.
He mantenido el nombre de las listas, por lo que si se generan igual el resto debería funcionar, pero no lo hacen, me reporta "Pick random item: Attempt to pick a random element from an empty list" Por lo que intuyo que las listas deben estarse generando mal.
You can use above blocks to make your list structure.
But I would not recommend this structure the questions and answers separated in two list, in this case, the shuffle function will be a challenger.
The problem is that if I need to add 200 questions, I have to do it one by one along with the answers. That's why I imported them as a CSV from Google Sheets.
If I manage to get the structure above, the app will work.
So write your own blocks to load those global variables from the table you get from the incoming CSV text. Loop over each row , using the Add Item to List and Make a List blocks.
First of all, thank you for your responses. I greatly appreciate your input. It's very overwhelming to face these challenges alone when things don't work out.
I can't get it to work; it keeps reporting errors.
a. It calls Web1 and retrieves the CSV file from Google Sheets. (This works). b. Then, it creates a general variable for components with the buttons (previously, the list structure worked). c. It starts the process to call the next question (this used to work).
When Web1 retrieves the text:
a. We generate a general variable from the CSV table with the content. b. We call the "processing" process (where we generate the questions and answers).
When the "processing" process runs:
a. It generates one question for each element in the list with index 1.
When displayed in a label, it looks like this:
b. I generate a list of answers by trimming from index 2 to 5.
We create the random question, but it always reports this message. Pick random item: Attempt to pick a random element from an empty list
In the local variable, when requesting a random question, it tells me that the list is empty.
Tampoco me selecciona las preguntas. Select list item: Attempt to get item number 0, of the list [["Si", "No", "Puede ser"], ["Si", "No", "Puede ser"], ["Si", "No", "Puede ser"]]. The minimum valid item number is 1.
Would it help if I uploaded a screenshot of all the blocks? Whatever you think is best to assist me.
Thanks.
My quiz is based on the one published on YouTube by vaidrollteam, and it worked until I tried importing from Google Sheets.
Here index was set as zero. Check this variable. If you use any global variable, just initialise it with 1 or use one ticker to +1 if it is initi with 0
This error clearly says no list items was added inyo this variable. Pls verify the process
Until step 3 it was all good. So concentrate on setp 4 onwards
If possible add sample of your aia
(If your blocks are in eng it will be convenient to answer)
You are having huge confusion at this procedure. Make clear actually what are you aiming for? Yo have designed complex one instead of making simpler one..
that globalCantidadDePreg.. is you initialized with the number 3 then why do designed blocks like this? also you have handled the procedure in wrong manner. Your procedures should go when web got text event but you added during initilise if so you will get such errors. Because without adding elements, items to the global list how can you run events or procedures or logic's?
First design or structure your logic sequentially or I may be wrong to understand your sequnace. Sorry if i am bad.
Thank you very, very much. I had managed to get the data structure, and it was strange that it didn’t work. After reading Spicy_Topics, I reviewed the structure and realized it was referencing other lists. For now, it’s working. I’ll continue with the project and see where I get stuck next.