Adding an instructions reminder if participant has invalid keypress?


Author
Message
michelle.r
michelle.r
New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)
Group: Forum Members
Posts: 7, Visits: 27
Hi there, I'm new to Inquisit programming. I'm trying to program the word-sentence association paradigm for youth (Beard & Amir, 2008; Rozenman et al., 2014; 2017). Participants see a fixation cross (500 ms), replaced by a word (500 ms), and then a sentence (stays on the screen until they press the spacebar indicating that they have finished reading the sentence. They then are asked "Was the word related to the sentence?" and then press "1" for yes and "3" for no on the keypad.

I've gotten the bare bones of the task to work. I'd now like to add an additional set of instructions that appear on the screen with incorrect keypress. For example, if a participant accidentally presses anything other than the spacebar when they are done reading the sentence, I'd like the sentence to stay on the screen but an instruction above it to appear prompting them to press the spacebar. Similarly, when they are responding to whether word and sentence are related, if they press anything other than 1 or 3, I'd like the prompt "Was the word related to the sentence? to stay on the screen, but to receive a prompt at the top of the screen indicating "Press 1 for related, 3 for not related." However, I only want these instructions to show up for invalid keypresses, and not appear on the screen when participants follow instructions. I've tried to use conditional branching, but this results in moving on to the next trial and the instructions showing up for that trial. Any advice and reference to other posts would be greatly appreciated!
Attachments
WSAP anx test 3.iqx (10 views, 7.00 KB)
Dave
Dave
Supreme Being (830K reputation)Supreme Being (830K reputation)Supreme Being (830K reputation)Supreme Being (830K reputation)Supreme Being (830K reputation)Supreme Being (830K reputation)Supreme Being (830K reputation)Supreme Being (830K reputation)Supreme Being (830K reputation)
Group: Administrators
Posts: 10K, Visits: 58K
michelle.r - 7/16/2020
Hi there, I'm new to Inquisit programming. I'm trying to program the word-sentence association paradigm for youth (Beard & Amir, 2008; Rozenman et al., 2014; 2017). Participants see a fixation cross (500 ms), replaced by a word (500 ms), and then a sentence (stays on the screen until they press the spacebar indicating that they have finished reading the sentence. They then are asked "Was the word related to the sentence?" and then press "1" for yes and "3" for no on the keypad.

I've gotten the bare bones of the task to work. I'd now like to add an additional set of instructions that appear on the screen with incorrect keypress. For example, if a participant accidentally presses anything other than the spacebar when they are done reading the sentence, I'd like the sentence to stay on the screen but an instruction above it to appear prompting them to press the spacebar. Similarly, when they are responding to whether word and sentence are related, if they press anything other than 1 or 3, I'd like the prompt "Was the word related to the sentence? to stay on the screen, but to receive a prompt at the top of the screen indicating "Press 1 for related, 3 for not related." However, I only want these instructions to show up for invalid keypresses, and not appear on the screen when participants follow instructions. I've tried to use conditional branching, but this results in moving on to the next trial and the instructions showing up for that trial. Any advice and reference to other posts would be greatly appreciated!

You'll basically want to set up your <trial>s like so:

<trial stimuli>
/ ontrialbegin = [
    values.targetword = text.word.currentitem;
    values.targetwordnum = text.word.currentindex;
    values.targetsentence = text.sentence.currentitem;
]
/ stimulustimes = [0=clearscreen, fixation; 500=text.word; 1000=text.sentence]
/ inputdevice = keyboard
/ validresponse = (anyresponse)
/ correctresponse = (57)
/ response = correct
/ errormessage = true(Reminderspace, 0)
/ branch = [
    if (trial.stimuli.response==57) trial.interp
]
/ ontrialend = [trial.stimuli.resetstimulusframes()]
</trial>

Attachments
WSAP anx test 3.iqx (9 views, 7.00 KB)
michelle.r
michelle.r
New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)
Group: Forum Members
Posts: 7, Visits: 27
Dave, thank you so much it worked! (Also thank you for the speedy reply.) 
michelle.r
michelle.r
New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)
Group: Forum Members
Posts: 7, Visits: 27
Hi Dave, apologies. I'm now looking at the data file and have noticed a couple of problems with how I might have set up the syntax.
First, no matter which stimulus shows up first in the task (in my practice case, cat or bomb), cat always shows up as the first stimulus in the data file. This is problematic because we'll need to know exactly which words (threat or neutral) were presented at which times, and eventually there will be 320 distinct trials.
Second, whenever cat shows up first in the task, cat and its associated sentence are then listed in the output as the "word" and "sentence" values across both trials.
Finally, I want to make sure that the trials are presented in random order for each participant at each time point and just want to make sure that the current syntax does that?
Thank you again!
Attachments
WSAP anx test 4.iqx (9 views, 7.00 KB)
Dave
Dave
Supreme Being (830K reputation)Supreme Being (830K reputation)Supreme Being (830K reputation)Supreme Being (830K reputation)Supreme Being (830K reputation)Supreme Being (830K reputation)Supreme Being (830K reputation)Supreme Being (830K reputation)Supreme Being (830K reputation)
Group: Administrators
Posts: 10K, Visits: 58K
michelle.r - 7/16/2020
Hi Dave, apologies. I'm now looking at the data file and have noticed a couple of problems with how I might have set up the syntax.
First, no matter which stimulus shows up first in the task (in my practice case, cat or bomb), cat always shows up as the first stimulus in the data file. This is problematic because we'll need to know exactly which words (threat or neutral) were presented at which times, and eventually there will be 320 distinct trials.
Second, whenever cat shows up first in the task, cat and its associated sentence are then listed in the output as the "word" and "sentence" values across both trials.
Finally, I want to make sure that the trials are presented in random order for each participant at each time point and just want to make sure that the current syntax does that?
Thank you again!

