Xiangyu

Forum Replies Created

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • Xiangyu
    Participant

    Hi Jeremy,

    I have some other questions regarding to the logging participants’ correct response. In my experiment, say I included an additional column “CorrectResp” coding all correct response as “F” or “J”, and I would like to compare this column with participants’ key response. Can I use Javascript to do this? Here is my draft for checking the accuracy of keypress:

    newKey("keypress", "FJ")
        .log()
        .wait(function() {
            // Get the participant's response
            var response = this.keys;
            // Get the correct response from the CSV file
            var correctResponse = variable.CorrectResponse;
            // Check whether the participant's response matches the correct response
            if (response === correctResponse) {
                // Log a correct response
                log("CorrectResponse", 1);
            } else {
                // Log an incorrect response
                log("CorrectResponse", 0);
            }
        })

    I searched the forum and documentation, and find test.pressed() seems to be okay, but I have no idea how to make the function automatically compare the response from participants with the pre-logged correct response in “sentences.csv” file.

    Thanks a lot for your kind help!

    Xiangyu
    Participant

    This part is solved:
    “The display of pictures and sentences are sometimes inconsistent. For example, PCIbex may picture from select the second row and show a sentence is not from second row. I would like the script only allows shuffling blocks and randomize the within-block trials sequences as per the row. PCIbex seems to shuffle too much across the rows.”

    Xiangyu
    Participant

    Hi Jeremy,

    I figured out my questions in using getX(). remove().

    However, I found a more severe problem. After the adoption of

    blocks = [randomize('block1'),randomize('block2'),randomize('block3'),randomize('block4')];
    fisherYates(blocks); // Ibex-internal function that shuffles an array
    Sequence("consent","welcome", "instructions", "blocks",SendResults(), "goodbye");

    The display of pictures and sentences are sometimes inconsistent. For example, PCIbex may picture from select the second row and show a sentence is not from second row. I would like the script only allows shuffling blocks and randomize the within-block trials sequences as per the row. PCIbex seems to shuffle too much across the rows.

    Best,
    Xiangyu

    Xiangyu
    Participant

    Hi Jeremy,

    Thank you so much for pointing me to the fisherYates()! It works with the experiment structure and now I have all elements displayed in between the Introduction and Goodbye.

    I have another experiment-related query regarding how to make images and text invisible after 600 and 2100 milliseconds of delay for printing out. Therefore, I would like to set the display time of the image to 600 milliseconds and then print the TargetSentence visible for 2100 milliseconds, so that when participants are selecting a sentence, they cannot see preceding elements.

    I searched the documentation with the keyword “invisible” and “remove” but the description does not have interaction with the Timer. In summary, I have two questions as follows:
    How can I display an image for only 600 ms and then make it disappear?
    What is the best way to make a TargetSentence visible for 2100 ms and then hide it from participants?

    All the best,
    Xiangyu

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