Creating a table that displays text depending on variables and stacks the text

Nov 09, 2017

Hi,

I'm working on a project where depending on a true/false variable (How the user answers the question), text will display in two separate columns, (Priority & Not priority). I was wondering if there was a way that the text will stack on each other rather than from hidden to seen in that exact place. This would make the project look a lot neater instead of text all over the screen. 

Any help would be much appreciated.

Thanks,

Jarod

4 Replies
Kev Man

You will need to add some conditional logic and change the way your results are handled.

Your text boxes should dynamically display Question 1, Question 2, etc...based on a new boolean variable question(questionNumber)Correct. 
The logic would be along the lines of:
(when you answer question 1 correctly) question1Correct===true. 
Then, for the results screen, you would have logic saying that if question1Answer=true, set the value of textBox5 to the text of question1 or whatever message you want to have.
If its false, then it goes into textBox4.

Do the same with the other questions, but check to see if the above text box has a value:
If textBox5 has no value AND question2Correct===true, put question 2's correct answer message there.  If textbox5 has a value AND question2Correct===true, then put it in textbox6.
You have to check for the incorrect answer as well, If textbox4 has no value AND question2Correct===false, populate textBox6.  If textbox4 has a value AND question2Correct===false, populate textBox7. 
For the next question, you will need to check both previous boxes to determine if the have values in them (questions 1 or 2 were answered correctly).  So yea, for the last question, you need to check for the first 3 focus on boxes to determine if the text box is empty if the answer is correct, and check the first 3 focus less boxes if the answer is incorrect.

Its gonna be a lot of code, and it may not be the best way, but it may get you pointed in the right direction.

Unless the design dictates that the information be formatted with no spacing between empty boxes, i say keep it the way you have it.  Its easier to read to be honest.  Look at every other comparison checkbox table.  They don't collapse the non-checked cells, they leave them blank because is visually, more informative at a glance.

This discussion is closed. You can start a new discussion or contact Articulate Support.