> First, no matter which stimulus shows up first in the task (in my practice case, cat or bomb), cat always shows up as the first stimulus in the data file.

<trial stimuli>
/ ontrialbegin = [
    values.word = text.word.currentitem;
    values.wordnum = text.word.currentindex;
    values.sentence = text.sentence.currentitem;
]
...
</trial>

No items have been selected at that point. The stimuli have yet to be sampled and displayed. Move the above to /ontrialend and everything will be fine.

<trial stimuli>
/ ontrialend = [
  values.word = text.word.currentitem;
  values.wordnum = text.word.currentindex;
  values.sentence = text.sentence.currentitem;
]
...
</trial>

> Finally, I want to make sure that the trials are presented in random order for each participant at each time point and just want to make sure that the current syntax does that?

Yes, the syntax samples the items in random order (without replacement).


Edited Last Month by Dave
michelle.r
michelle.r
New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)
Group: Forum Members
Posts: 7, Visits: 27
Dave - 7/16/2020
michelle.r - 7/16/2020
Hi Dave, apologies. I'm now looking at the data file and have noticed a couple of problems with how I might have set up the syntax.
First, no matter which stimulus shows up first in the task (in my practice case, cat or bomb), cat always shows up as the first stimulus in the data file. This is problematic because we'll need to know exactly which words (threat or neutral) were presented at which times, and eventually there will be 320 distinct trials.
Second, whenever cat shows up first in the task, cat and its associated sentence are then listed in the output as the "word" and "sentence" values across both trials.
Finally, I want to make sure that the trials are presented in random order for each participant at each time point and just want to make sure that the current syntax does that?
Thank you again!

> First, no matter which stimulus shows up first in the task (in my practice case, cat or bomb), cat always shows up as the first stimulus in the data file.

<trial stimuli>
/ ontrialbegin = [
    values.word = text.word.currentitem;
    values.wordnum = text.word.currentindex;
    values.sentence = text.sentence.currentitem;
]
...
</trial>

