Skip to main content
Known Participant
February 23, 2023
Question

advanced action with variables and calculation to check the result

  • February 23, 2023
  • 1 reply
  • 2758 views

Hi,

 

the answer in my previous Discussion worked fine with a simple calculation (3 buttons), so I tried the same with 4 buttons. However, I failed...

 

The variables for the 4 buttons have the value "1".

Each button has an advanced action to change state and variable, I have added the screenshot of the advanced action für button "Druck_TF".

 

There are many right answers:

A x B = C x D

or

B x A = D x C

or

C x D = A x B

...

 

If the 4 states of the 4 buttons would set the variables correctly, and the "Senden"-Button would calculate properly, both sides of the "=" should be equal to "5" (1+4 or 2+3).

 

Any idea what I got wrong? Thanks a lot for your help!

 

PS: Maybe I should not have asked this within the old discussion, as it is already marked "solved".

This topic has been closed for replies.

1 reply

Lilybiri
Legend
February 23, 2023

I have posted in that previous thread, but only to explain the mathematical operators.

However I don't understand the complete workflow, missing some information. There should be a logical bug. Not having a translation list for the German terminology doesn't  make it easier. I suppose that Einblenden is the (wrong) translation for Show, and Ausblenden for Hide?

You try to track the state for each of the four buttons, using a variable and the Increment command, that is clear from the Button Druck_TF action.  What is the default value of those variables? State 1 is the Normal state, so I guess it is 1?

 

Known Participant
February 23, 2023

Hi,

 

vielleicht ist es auf Deutsch besser (ich kann weniger gut Englisch als du Deutsch?):

Du hast es richtig vermutet:

einblenden = show

ausblenden = hide

In der erweiterten Aktion des "Senden"-Buttons habe ich folgendes Ziel:

- bei korrekter Auswahl der Status aller 4 Buttons: Meldung "richtig" einblenden, "Senden"-Button ausblenden

- bei falscher Auswahl der Status: Meldung "falsch" einblenden, Button für die richtige Lösung einblenden, "Senden"-Button ausblenden

 

State 1 = Normal State, die Variable dafür soll mit 1 belegt werden, damit die Rechnung funktioniert.

 

Die richtige Lösung der Gleichung könnte sein:

Status 1 + Status 4 = Status 2 + Status 3

oder alle anderen Kombinationen, so lange Status 1+4 und 2+3 gemeinsam auf der selben Seite der Gleichung stehen.

 

Ich weiß nicht ob ich "default value" richtig verstehe. Der Wert, der als falsch gezählt wird? Je nachdem, um welchen Button es geht...

 

Vielen Dank!

Lilybiri
Legend
February 23, 2023

Sorry, your answer was posted right when I was adding a comment myself.

It is OK to answer in German, no problem for me. In my sample project I used a shared action for the 'Druck' buttons, and another multistate object to show the feedback messages. I didn't hide the Submit button, but that is not so important. 

I replace the dual condition (AND) by one condition:

    IF  v_left is equal to v_right

 

Those variables have the sum of the variable values to the right and to the left of the = sign. I have a wrong state as well, which will appear whenever the sums are not equal. Problem: since you start with the Normal states of the buttons, the Submit will immediately result in a Correct answer.