Forum Replies Created
-
AuthorPosts
-
April 13, 2023 at 5:25 am in reply to: Cannot get the template function to loop over my experiment #10448
Xiangyu
ParticipantHi 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!
April 12, 2023 at 6:36 pm in reply to: Cannot get the template function to loop over my experiment #10447Xiangyu
ParticipantThis 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.”April 12, 2023 at 8:35 am in reply to: Cannot get the template function to loop over my experiment #10445Xiangyu
ParticipantHi 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,
XiangyuApril 12, 2023 at 7:56 am in reply to: Cannot get the template function to loop over my experiment #10444Xiangyu
ParticipantHi 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 -
AuthorPosts