Problema com comparação de listas

29 views
Skip to first unread message

Fernando Eller

unread,
Jul 16, 2019, 11:05:11 AM7/16/19
to mitappinv...@googlegroups.com
Dear all,

I'm developing an APP (Quiz) to help my pupils that are initiating their studies in electronic field. The initial idea was to create a simple app and after tried it, increment it during the semester.

I'm having some trouble in order to make comparisons between two different list. One is a list filled with the possible answers and the other is made by the state of switches combined by wich the user may select true or false state.

If anyone can help me, you can find the app published in the link bellow

ABG

unread,
Jul 17, 2019, 12:20:58 PM7/17/19
to MIT App Inventor Forum
The problem was in the incompleteness of AI2's Duck Typing
(If it walks like a duck, talks like a duck, it must be a duck.)
It's more like Lame Duck Typing.

Text and logical 'true' don't compare as equal.

Also, the green logical '=' block is more list friendly than the math
'=' block, according to its tool tips.

So I replaced the text answers with logic answers, and the
list comparison block too.

While I was in there, I also
renamed your procedure appropriately,
and cleaned up your limit response in the Next
button to avoid a subscript error.

See attached.

ABG


when AnswerButton Click.png
when NextButton Click.png
SwitchesSettings.png
updateLabel12.png
when Screen1 Initialize.png
checkQuestionIndex.png
blocks.png
QuizMeR2_ABG.aia
logical_vs_logical.PNG
math_logical_vs_text.PNG
logical_vs_text.PNG
global AnswerList.png

ABG

unread,
Jul 17, 2019, 12:35:02 PM7/17/19
to MIT App Inventor Forum
I neglected to mention why I replaced the global variable SwitchesSettings with
a function (value) procedure.

The global variable gets its value at startup time,
and doesn't change until you change it
(which you didn't.)

It's safer to dispense with it entirely and use
a function procedure instead, which always 
re-evaluates as needed.

Draggable blocks can be downloaded from a new github repository at

ABG

Fernando Eller

unread,
Jul 18, 2019, 5:44:13 PM7/18/19
to MIT App Inventor Forum
Dear  ABG,

The changes you have proposed were very smart and clear to me!

Thank you very much for helping me on this.

ABG

unread,
Jul 18, 2019, 6:16:47 PM7/18/19
to MIT App Inventor Forum
Thanks for getting back to us!
ABG

ABG

unread,
Jul 19, 2019, 2:06:35 PM7/19/19
to MIT App Inventor Forum
Pardon the afterthought, it's hard to find victims
for this logic puzzler...

Here's a logic puzzler for your students.

What would happen if you tried to evaluate
the question from Shakespeare's Hamlet:
"To be or not to be "(that is the question)
in AI2 blocks (see attached.)

ABG


Hamlet.PNG
Reply all
Reply to author
Forward
0 new messages