I want to make an app in which I will provide few words to the user and user has to make paragraph by using those words. Once he completes his paragraph, I have to check whether he used the given words in the paragraph or not. However, I am unable to understand which code to use for the same. I tried to code with mentioned below blocks but failed the get the expected result. Kindly help me for the same.
Just an example to guide you
Welcome to Thunkable.
The approach you have taken is correct but the blocks you have chosen are not. When you loop through a paragraph ( a stream of text) you are actually taking the paragraph character by character.
To convert the paragraph word by word you will need to use the list block
With this block you will make a list of all the words in the paragraph. You need to change the last (pink) option from a comma to a space.
Now, you can use the blocks that @mimostel demonstrated to get the words of the paragraph one at a time and compare them by your key words.
Happy Thunking!
Thanks for the help. However when I run it, even though I use all the words, it still says not all words used.
The logic is the other way round. Just swap the messages and it should work ok.
However, this method will only tell you if the word is used or not. It will not give you the count and it will not give you how many of your key words are used.
Ok thanks for the advice. In order to know about number of words used, shall I use for loop (1 to length of para_list)?
I clubbed both the advices and come up with the following code:-
However, it is showing score 1 only. What should I do?
It works when I preview your project. But the words will only match if the case matches. So you need to check to see if the words are lowercase, Sentence Case, or UPPERCASE.
It worked. Thanks for all the help i got from here. It is finally giving me the exact expected result.
You’re welcome. I was going to suggest using the to lower case
block but it sounds like you figured it out.
Thanks for that. It was thoughtful.
I don’t see any difference between do and else… no point to do that if you just want to congratulate for using x words… just set and show alert message without any IF… IF is useful only if you want to give points for a condition. (for example if all words are used).
And my bad… forgot about sensitive case… thank you @tatiang
don’t you want to include punctuation marks (like ?,.;:’"!) in your delimiters? so you can parse out the words correctly from a sentence like (you mean, he didn’t say “Fire!”?).
if you use only space as delimiter you would get unexpected “words”!
This was just for testing so that’s why if else have similar code. I changed it later on as per my requirement. Thanks for your code it made my work very easy.
I replaced all the punctuations with space in my paragraph and then converted it into list. Since this was specimen therefore not all code is mentioned here. Thanks for your consideration.