Jeremy

Forum Replies Created

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • in reply to: zipped audio files #2848
    Jeremy
    Keymaster

    Hi Maxime,

    I didn’t do anything special, really. Can you open this page and paste and try your script (just make sure to update your PreloadZip command with https): https://expt.pcibex.net/ibexexps/example/example/testData.php

    If it doesn’t work, it probably means that the problem comes from your local configuration, since it works for me. I also tested it with a dedicated project on the PCIbex Farm and it works too: https://expt.pcibex.net/ibexexps/PennController/test/experiment.html

    What exactly happens when you try using the zipped file method? You archive is rather heavy (~90MB) and it takes almost the entire 1min preloading period to download it with my average/fast connection. You might want to use CheckPreloaded with a delay of, say, 3 minutes. Or you can try to reduce the size of your zip file.

    NB: I only tested with PennController 1.2, might be worth checking that too

    in reply to: zipped audio files #2844
    Jeremy
    Keymaster

    Hi Maxime,

    The website for PennController has moved to https://www.pcibex.net/ where you can find the new forums.

    If you host your IBEX experiment on a server with a secure domain (e.g. https://expt.pcibex.net/ ) then some browsers will block automatic access to your ZIP file, which is hosted on a non-secure domain (http instead of https).
    You can either host your ZIP file on a server with a secure domain or proceed to secure your own domain (there are many solutions available for free—for example pcibex.net uses a proxy with Caddy)
    Another, dispreferred solution is to host your experiment on a server with a non-secure domain, e.g. http://spellout.net/ibexfarm/.

    When I run your script on my localhost (which imposes no secure-domain restriction) your script runs smoothly.

    Note also that the first audio in your script might not play on some browsers, since the play command gets executed before any interaction (such as a click or a key press) took place on the experiment’s page.

    • This reply was modified 5 years, 10 months ago by Jeremy.
    in reply to: penn controller for (visual) masked priming? #2833
    Jeremy
    Keymaster

    Hi Roberto,

    Before I answer your question, let me point out that we have a new website ( https://www.pcibex.net/ ) where we also migrated the forums ( https://www.pcibex.net/forums/ ). I will also clone this discussion there (without this line).

    I have not run masked priming myself, but I seem to remember hearing of people doing it with Ibex.

    As any javascript-based solution, Ibex, and therefore PennController as well, runs locally, on the client side, which means that quality of connection shouldn’t be an issue, as long as you make sure that all resources are preloaded before running trials.

    Then there’s the question of refresh rate. With online experiment, you really have no control over the participant’s monitor, but I doubt many people run under 60Hz nowadays, which still gives you a 16ms time window theoretically, it’s not bad.

    Then enters the question of performance, and the question of the alignment of your script’s frame-rate and the monitor’s refreshing cycle. PennController’s Timer elements currently use JavaScript’s setTimeout function which is far from perfect and can be problematic for highly accurate measures. I wouldn’t rely on it if you need to compose with time windows under about 30ms (missing one refresh rate, you get 2 times 16ms = 32ms). Note that you can estimate how much time really elapsed if you call .settings.log() on your Timer and then look at the difference between the timestamps of the results lines corresponding to the Start and End events.

    A better solution might be to rely on JavaScript’s request​Animation​Frame function, which I plan on using instead of setTimeout for Timer elements in future releases of PennController. I could prioritize working on this feature if you think the current Timer element will give you too poor performances regarding your masked priming needs.

    In any case, it’s always a good idea to pilot this kind of things first. I would say, if you think you’d be fine with time windows between 40ms and 60ms, then maybe try to run a few participants and look at the actual data. The considerations above hold true of any javascript-based solution.

    Let me know if you have any questions.

    Best,
    Jeremy

    in reply to: running penncontroller locally #2824
    Jeremy
    Keymaster

    Hi Camilo,

    1. Have you tried placing your images in ~/Sites/ as well?

    2. The errors could be due to hidden files in chunk_includes. On Mac, Finder automatically generates .DS_Store in some folders, which usually causes Ibex to crash. I usually solve the problem in the Terminal, I move to the chunk_includes folder and I type rm .DS_Store.

    This is an archive of the experiment I successfully ran on my Mac, if you want to try it yourself (and/or copy the server.py file in case you have doubts on the edits I describe in my previous message):
    https://www.dropbox.com/s/x62tvt20e775i8m/ibex-local.zip?dl=0

    • This reply was modified 5 years, 11 months ago by Jeremy.
    in reply to: zipped audio files #2821
    Jeremy
    Keymaster

    Hi Roberto,

    When I try to use your PreloadZip command with the URL that you give, my browser gives me a CORS error, suggesting that there might be a problem with your .htaccess configuration. Did you make sure that the .htaccess file is in the exact same folder as your zip file? (i.e. https://sprouse.uconn.edu/downloads/syllabicity/)
    Also, did you check that your file is indeed named .htaccess and has no extension that could be hidden when you’re browsing your files? For example, if you created it using a text editor, it could be that its actual name is .htaccess.txt. The initial . is necessary as well.

    A note on PennController.CheckPreloaded: this command creates a trial labeled unlabeled by default. You must indicate when in your sequence the CheckPreloaded trial should appear (i.e. at what point in the experiment it becomes crucial that the resources are preloaded before proceeding). If you want to use a specific label, use the label command.

    in reply to: aesthetics handling – some random questions #2814
    Jeremy
    Keymaster

    Hi Roberto,

    1. Have you taken a look at the Aesthetics page in the documentation? If you’re trying to apply general aesthetics (i.e. something that would apply to more than one trial) I would use the PennController.css solution described there. You probably want to add margins to the container. Say you name your element sentence then you could add something along these lines to PennController.css:

    .sentence-container {
      margin: 10px;
    }

    If you want to use .settings.css you should use only one of the expressions separated by a slash in the command that you give. If that’s already what you did, then you can try .settings.cssContainer instead.

    2. Have you tried using .settings.size with the same width on both your Html and your TextInput elements? E.g.

    PennController(
        newHtml("explanations", "debriefing.html")
            .settings.size("40em")
            .print()
        ,
        newTextInput("feedback", "")
            .settings.size("40em")
            .print()
        ,
        newButton("continue", "Continue")
            .print()
            .wait()
    )

    3. You are correct. If what you want to check is that the textbox contains text, you can use .testNot.text(/^\W*$/) on your TextInput PennController element, or if you’d rather have everything in a single HTML file, you can add a textarea to its content with the obligatory class (as described in the Ibex documentation manual under Form) and then test your Html PennController element with .test.complete() (click the link to see an example).

    Best,
    Jeremy

    • This reply was modified 5 years, 11 months ago by Jeremy.
    • This reply was modified 5 years, 11 months ago by Jeremy.
    in reply to: zipped audio files #2808
    Jeremy
    Keymaster

    Hi Roberto,

    1. Thank you for this question and you feedback about the documentation, I have added a link to an external page listing audio support in HTML5. You surely can use WAV files, which actually appear to be compatible with the most browsers.

    2. There currently is no alternative to using your own servers, since download takes place automatically in the background (as opposed to manually, at the initiative of the participant) which requires the servers where the ZIP file is hosted to grant the domain where the experiment is hosted (e.g. spellout.net) such automatic distant access to your ZIP file (e.g. using a .htaccess file, as described in the documentation).

    2′. I am sorry if the documentation is unclear: one cannot refer to GDrive/Dropbox folders, but one can directly refer to GDrive/Dropbox files directly (and inidividually) as long as they have a public-access URL. With Dropbox, you can click “Copy Link” next to the file you want to use and replace the ?dl=0 bit at the end with ?raw=1 and use the URL in a newImage, newAudio or newVideo command.

    Let me know if you have further questions or requests.

    Jeremy

    • This reply was modified 5 years, 11 months ago by Jeremy.
    in reply to: running penncontroller locally #2804
    Jeremy
    Keymaster

    Hi Camilo,

    Are you running you IBEX instance on Mac OS? If so, you can place your image and audio files in /Library/WebServer/Documents/ (or ~/Sites/) and then access it at, e.g. http://localhost/myImage.png. So this should work:

    PennController.AddHost("http://localhost/");
    PennController(
        newImage("my image", "myImage.png")
            .print()
        ,
        newButton("continue", "Continue")
            .print()
            .wait()
    )

    Alternatively you can edit the file server.py in your experiment’s www folder and, below these two lines:

    if fname.endswith(".wav") or fname.endswith(".mp3") or fname.endswith("m4a"):
        continue

    add

    if fname.endswith(".png") or fname.endswith(".jpg") or fname.endswith(".bmp"):
        continue

    And further down, replace this line:
    start_response('200 OK', [('Content-Type', 'audio/mpeg'), ('Content-Length', stats.st_size)])
    with

    if qs_hash['resource'][0].endswith(".wav")  or qs_hash['resource'][0].endswith(".mp3") or qs_hash['resource'][0].endswith(".m4a"):
        start_response('200 OK', [('Content-Type', 'audio/mpeg'), ('Content-Length', stats.st_size)])
    elif qs_hash['resource'][0].endswith(".png") or qs_hash['resource'][0].endswith(".jpg") or qs_hash['resource'][0].endswith(".bmp"):
        start_response('200 OK', [('Content-Type', 'image/*'), ('Content-Length', stats.st_size)])

    Then you can place your image and audio files (though no OGG file) in chunk_includes and do this:

    PennController(
        newImage("my image", "http://localhost:3000/server.py?resource=myImage.png")
            .print()
        ,
        newButton("continue", "Continue")
            .print()
            .wait()
    )
    in reply to: Spreadsheet #2774
    Jeremy
    Keymaster

    Hi!

    Try adding "Sentence" , between row => PennController( and newText("rating",row.Sentence): this will give the label Sentence to every item generated by the Template function, so your shuffleSequence can target the items.

    in reply to: html.test.complete element #2754
    Jeremy
    Keymaster

    Hi Jan,

    I’m glad to see that you are using PennController. I can’t determine what is causing the error in your case, as the script seems to be working just fine from the documentation, and your coding also seems appropriate.
    What happens exactly when you leave the line there? What you can do is open your browser’s javascript console (in Firefox: Tools > Web Developer > Web Console; in Chrome: View > Developer > JavaScript Console) and look for any error message that could be related to your issue.

    Best
    Jeremy

    in reply to: Var shufflesequence from Spreadsheet #1805
    Jeremy
    Keymaster

    Hi again,

    It looks like the problem is coming from a missing closing parenthesis in your first line. The bit of code you pasted has this line: var shuffleSequence = seq(randomize("Sentence"); when it should be var shuffleSequence = seq(randomize("Sentence")); (note the two closing parentheses)

    (Also, I see you don’t define a “Sentence” label as the first argument of your PennController() command—is it intentional? You need some trials labeled “Sentence” if that’s your definition of shuffleSequence)

    • This reply was modified 6 years, 3 months ago by Jeremy. Reason: better tagging
    • This reply was modified 6 years, 3 months ago by Jeremy.
    • This reply was modified 6 years, 3 months ago by Jeremy. Reason: Previous message partly replaced with cache version
    Jeremy
    Keymaster

    Hi Matthew,

    A few people have had similar problems when they used a CSV file that contained a byte order mark signaling the file’s encoding. With the .csv file uploaded under chunk_includes in your project, open the editor by clicking edit to the right of the filename, then immediately click on Save and close without bringing any change. That should get rid of the byte order mark but leave the content of your table unaffected.

    Let me know if this solves your problem!

    Best
    Jeremy

Viewing 12 posts - 1 through 12 (of 12 total)