Buttons/feedback that remain in pressed/activated state?
November 20, 2018 12:00 AM
Are there any buttons that can remain in a pressed state i.e. like a toggle that remains in state B until pressed again? I can do this using two different buttons and a separate checkmark indicator; however, when you navigate away from the page and back, everything reverts to its original state. This is true as well for question feedback that is set to appear on when a question processes immediately - the feedback disappears when you navigate away and back.
Discussion (7)
Hi Tim,
Sorry, I modified my question.. I did as you say and that works fine but everything reverts when you navigate away from the page and return. Is there a way to make buttons/feedback persist?
I wrote "when you navigate away from the page and back, everything reverts to its original state. This is true as well for question feedback that is set to appear when a question processes immediately – the feedback disappears when you navigate away and back."
No. But you can use two buttons, one for each state that show/hide each other. jQuery UI has some real toggles if you're familiar with it.
Alright, but you edited the question after I clicked "Reply" ;-)
Of course the HTML page is in its initial state whenever it's opened. If you want to save changes you'll need variables and repeat relevant actions. The question has a variable that will stay unchanged while the user is away from the page (unless you reset either test or question). To keep the feedback visible when a user returns to the page you'll have to re-process the question with two actions:
On: Show
Action: Show
Target: Incorrect Feedback
If Question_0001 is not correct
If Question_0001 is not empty
On: Show
Action: Show
Target: Correct Feedback
If Question_0001 is correct
When a user comes to the page for the first time the question is empty and not correct, i.e. no feedback will be shown. But when a user returns, the question is not empty and either correct or not.
A simple but arguably problematic way to have buttons keep their state when you change page: inherit the button from the Assignable Unit.
How can you inherit multiple buttons from the assignable unit when each button has either a 0 or 1 state?
@jan, presumably you could hide the buttons on pages where they don't apply and show them when they do. I'm not sure I understand the question, honestly.
Thanks Carl. I think Tim's solution for question feedback is ok as I can create that once for each question. I think I can do the same with the buttons.
Discussions have been disabled for this post