AndreasK

Forum Replies Created

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • in reply to: (Pre)Loading Resources #6572
    AndreasK
    Participant

    Hi Jeremy,

    Many thanks for your response. I have just sent you the link to the experiment via email.

    Andreas

    in reply to: Output Text based on Selection in Dropdown Menu #5780
    AndreasK
    Participant

    Hi Jeremy,

    Thank you for your explanation and for the code. It works perfectly.

    Andreas

    in reply to: Randomization of Stimuli Across Blocks #5733
    AndreasK
    Participant

    Hi Jeremy,

    The code works perfectly. Thank you very much. I’ve tried it with different numbers of conditions and it works without any problems. I’ve also inserted the .sort(v=>1-2*(Math.random()>=0.5)) from above to make it work in Chrome.

    Thanks again for all your help. This is fantastic.

    Andreas

    in reply to: Randomization of Stimuli Across Blocks #5723
    AndreasK
    Participant

    Hi Jeremy,

    Yes, it works fine now. Will it work with this code in other browsers as well or do I need to change the code according to which browser my participants use?

    Thanks a lot for explaining the code in detail. That was very helpful for me and I understand the syntax much better now.

    I’d have one more question. Is it possible to add another variable here. For example, both the familiar and the unfamiliar accent will be presented in two voices. I’ve created a table below following your example with leftRight and RightLeft:

    AddTable("myTable",leftRight_1,leftRight_2,rightLeft_1,rightLeft_2
    hello_1,hello_2,olleh_1,olleh_2
    world_1,world_2,dlrow_1,dlrow_2
    bye_1,bye_2,eyb_1,eyb_2
    mate_1,mate_2,etam_1,etam_2)

    The numbers following the words indicate the voices (two for familiar/leftRight and two for unfamiliar/RightLeft). Ideally, the randomization would be such that participant A e.g. hears ‘bye_1’, ‘world_2’, ‘etam_1’, ‘olleh_2’. Participant B hears e.g. ‘mate_1’, ‘hello_2’, ‘dlrow_1’ and ‘eyb_2’. Basically, I would like the same randomization as above but now also including the factor ‘voice’. Is there a way of achieving this?

    I’ve tried to edit the code myself but I only achieved partly what I wanted and I had to use two tables. However, this makes a random choice of sentences impossible as I would have to decide which words will be leftRight or rightLeft by allocating them to the corresponding table.

    Andreas

    • This reply was modified 3 years, 10 months ago by AndreasK.
    • This reply was modified 3 years, 10 months ago by AndreasK.
    in reply to: Randomization of Stimuli Across Blocks #5720
    AndreasK
    Participant

    Hi Jeremy,

    Thanks a lot for your response.

    This code is really helpful but, if I understand it correctly, it always chooses ‘hello’ and ‘world’ for the first two trials (i.e. first block) and then ‘eyb’ and ‘etam’ for the third and fourth trial (i.e. second block). The order of the trials within each block varies from participant to participant, which is what I want.

    However, I would also like to vary the words in the first block across participants. For example, Participant A sees ‘hello’ and ‘world’ in the first block (and ‘eyb’ and ‘etam’ in the second block). Participant B sees ‘hello’ and ‘mate’ in the first block. Participant C sees ‘world’ and ‘bye’ in the first block, etc.

    Could you help with that?

    I was also wondering what the order array does exactly. I started my PhD just a year ago and I am not very familiar with coding but trying my best to learn it at the moment. I tried to look up the individual elements: From what I found, the first part creates an array with four undefined slots. These are then mapped with the .map function and sorted with the .sort function. What I can’t follow are the lambda (?) functions inside .map and .sort. From playing with the code, the .map and .sort functions seem to make sure that not only rightLeft words are displayed but I can’t work out why that is.

    I appreciate if you can’t explain this in detail. Can you recommend any books or websites that I could have a look at to learn this type of coding?

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