Buttons/feedback that remain in pressed/activated state?

jwaginski
jwaginski Community Member Posts: 37
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.

Comments

  • timk
    timk Community Member Posts: 1,236 ✭ Legend ✭
    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.
  • jwaginski
    jwaginski Community Member Posts: 37
    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."
  • timk
    timk Community Member Posts: 1,236 ✭ Legend ✭
    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.
  • carlfink
    carlfink Community Member Posts: 1,099 ✭ Legend ✭
    A simple but arguably problematic way to have buttons keep their state when you change page: inherit the button from the Assignable Unit.
  • jwaginski
    jwaginski Community Member Posts: 37
    How can you inherit multiple buttons from the assignable unit when each button has either a 0 or 1 state?
  • carlfink
    carlfink Community Member Posts: 1,099 ✭ Legend ✭
    @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.
  • jwaginski
    jwaginski Community Member Posts: 37
    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.