No items have been selected at that point. The stimuli have yet to be sampled and displayed. Move the above to /ontrialend and everything will be fine.

> Finally, I want to make sure that the trials are presented in random order for each participant at each time point and just want to make sure that the current syntax does that?

Yes, the syntax samples the items in random order (without replacement).


Thank you!
michelle.r
michelle.r
New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)
Group: Forum Members
Posts: 7, Visits: 27
I'm now working on a second (related) task in which each participant will have a set of word and sentence stimuli unique to them - there will likely be very little overlap between participants. I've read several of the posts about using the include and precondition options, but all seem to require modifying the parent script to include the specific subject ID and file name. For example, for participant 1:

<include>
/precondition = [
    script.subjectid ==1001 && script.sessionid ==1]
/ file = "1001_sess1.iqx"
</include>

I am able to make this work. However, with a hundred participants who have new personalized stimuli at each of 3 time points that won't overlap with any of the other participants, I am concerned about how unwieldy it will become to modify the parent script for each participant at each time point. Is there syntax that would essentially indicate that the secondary file chosen with stimuli is dependent on whichever subjectID and session number are indicated at task start without having to modify the parent task each and every time?
Thank you!

Dave
Dave
Supreme Being (830K reputation)Supreme Being (830K reputation)Supreme Being (830K reputation)Supreme Being (830K reputation)Supreme Being (830K reputation)Supreme Being (830K reputation)Supreme Being (830K reputation)Supreme Being (830K reputation)Supreme Being (830K reputation)
Group: Administrators
Posts: 10K, Visits: 58K
michelle.r - 7/16/2020
I'm now working on a second (related) task in which each participant will have a set of word and sentence stimuli unique to them - there will likely be very little overlap between participants. I've read several of the posts about using the include and precondition options, but all seem to require modifying the parent script to include the specific subject ID and file name. For example, for participant 1:

<include>
/precondition = [
    script.subjectid ==1001 && script.sessionid ==1]
/ file = "1001_sess1.iqx"
</include>

I am able to make this work. However, with a hundred participants who have new personalized stimuli at each of 3 time points that won't overlap with any of the other participants, I am concerned about how unwieldy it will become to modify the parent script for each participant at each time point. Is there syntax that would essentially indicate that the secondary file chosen with stimuli is dependent on whichever subjectID and session number are indicated at task start without having to modify the parent task each and every time?
Thank you!

I don't understand why you would have to modify the parent task each and every time?
Dave
Dave
Supreme Being (830K reputation)Supreme Being (830K reputation)Supreme Being (830K reputation)Supreme Being (830K reputation)Supreme Being (830K reputation)Supreme Being (830K reputation)Supreme Being (830K reputation)Supreme Being (830K reputation)Supreme Being (830K reputation)
Group: Administrators
Posts: 10K, Visits: 58K
Dave - 7/17/2020
michelle.r - 7/16/2020
I'm now working on a second (related) task in which each participant will have a set of word and sentence stimuli unique to them - there will likely be very little overlap between participants. I've read several of the posts about using the include and precondition options, but all seem to require modifying the parent script to include the specific subject ID and file name. For example, for participant 1:

<include>
/precondition = [
    script.subjectid ==1001 && script.sessionid ==1]
/ file = "1001_sess1.iqx"
</include>

I am able to make this work. However, with a hundred participants who have new personalized stimuli at each of 3 time points that won't overlap with any of the other participants, I am concerned about how unwieldy it will become to modify the parent script for each participant at each time point. Is there syntax that would essentially indicate that the secondary file chosen with stimuli is dependent on whichever subjectID and session number are indicated at task start without having to modify the parent task each and every time?
Thank you!

I don't understand why you would have to modify the parent task each and every time?

Let's take a minimal example with two subjects.

parent.iqx looks like this

