Hi, I am having problems with string manipulation. I downloaded questions for quiz app but they are not really good formatted. I tried to solve the problem of fragments of text like """ by trying to simply replace it. I upload a screenshot of my trial. Do you know how to solve it?
Another problem is with getting rid of square brackets around my question. I tried to do it by just selecting the first item from list but the app inventor "told" me that it is not a list.
To sum up i want to get rid of these ugly fragments of text and square brackets around text. I tried to solve it for some time but all my ideas turned out to be wrong.
I prefer to work with lists as opposed to dictionaries, even though this may be a bit more long winded.
See the attached aia project which returns a flat list for each question (sets the incorrect answers as elements of the main list instead of being in a sub list). This does remove the keys, so you will need to note the order, which comes back alphabetically.
You may not want to go down this route, but it does show how to handle the escaped html characters. I have replaced both with an apostrophe to maintain the list order of things.
Does your App have to download the questions from a web page? If it does have to, is that website yours? If it is yours, you can collect a CSV file instead of HTML. If you don't have to download you can store a CSV file in the App, or send me that file and I can convert it into a Blocks List.
The idea is that I download the data once, when the user want to start a quiz game. Later I want to display this data on the screen. So yeah, somehow I can tell that it performs the download once, but there can be a second download when sbd want to play another game.
@ChrisWard How do I get a CSV file? Is it done by using the "Web.GotText" and processing the "responseContent"? I havn't worked with it so far. Thanks!
Can you direct the Web1 GotText responseContent to a temporary Text Box, copy it, send it to yourself via email and post it here as a text file? Or alternatively let us have the URL.