Jeremy

Forum Replies Created

Viewing 15 posts - 616 through 630 (of 1,522 total)
  • Author
    Posts
  • in reply to: Troubleshooting #7630
    Jeremy
    Keymaster

    Hi Noelia,

    1. This is just a warning, not an error: you have more than one Text element named ” ” in your trial. If you were to use getText(" ") later in that trial, PennController would have to guess which of those Text elements you mean, so you’re being warned that the next three Text elements are being named with a 2, 3 and 4 suffix. I took a look at your code and you don’t actually need those Text elements, you could do that:

    defaultText.print(),
    defaultButton.css("margin","0.5em").print()
    ,
    newText("<p>¿Quiénes pueden subirse a la montaña rusa?</p>")
        .center()
        .css("font-size", "large")
    ,
    newButton("1", "les niñes"),
    newButton("2", "los adultos"),
    newButton("3", "personas mayores de 10 años"),
    newButton("4", "todos")
    ,
    newSelector()
        .add(getButton("1"), getButton("2"), getButton("3"), getButton("4"))
        .shuffle()
        .keys("1", "2", "3", "4")
        .log()
        .wait()

    2. Are you saying that when you press the “2” key when, for example, the shuffle command made the Button named “3” appear as the second option, you see “2” where you would expect “3” in the results file? I tried adding and waiting for a Button element after the Selector element’s wait command, and I see that the framed button does correspond to the key I press (ie. the button displayed second in a top-down order is framed, regardless of which button it is)

    Jeremy

    in reply to: Experiment stuck in empty state #7627
    Jeremy
    Keymaster

    H Elise,

    I can’t seem to reproduce the problem myself, but if you don’t want to include a Timer element for certain rows, simply use a different value like NA in the “Timer” column and do this:

    newText("MemoryList",row.MemoryList).print()
    ,
    ( row.Timer=="NA" ? null : newTimer("wait", row.Timer).start().wait() )
    ,
    getText("MemoryList").remove()

    This way you shouldn’t have any issues with ultra rapid timers

    Jeremy

    in reply to: html layout/event times/selector vs. scale/ compatibility #7625
    Jeremy
    Keymaster

    Hi,

    1. You can either use &comma; in place of ,, or surround your text column which contains ,s with "s

    2. It keeps the same order, I don’t see an easy way of re-randomizing the order dynamically. If you’re already thinking of limiting the loop to three cycles, maybe just include the practice subsequence three times in your Sequence (this way the three randomize will generate different orders), and use jump to directly reach the experimental trials for participants who pass, and let participants who fail continue to the next round of practice trials

    3. Yes, I see no technical reason why you couldn’t do that. However some organizations like the IRB have policies regarding participants’ rights to take part in an experiment and/or being compensated for it, so double-check that your setup is consistent with any policies that govern your experiment

    Jeremy

    in reply to: Comprehension question and rshuffle in self-paced reading #7620
    Jeremy
    Keymaster

    1. I think you will see true in the results file, but you should double-check. In any case, you can always true/false with 1/0 if you want

    2. I made it impossible to turn the debugger off in the demonstration link, since people would sometimes turn it off while still working on their experiment and would miss warnings/errors, and end up spending much more time debugging their project. You can always click the X icon in the top-right corner of the debugger to not have it on the page, and the debugger will never show up using the data-collection link (DebugOff is no longer required)

    Jeremy

    in reply to: Comprehension question and rshuffle in self-paced reading #7616
    Jeremy
    Keymaster

    The command global makes the Var element accessible outside the trial where it is defined. Reference

    Your code should work, but if you look back at the excerpt of code in my previous message, you’ll notice the .log command is indented more to the left than the other commands and is actually called on the closing parenthesis of newTrial and before the closing parenthesis of Template (although I omitted the Template and newTrial commands that come earlier in the code). Reference

    Jeremy

    in reply to: Scale with labels and before/after text in different places #7615
    Jeremy
    Keymaster

    Hi,

    1) you’ll have to use CSS. You could do this:

    .before(newText("igen").cssContainer({height:'100%',display:'flex','flex-direction':'column'}).css("margin-top","auto"))
    .after(newText(" nem").cssContainer({height:'100%',display:'flex','flex-direction':'column'}).css("margin-top","auto"))

    2) You’ll have to use a trick here, as the HTML textarea elements corresponding to the PennController TextInput elements need to be siblings with the surrounding text nodes in order to get the wrapping right. Here’s a suggestion:

    newText("container", "Hello world. This is a very long text to see whether including a <span id='myFirstInput'></span> TextInput element inline will cause a problem when this text needs to be wrapped into two lines <span id='mySecondInput'></span> on the page").print()
    ,
    newTextInput("test1", "").log().print(),newTextInput("test2", "").log().print()
    ,
    newFunction(()=>{
        $("#myFirstInput").after( getTextInput("test1")._element.jQueryElement ).remove();
        $("#mySecondInput").after( getTextInput("test2")._element.jQueryElement ).remove();
    }).call()

    Jeremy

    in reply to: Comprehension question and rshuffle in self-paced reading #7613
    Jeremy
    Keymaster

    Hi Jun,

    You could make Answer1 the correct answer in every row: since you shuffle the order in the scale anyway, your participants won’t be able to identify the correct answer by its order

    Then if you don’t want to mark whether the participant’s answer was correct during post-data-collection analyses, you could use a global Var element to add a column that reports whether the choice was correct:

        newVar("isCorrect").global()
        ,
        newScale("answer",...[row.Answer1,row.Answer2].sort(v=>0.5-Math.random())
            .labelsPosition("right")
            .center()
            .log()
            .print()
            .wait()
            .test.selected( row.Answer1 )
            .success( getVar("isCorrect").set(true) )  
            .failure( getVar("isCorrect").set(false) )
      )
      .log("isCorrect", getVar("isCorrect"))
    )

    Jeremy

    in reply to: Troubleshooting #7603
    Jeremy
    Keymaster

    In my case preloading was taking a while when I tried the experiment at your link a couple time, then I uploaded version 2.1-beta and preloading went much faster

    Unfortunately I don’t know what exactly caused the issue, so not sure how you can test it systematically

    Jeremy

    in reply to: Troubleshooting #7601
    Jeremy
    Keymaster

    Hi Monica,

    This is an issue I’ve been working on. I’m currently writing the next release of PennController. It’s still a beta, but hopefully it should be stable enough to run your experiment. I’ve uploaded it to a copy of your project and the preloading seemed much improved:

    https://github.com/PennController/penncontroller/blob/master/dist/PennController.js

    Let me know if you still experience issues

    Jeremy

    in reply to: alert from preview: ERROR: #7598
    Jeremy
    Keymaster

    Hi,

    Edit: Sorry, I misidentified the problem. The message you get means that at least one entry in the items array is missing either the controller’s name or the options for that controller. For example, this would generate the error message you get because the second "DashedSentence" before {s: "Bye Earth"} is missing:

    ["myitem", "DashedSentence", {s: "Hello world"}, {s: "Bye Earth"}]

    Ibex checks that there is an even number of elements after "myitem", because it expects pairs consisting of a controller name and an object representing the options for that controller. If it finds an odd number of elements (as is the case above: there are three elements after "myitem") it throws the error you get

    This means that the items array is not well-balanced with respect to the latin groups you defined. As written in the original Ibex documentation:

    Note that the second number in the pair must be the same for all items in the group

    Feel free to share you experiment’s demonstration link for troubleshooting

    Jeremy

    • This reply was modified 3 years, 7 months ago by Jeremy.
    in reply to: html layout/event times/selector vs. scale/ compatibility #7591
    Jeremy
    Keymaster

    Do you mean that you have <img src="3_granpas.jpg" alt="Example" width="500" height="333" class="center"> in one of your HTML files? If so, you need to place an image file named 3_granpas.jpg inwww too

    (note that PennController doesn’t preload images/audios/videos directly referenced in HTML img, audio and video tags)

    Jeremy

    in reply to: including attention checks and break #7590
    Jeremy
    Keymaster

    Hi,

    If you are fine with having an “asyncUpload” trial between every single trial, you could do this:

    Sequence( 
        sepWith(
            "asyncUpload"
            ,
            subsequence( randomize("exp-trial") , repeat(randomize(startsWith("filler")),3) )
        )
    )

    Just remember to add a script file defining subsequence and repeat to your project’s Modules folder

    Jeremy

    in reply to: html layout/event times/selector vs. scale/ compatibility #7586
    Jeremy
    Keymaster

    Ah, sorry, I forgot you are using an instance of the original Ibex farm, not a standalone version of the experiment. The original Ibex farm doesn’t readily come with hosting solutions for multimedia resources (which is a feature we added to the PCIbex Farm when we set it up)

    If you want to host any multimedia file on the farm, you will need to upload them to the www subfolder of your project’s folder on the farm’s server. This should be easy if you are the one who set up the farm, otherwise you’ll have to contact whoever is in charge

    Jeremy

    in reply to: html layout/event times/selector vs. scale/ compatibility #7584
    Jeremy
    Keymaster

    Hi,

    1) Multimedia files (images, videos, audios) need to go in the “www” folder (which is the exposed folder of the experiment, where experiment.html and server.py live, which need to be publicly accessible to take the experiment)

    2) Text-content files (html, csv) need to go in the “chunk_includes” folder: server.py reads their content and feeds a “CHUNKS_DICT” object with it, so the files don’t need to be publicly accessible

    Jeremy

    in reply to: Skipping Trials #7580
    Jeremy
    Keymaster

    Hi,

    You can use a Selector element to group clickable elements:

    newCanvas("20em", "3em")
      .add( "left at 0%"    , "middle at 50%", newButton("yes", "Yes, I consent") )
      .add( "right at 100%" , "middle at 50%", newButton("no", "No, I do not consent") )
      .center()
      .print()
    ,
    newSelector("yesno")
      .add( getButton("yes")  , getButton("no") )
      .wait()
      .test.selected( getButton("yes") )
      .failure( clear() , newText("Oh well").center().print() , newTimer(1).wait() )  // stay on page

    Jeremy

Viewing 15 posts - 616 through 630 (of 1,522 total)