Come back button

PennController for IBEX Forums Support Come back button

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #8415
    Mate208
    Participant

    Hello,
    In addition to a newButton Continue, is there a way to add a coming back button (if someone clicks on it, it literally comes back to the last slide)?
    The idea is that someone, let’s say on Page4 could either continue to Page 5, or come back to Page 3, on and so on. Then, if someone made a mistake or wants to review his last answer, he could come back and adjust it.

    Here is a part of my code :

    newTrial("Page3",
        
        defaultText.center().print()
        .settings.css("font-size", "1.2em")
        ,
        newText(" hello world ")
        newButton("testtt", "Continue")      
                .center()
                .css({"margin-top" : "50px"})
                .print()
                .wait()
        ,
        newButton("come back")
                .callback( jump("") , end() )
    )
    
    newTrial("Page4",
        
        defaultText.center().print()
        .settings.css("font-size", "1.2em")
        ,
        newText(" hello world 2.0 ")
        newButton("testtt", "Continue")      
                .center()
                .css({"margin-top" : "50px"})
                .print()
                .wait()
        ,
        newButton("come back")
                .callback( jump("") , end() )
    )
    #8426
    Jeremy
    Keymaster

    Hi,

    Just pass the label of the trial you want to jump to in jump:

    newTrial("Page3",
        defaultText.css("font-size", "1.2em").center().print()
        ,
        newText(" hello world ")
        ,
        newButton("come back")
            .center()
            .callback( jump("Page2") , end() )
            .print()
        ,
        newButton("testtt", "Continue")      
            .center()
            .css({"margin-top" : "50px"})
            .print()
            .wait()
    )
    
    newTrial("Page4",
        defaultText.css("font-size", "1.2em").center().print()
        ,
        newText(" hello world 2.0 ")
        ,
        newButton("come back")
            .center()
            .callback( jump("Page3") , end() )
            .print()
        ,   
        newButton("testtt", "Continue")      
            .center()
            .css({"margin-top" : "50px"})
            .print()
            .wait()
    )

    Jeremy

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.