Ncomeau

Forum Replies Created

Viewing 12 posts - 16 through 27 (of 27 total)
  • Author
    Posts
  • in reply to: Catch Trials #5641
    Ncomeau
    Participant

    Hi Jeremy,

    I added the code above to my script and it works well, thank you so much for the assist.
    While I was setting it up, I noticed a few things that I wanted to ask you about:

    Correct me if I’m wrong, but I think I remember seeing somewhere else on the forums that using a URL with “?withsquare=N” will set up your template with values corresponding to whatever rows are associated with Group = N+1 in the CSV files provided (eg withsquare=0 -> group 1). In my case, I have the pairings of main experiment audio files in one CSV (“main” trial template), and those for the catch trials in another (“catch” trial template). Calling ShuffleInChunks(“main”,14,”catch”,1) in my sequence to have 15 trial “blocks” works as intended. However, I noticed that for some reason every time I reopened the experiment to test, the files associated with the catch trial CSV were being preloaded just fine and the files for the main experiment trials were not. This seemed strange as all of the audio was supposed to be coming from the same successfully downloaded zip file in my AWS bucket. After making sure it wasn’t anything to do with my main.js code, I noticed a counter present under the counter section of my PCIbex experiment page and that it was at a number much higher than any of the group or withsquare numbers I would use. After deleting this, the preloading of all of the files works fine. It breaks after trying to reload the page without deleting it though. Any ideas on how to handle this? I don’t think it was ever an issue before adding this function in…

    The other thing I noticed is that so long as I have the modifyRunningOrder function uncommented, it appears to run (I’ve changed it’s functionality from inserting catch trials every 15 and breaks every 30 to just adding the breaks). Is that to be expected? I thought I would need to do something like modifyRunningOrder(ShuffleInChunks(“main”,14,”catch”,1)) in my sequence to have it add breaks properly. The intended effect is taking place, I’m just curious why it would be running without me explicitly calling it.

    Thanks again for the help, I really appreciate it!

    Nickolas

    in reply to: Catch Trials #5626
    Ncomeau
    Participant

    Hi again Jeremy,

    I have been successfully using modifyRunningOrder() along with the other code you provided above to insert catch trials at a regular interval, and currently all of these trials present the same sounds.

    I’m looking to make the configuration a bit more subtle, but I’ve only ever constructed trial lists like this in Matlab so some questions that I had were:

    Is the set of newTrial elements made using PennController.Template() an array and if so, is it possible to use a template to construct my catch trials in a way similar to how it’s done for the main experiment trials (via rows in a CSV) and then push them into the running order from there? This would allow me to have a few different versions of the catch trials depending on the stimuli that the participant is assigned.

    Also, if the running order passed into modifyRunningOrder() is just an array of elements, would it be possible to, after pushing a catch trial, use something like array.slice() to get the previous “block” worth of trials, randomize it with randomize() and then use array.splice() to put them back into the main running order? This would have the effect of making the catch trial appear randomly in every block rather than at the end of every block.

    Let me know what you think, and if either would be more easily accomplished with the specific labeling method you mentioned in your previous reply.

    Thanks again for all of your help!

    Nickolas

    in reply to: Safari Compatibility #5625
    Ncomeau
    Participant

    Just wanted to confirm that this fixed the issue. Thanks Jeremy!

    in reply to: Safari Compatibility #5615
    Ncomeau
    Participant

    Hi Jeremy,

    It turns out that the fullscreen() function was in fact the culprit. Audio playback seems to work just fine though! Safari is the only browser I’m having fullscreen trouble with so if there isn’t an existing workaround, I will probably just suggest that Mac users use Chrome or Firefox if they can.

    Nickolas

    in reply to: Catch Trials #5596
    Ncomeau
    Participant

    Hi Jeremy,

    I was able to get Pause messages inserted at the proper interval given those instructions on modifying the running order, but now I’m having trouble getting a trial to replace the messages. Is it possible to just perform the same ro[i].push but with a newTrial element instead of html?

    Thanks again for the help!

    Nickolas

    in reply to: html code with embedded script #5574
    Ncomeau
    Participant

    Removing those lines works, but moving the jQuery lines to the top of HeadphoneCheck.js yields “Uncaught TypeError: $(…).prop is not a function” in my PennController debugger error tab right after I play the calibration sound and try to click continue. Things work fine when I leave them at the top of my main.js though.

    in reply to: html code with embedded script #5565
    Ncomeau
    Participant

    Can I refer to HeadphoneCheck.js explicitly if I have it in my scripts (HeadphoneCheckScriptTag.src = “HeadphoneCheck.js”;) or would I need to point it to the URL representing my experiment’s scripts directory?

    in reply to: Variable Math and Text Concatenation #5563
    Ncomeau
    Participant

    Do you have to perform variable/text concatenation like this within a trial? I’m struggling a bit with constructing URL text to pass into my preloadzip function. Ideally I’d be able to insert the value back from getURLParameter (I’d imagine this is a variable and not text?) into some text like “myURL_” + getURLParameter(“withsquare”) +”.zip”, but I always seem to get that invalid URL message in my log…

    in reply to: html code with embedded script #5560
    Ncomeau
    Participant

    Is there any way to customize the displayed instructional text for this implementation of the headphone check?

    Ncomeau
    Participant

    Thank you so much, that code definitely does the job. I was doing some more thinking about how I might achieve having all of results from the participants who completed the experiment in the same results file, and was wondering if it is possible to specify a results file name from within main.js for any given call of SendResults()? I noticed in the github code for penncontroller that you can change the RESULT_FILE_NAME variable in server_conf.py (if you’re running an instance of PCIbex farm on your own server). Is there any way I can get at the equivalent variable that is pointing to the results file in my experiment overview “results” section (contains raw_results and results right now) to specify that, if it gets to the final SendResults() in the sequence, it should write them out to a different file there?

    Ncomeau
    Participant

    Hi again Jeremy,

    I was playing around with this some more last week, and I noticed that leaving a SendResults() function call at the end of each trial still writes out to the results file just fine. It doesn’t overwrite the contents that already exist for the particular run of the experiment, so there is some redundant info left but that would be easy to skip over when it comes time for analysis. Is it possible at all to, from within the main.js script, prevent the manualSendResults prompt from coming up in the browser? I know extensions and userscripts exist for disabling all prompts of this kind, but I’d really only need to stop this one from coming up and interrupting the flow of the experiment for the participant.

    Thanks again for the help with all of this!

    Nickolas

    Ncomeau
    Participant

    Hi Jeremy,

    Thank you so much for the help. I just had a quick follow up question: In an effort to retain as much information generated by a given run of the experiment as possible (and given it’s possible that people will quit early), is there a way to write out to the results file after every trial? I tried placing a SendResults() command at the end of my trials and this seems to do the trick, but there is a prompt in the browser “WARNING: Results have already been sent once. Did you forget to set the ‘manualSendResults’ config option?” that I am not sure how to suppress.

    Thanks again,

    Nickolas

Viewing 12 posts - 16 through 27 (of 27 total)