<include>
/ precondition = [
    script.subjectid == 1;
]
/ file = "s1.iqx"
</include>

<include>
/ precondition = [
    script.subjectid == 2;
]
/ file = "s2.iqx"
</include>

<text mytext>
/ items = myitems
</text>

<trial mytrial>
/ stimulusframes = [1=mytext]
/ validresponse = (57)
</trial>

<block myblock>
/ trials = [1-3 = mytrial]
</block>

Suppose you have the items for subject 1 already, so s1.iqx looks like this

<item myitems>
/ 1 = "A"
/ 2 = "B"
/ 3 = "C"
</item>

Further suppose you don't have the items for subject 2 yet, so s2.iqx is empty. This will lead to the script erroring out if you mistakenly enter subject id 2.

Now, once you get the items for subject 2, all you need to do is change s2.iqx, i.e. enter the items -- which, as far as I am able to understand your description, you would have to do anyway. No changes to the parent script are necessary. Whether, as here, you do this for two subjects or for 100 makes no difference in that regard. What am I missing?

Attachments
parent.iqx (8 views, 357 bytes)
s1.iqx (9 views, 58 bytes)
s2.iqx (7 views, 3 bytes)
michelle.r
michelle.r
New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)
Group: Forum Members
Posts: 7, Visits: 27
Dave - 7/17/2020
Dave - 7/17/2020
michelle.r - 7/16/2020
I'm now working on a second (related) task in which each participant will have a set of word and sentence stimuli unique to them - there will likely be very little overlap between participants. I've read several of the posts about using the include and precondition options, but all seem to require modifying the parent script to include the specific subject ID and file name. For example, for participant 1:

<include>
/precondition = [
    script.subjectid ==1001 && script.sessionid ==1]
/ file = "1001_sess1.iqx"
</include>

I am able to make this work. However, with a hundred participants who have new personalized stimuli at each of 3 time points that won't overlap with any of the other participants, I am concerned about how unwieldy it will become to modify the parent script for each participant at each time point. Is there syntax that would essentially indicate that the secondary file chosen with stimuli is dependent on whichever subjectID and session number are indicated at task start without having to modify the parent task each and every time?
Thank you!

I don't understand why you would have to modify the parent task each and every time?

Let's take a minimal example with two subjects.

parent.iqx looks like this

<include>
/ precondition = [
    script.subjectid == 1;
]
/ file = "s1.iqx"
</include>

<include>
/ precondition = [
    script.subjectid == 2;
]
/ file = "s2.iqx"
</include>

<text mytext>
/ items = myitems
</text>

<trial mytrial>
/ stimulusframes = [1=mytext]
/ validresponse = (57)
</trial>

<block myblock>
/ trials = [1-3 = mytrial]
</block>

Suppose you have the items for subject 1 already, so s1.iqx looks like this

<item myitems>
/ 1 = "A"
/ 2 = "B"
/ 3 = "C"
</item>

Further suppose you don't have the items for subject 2 yet, so s2.iqx is empty. This will lead to the script erroring out if you mistakenly enter subject id 2.

Now, once you get the items for subject 2, all you need to do is change s2.iqx, i.e. enter the items -- which, as far as I am able to understand your description, you would have to do anyway. No changes to the parent script are necessary. Whether, as here, you do this for two subjects or for 100 makes no difference in that regard. What am I missing?

Apologies for not being clear. So what you're recommending is what I already have. But this code means that I need a precondition command for every single of the hundred participants at three different time points.  And then each time someone new were enrolled (e.g., subject 2), I'd still have to go into that parent script to add in the file extension for their stimuli. I'm asking if there were a way to pull the subject ID from the initial subject field without listing all 100 participants, like a general command that will pick up on the fact it should link whatever is written in subject ID and session number at the start of the task to a comparable second file in the same folder. Otherwise, my team will be constantly modifying the parent folder by adding the file extension and/or more ID and session numbers, which could lead to errors but would also be onerous.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search