DawsonHarwood

Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • in reply to: Embedding HTML #6559
    DawsonHarwood
    Participant

    Hi Jeremy,

    Thanks so much for your help and the advice! I know iframes aren’t ideal, but as far as I can find there isn’t another way to do what I’m trying to do. Basically, the tasks that I’m trying to have my participants complete were too complex for me to create directly in PCIbex, which is why I’m hosting them on an external site and embedding them here. The main problem I’m facing is that I don’t want my participants to be able to advance in the experiment until they complete each task, but there’s no way for Ibex to know when the embedded task is completed. I had the idea to check the color of the canvas the task is embedded in (it’s white once they’ve completed the task), but there seems to be something wrong with my implementation since the button isn’t appearing. Is what I’m trying to do realistic in Ibex? Or do you think I need to find a different way to host the experiment? Thanks again for your help!

    newTrial( "trial_1" ,
    
        newPalette("MyPalette") ,
    
        newCanvas("MyCanvas") 
            .print() ,
    
        newHtml("test", "test.html")
            .print("MyCanvas") ,
        
        newButton("Continue" , "Continue")
            .wait() ,
            
        newFunction("Checker" , () => { Palette.test.color("MyCanvas", "white");}) 
            .test.is(true)
            .success( getButton("Continue").print(475,300))
            .failure( getFunction("Checker").call()) 
    )
    in reply to: Embedding HTML #6529
    DawsonHarwood
    Participant

    Hi Jeremy,

    Thanks for your help! Even in the new folder my HTML doc is still throwing up errors, including “Expected an identifier and instead saw “<“” and “Missing “;” before statement”, which makes me think it’s still not expecting HTML. And when I try to run the experiment, it just skips over the trial with the embedded html. Any idea why this is happening? Thanks again!

    Here’s my code btw. I’m still pretty new to PCIbex, so there might just be an obvious error somewhere.
    HTML doc

    <!DOCTYPE html>
    <html lang="en-us">
      <head>
        <meta charset="utf-8">
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      </head>
      <body>
        <iframe src="https://i.simmer.io/@DawsonHarwood/~1a8230be-98ad-ef2b-1f39-89d288ba7f0b" style="width:960px;height:600px">
        </iframe>
      </body>
    </html>

    Trial syntax

    newTrial(
        newHtml("test", "test.html",
        getHtml("test")
               )
            )
Viewing 2 posts - 1 through 2 (of 2 total)