The Blocks are in Block window MIT App Inventor Text Blocks .
How you use them depends on how your app uses a TextBox to type in an answer to a question and how you determine what is a correct answer.
There are several ways the Blocks can be used. A simple way is to use If then statements.
To make things easier to code, all your correct answers in your routine that indicates a correct answer could be all UPPER case or lower case.
2 Likes
aia
August 3, 2022, 12:48pm
5
How do I implement the "replace all text" block on clicking a button for 5 such questions?
Sorry, I have no idea because I do not know what the Blocks you have coded so far do. Post an image of your Blocks?
Fill in the missing AnswerList and CurrrentQuestionIndex in this example and you might have what you want.
The segment is filled with a space; replacement is filled in with an empty Text Block.
There are other ways to do the normalizing.
Now your turn to experiment and see what works for you.
Here are some resources to help you learn to use the AI2 tools. A very good way to learn App Inventor is to read the free Inventor's Manual here in the AI2 free online eBook App Inventor 2 Book: Create Your Own Android Apps ... the links are at the bottom of the Web page. The book 'teaches' users how to program with AI2 blocks.
There is a free programming course here Course In A Box and the aia files for the projects in the book are here: App Inventor 2 Book: Create Your Own Android Apps
How to do a lot of basic things with App Inventor are described here: How do you...? .
Also look here App inventor español. Offline. Tutorial. Ejemplos. Instalación. Códigos. Juegos. Curso gratis de App inventor. and here Tutorial Index | Imagnity for more tutorials
Learn about components Component Reference
and visit the Library The MIT App Inventor Library: Documentation & Support Help>Library on the MENU
2 Likes
aia
August 3, 2022, 1:17pm
9
I have to add it to the "Submit_button" block, right?
That is what I would do. Why not try doing exactly that, fill in the missing orange Blocks of yours and try it?
aia
August 3, 2022, 1:25pm
11
What should I fill in the "then" section of that if statement?
perhaps make it 'look' like your existing answer logic.
Change TextBox2 to Answer_input_box too.
aia
August 3, 2022, 1:36pm
13
The solution isn't working. The app's aia is given below.
FlagQuiz (1).aia (169.9 KB)
add a trim to the right side too.
1 Like
aia
August 3, 2022, 2:04pm
15
Where can I get that "or" block that you used in those examples?
or
Tests whether any of a set of logical conditions are true. The result is true if one or more of the tested conditions are true. The number of tests can be expanded using the mutator . The conditions are tested left to right, and the testing stops as soon as one of the conditions is true. If there are no conditions to test, then the result is false.
You should read the Inventor's Guide in the above link and particularly http://www.appinventor.org/bookChapters/chapter18.pdf
aia
August 3, 2022, 2:29pm
17
Actually, I can find these types of blocks: can I use that instead?
Certainly or convert the Block using external inputs. Why didn't you read the link showing how to do this that is provided in Post number 16 ?
aia
August 3, 2022, 2:58pm
19
Even after implementing all this, if I enter my answer with a whitespace, it returns my answer as incorrect. What should I do?
Here is one way that might work:
There are other ways but all the other possibilities involve checking to find out if you Answer_input_box contains any text too.
See Programming Your App to Make Decisions
ABG
August 3, 2022, 4:11pm
21
Here are some draggable procedures ...
aia
August 3, 2022, 4:22pm
22
Thanks for the help! The issue is now solved.
system
Closed
August 10, 2022, 4:23pm
23
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.