Skip to main content
Participating Frequently
June 11, 2020
Answered

Show/Hide Text Entry Box Based On State of Another Object

  • June 11, 2020
  • 3 replies
  • 811 views

Hello Everyone,

I have a simple form with 3 statements that a student must agree to in order to begin a quiz.

 

Each statement has an empty square smartshape (CB1, CB2, CB3) preceeding it, that changes its state when the student click on it; the state changes from empty square to a square with a check mark.

 

Upon the student agreeing to the last statement (CB3), I need to have a text entry box appear (show) wich student will use to enter thier name and after they click submit a "start quiz" button appear.

 

I can't figure out how to triger the action of "show" on the text entry box, based on the state of CB3, and also "show" the "start quiz" button based on the state of the text entry box.  

 

I appreciate any help I can get.

 

Thank you all so much!

Serko

 

This topic has been closed for replies.
Correct answer Lilybiri

Not totally sure to understand. You say that they need to click the shape buttons in 'sequence'? That means hat you want to have only the first one active at the start and enable the next one after the first has been clicked? 

I would start On Enter with an action that will:

  • Disable CB2 and CB3 
  • Hide the TEB
  • Hide the Quiz button

For the first CB1 create an action which:

  • Disables CB1
  • Changes its state (although it if is a Visted InBuilt state that will happen automatically)
  • Enables CB2

Something similar for the action on  CB2

For the action on CB3, third command needs to be changed to Show TEB.

For the TEB, whch is not validated, use the Success action to show the Quiz button.

 

I may have misunderstood, but with this workflow you do not need any variable at all.

 

3 replies

Stagprime2687219
Brainiac
June 11, 2020

To be more clear...

Each checkbox has its own variable. You would need to create such that it toggles from 0 to 1 at the same time it toggles state from unchecked to checked and back again.

You could run an if statement to say that if the sum of your three variables is 3 (meaning all three checked) to show the TEB or you could have a fourth variable to track the sum and then simply run the if statement to be   if varTotal = 3 ...

 

Hopefully that makes sense.

Lilybiri
Brainiac
June 11, 2020

Is 'must agree in order' not the same as having to answer in sequence? Your variables workflow is only necessary when the user can choose the sequence and/or can change his mind. Maybe the OP can answer that question.

Stagprime2687219
Brainiac
June 11, 2020

A general reading of the sentence indicates to me that the learner must agree to the three statements as a prerequisite to taking the quiz. Think of it as an EULA where the installer must agree "in order to" use the software.

 

That said - you do have a valid workflow as well - if each statement, when selected, reveals the next and locks itself, the variables are not needed.

Lilybiri
LilybiriCorrect answer
Brainiac
June 11, 2020

Not totally sure to understand. You say that they need to click the shape buttons in 'sequence'? That means hat you want to have only the first one active at the start and enable the next one after the first has been clicked? 

I would start On Enter with an action that will:

  • Disable CB2 and CB3 
  • Hide the TEB
  • Hide the Quiz button

For the first CB1 create an action which:

  • Disables CB1
  • Changes its state (although it if is a Visted InBuilt state that will happen automatically)
  • Enables CB2

Something similar for the action on  CB2

For the action on CB3, third command needs to be changed to Show TEB.

For the TEB, whch is not validated, use the Success action to show the Quiz button.

 

I may have misunderstood, but with this workflow you do not need any variable at all.

 

Stagprime2687219
Brainiac
June 11, 2020

General idea...

 

I would use variables here to track the state of each of the three check boxes as either 1 (checked) or 0 (unchecked)

Then  -  if  variable =3 show TEB

 

You could also have that variable to show a custom button along with that TEB which will have an action to take you to your quiz.