Skip to main content
Known Participant
May 12, 2021
Answered

bedingte erweiterte Aktionen mit mehr als 2 Status

  • May 12, 2021
  • 2 replies
  • 5122 views

Hallo,

ich habe ein Objekt mit 3 Status und eine bedingte erweiterte Aktion dazu, die jeden der 3 Status identifizierbar machen soll, weil nur einer der Status als "richtig" akzeptiert werden soll (mit jedem Klick sollen sich Status und Wert der Variable ändern, bei "Senden" soll die Variable überprüft werden und je nach Wert ein "richtig" oder "falsch" eingeblendet werden). Meine bisherigen Versuche sind leider gescheitert. Der aktuelle Stand:

 

Reiter 1:

IF [var] ist gleich [0]

THEN Status ändern von [Objekt] zu [Status 1] + zuweisen [var] mit [1]

 

Reiter 2:

IF [var] ist gleich [1]

THEN Status ändern von [Objekt] zu [Status 2] + zuweisen [var] mit [2]

 

Reiter 3:

IF [var] ist gleich [2]

THEN Status ändern von [Objekt] zu [Status 3] + zuweisen [var] mit [0]

 

Egal ob ich THEN leer lasse oder "Weiter" eingebe, ändert sich leider der Status und damit auch die Variable nicht.

 

Hat jemand eine Idee, wie ich das Problem löse?

 

Vielen Dank im Voraus!

    This topic has been closed for replies.
    Correct answer Stagprime2687219

    This is the approach I would take here.

     

    1. Two variables - one for each object   (for example myVar  and myVar2)

    This action - when you click on your click box will go to the next state and increment your variable.

    The second part - checkVars - will make sure that the variable value cycles around like the object states do

    You will need two advanced actions - one for each object.

    It will be the same setup for both but the name of the shape (myShape or myShape2) will change as will the corresponding variable.

     

     

    2. On the send button you will then check your two variables based on the correct answer.

     

    Hopefully this makes some sense and is helpful.

     

    2 replies

    Stagprime2687219
    Legend
    May 12, 2021

    Just to be clear...

     

    Are you wanting the learner to click the object itself and have the state cycle through the three states and adjust a variable at the same time?

    Then the learner clicks a send button when the correct state (and therefore, variable) is displayed?

    Known Participant
    May 12, 2021

    Hi,

     

    thanks a lot for your answer, I will try to reply in English.

     

    Yes, I want the learner to click the object (rather a click-box overlying the object) and the advanced action shall go through the three states (and go back to state 1 when state 3 is reached), while each changing in state shall adjust the variable.

    In fact, there are two objects the learner has to click, and only if the right status of both objects is reached when the "send"-button is clicked, there will show up "you did it right".

     

    You got it right, "Reiter" = decisions in one action.

     

    I now understand the bug but I have no idea how to fix it.

    Known Participant
    May 26, 2021

    Just type the name of your variable in your shape as text between double $$. When you preview the project it will show whatever the current value of the variable is. Is NaV_Abstritch the name of your variable?

    $$variableName$$

     

     


    Good hint, thank you! I still don't know where to look for the problem: Now it works like it did before! I wonder at which point this will change again... No matter, the way to make the values of the variables visible is great!

    Lilybiri
    Legend
    May 12, 2021

    I understand German pretty well but I dare not to write in German. You can translate my answer using the Transate feature.

     

    It would help if you posted a screenshot of the Preview of that Advanced action (erweiterte Aktion). Use the Preview button, which is the first button in the top right control bar of the Advanced Actions dialog box:

    Which event do you use to trigger that action? Is it a button?

    I suspect that 'Reiter' is used here to point to the decisions in one action? In the screenshot above 'Untitled-1' is the name of the first decision. 

    If that is indeed the case, there is a logical bug in your advanced action. This is probably due to the fact that you ignore that all commands in an advanced action will be read and executed, top to bottom and from left to right. Result of your advanced action is that you'll get the start situation, because each later decision overrides the previous one

    You start with var == 0  and state 'Normal' of the multistate object. You action will do this:

    1. Decision 1: condition is correct, so var == 1 and state will be Status 1
    2. Decision 2: now var ==1 , condition is again correct, result: var == 2 and state changes to Status 2
    3. Decision 3: now var == 2, condition is again correct, result: var == 0 (start situation) and state changes to Status 3

     

    Result should be Status 3 always but I don't yet know which event is triggering this action? Is it the Success event of a button? 

    Explain what you want to do exactly, and I will try to give you a correct advanced action.