Skip unless condition is met


Author
Message
JDYates
JDYates
Associate Member (239 reputation)Associate Member (239 reputation)Associate Member (239 reputation)Associate Member (239 reputation)Associate Member (239 reputation)Associate Member (239 reputation)Associate Member (239 reputation)Associate Member (239 reputation)Associate Member (239 reputation)
Group: Forum Members
Posts: 20, Visits: 53
Hi Dave,

Once again asking for help,

I'm trying to get answers from multiple checkboxes to feed into a forced choice picture task

I've wrote all combinations as separate trials so just want to be able to have a skip unless particular answers are given - if I use skip[ IF( and != then all possible trial combinations appear but if I just use skip( and != then every trial skips so I feel like I'm missing something really simple, but I'm happy to feel like an idiot if you're able to help

I have attached all the files with script below

many thanks

Jack
Attachments
Inquisit_help.zip (106 views, 2.00 MB)
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 103K
JDYates - 11/24/2023
Hi Dave,

Once again asking for help,

I'm trying to get answers from multiple checkboxes to feed into a forced choice picture task

I've wrote all combinations as separate trials so just want to be able to have a skip unless particular answers are given - if I use skip[ IF( and != then all possible trial combinations appear but if I just use skip( and != then every trial skips so I feel like I'm missing something really simple, but I'm happy to feel like an idiot if you're able to help

I have attached all the files with script below

many thanks

Jack

You've defined /optionvalues in your checkboxes elements, so the checkboxes' response property returns the numerical value associated with the response given, not the caption. That is when you answer "Going to a club", the checkboxes.q1.response property returns "1", not "Going to a club".
JDYates
JDYates
Associate Member (239 reputation)Associate Member (239 reputation)Associate Member (239 reputation)Associate Member (239 reputation)Associate Member (239 reputation)Associate Member (239 reputation)Associate Member (239 reputation)Associate Member (239 reputation)Associate Member (239 reputation)
Group: Forum Members
Posts: 20, Visits: 53
Dave - 11/24/2023
JDYates - 11/24/2023
Hi Dave,

Once again asking for help,

I'm trying to get answers from multiple checkboxes to feed into a forced choice picture task

I've wrote all combinations as separate trials so just want to be able to have a skip unless particular answers are given - if I use skip[ IF( and != then all possible trial combinations appear but if I just use skip( and != then every trial skips so I feel like I'm missing something really simple, but I'm happy to feel like an idiot if you're able to help

I have attached all the files with script below

many thanks

Jack

You've defined /optionvalues in your checkboxes elements, so the checkboxes' response property returns the numerical value associated with the response given, not the caption. That is when you answer "Going to a club", the checkboxes.q1.response property returns "1", not "Going to a club".

Hi Dave,

Thanks for that I have removed the option values - that was from a previous attempt to make it work. However the issue is still persisting, with IF  it shows all trials and without it, it shows none. Could it also be the way I've wrote out the trials in block.2?

thanks again

Jack
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 103K
JDYates - 11/24/2023
Dave - 11/24/2023
JDYates - 11/24/2023
Hi Dave,

Once again asking for help,

I'm trying to get answers from multiple checkboxes to feed into a forced choice picture task

I've wrote all combinations as separate trials so just want to be able to have a skip unless particular answers are given - if I use skip[ IF( and != then all possible trial combinations appear but if I just use skip( and != then every trial skips so I feel like I'm missing something really simple, but I'm happy to feel like an idiot if you're able to help

I have attached all the files with script below

many thanks

Jack

You've defined /optionvalues in your checkboxes elements, so the checkboxes' response property returns the numerical value associated with the response given, not the caption. That is when you answer "Going to a club", the checkboxes.q1.response property returns "1", not "Going to a club".

Hi Dave,

Thanks for that I have removed the option values - that was from a previous attempt to make it work. However the issue is still persisting, with IF  it shows all trials and without it, it shows none. Could it also be the way I've wrote out the trials in block.2?

thanks again

Jack

Eh, I'm an idiot. You allow (well, require) multiple responses in your checkboxes (5), so the response can never be "Going to a club" (or "1") -- that would only be the case if you allowed / required only a single response.

The response property will return all options selected concatenated with "&", i.e. if you selec the 1st 5 options in checkboxes.q1, the checkboxes.q1.response property will be:

"Going to a club & Bowling & Going to a restaurant & Gambling & Playing board/card/video games with friends"


You can either use contains() to check whether this string includes the response you're interested in (cf. https://www.millisecond.com/support/docs/v5/html/language/expressions/functions.htm under String Functions) or you can work with the selected property, which returns true if the given option was selected and false otherwise. So:

<trial 1_1 >
/ stimulusframes = [1=clearscreen, fixation; 50 = clearscreen, drink1 , nodrink1]
/ inputdevice = mouse
/ validresponse = (drink1, nodrink1)
/ skip = [!checkboxes.q1.selected.1]
/ skip = [!checkboxes.q2.selected.1]
</trial>



Edited Last Year by Dave
JDYates
JDYates
Associate Member (239 reputation)Associate Member (239 reputation)Associate Member (239 reputation)Associate Member (239 reputation)Associate Member (239 reputation)Associate Member (239 reputation)Associate Member (239 reputation)Associate Member (239 reputation)Associate Member (239 reputation)
Group: Forum Members
Posts: 20, Visits: 53
Dave - 11/24/2023
JDYates - 11/24/2023
Dave - 11/24/2023
JDYates - 11/24/2023
Hi Dave,

Once again asking for help,

I'm trying to get answers from multiple checkboxes to feed into a forced choice picture task

I've wrote all combinations as separate trials so just want to be able to have a skip unless particular answers are given - if I use skip[ IF( and != then all possible trial combinations appear but if I just use skip( and != then every trial skips so I feel like I'm missing something really simple, but I'm happy to feel like an idiot if you're able to help

I have attached all the files with script below

many thanks

Jack

You've defined /optionvalues in your checkboxes elements, so the checkboxes' response property returns the numerical value associated with the response given, not the caption. That is when you answer "Going to a club", the checkboxes.q1.response property returns "1", not "Going to a club".

Hi Dave,

Thanks for that I have removed the option values - that was from a previous attempt to make it work. However the issue is still persisting, with IF  it shows all trials and without it, it shows none. Could it also be the way I've wrote out the trials in block.2?

thanks again

Jack

Eh, I'm an idiot. You allow (well, require) multiple responses in your checkboxes (5), so the response can never be "Going to a club" (or "1") -- that would only be the case if you allowed / required only a single response.

The response property will return all options selected concatenated with "&", i.e. if you selec the 1st 5 options in checkboxes.q1, the checkboxes.q1.response property will be:

[code"]Going to a club & Bowling & Going to a restaurant & Gambling & Playing board/card/video games with friends"[/code]

You can either use contains() to check whether this string includes the response you're interested in (cf. https://www.millisecond.com/support/docs/v5/html/language/expressions/functions.htm under String Functions) or you can work with the selected property, which returns true if the given option was selected and false otherwise. So:

<trial 1_1 >
/ stimulusframes = [1=clearscreen, fixation; 50 = clearscreen, drink1 , nodrink1, debug ]
/ inputdevice = mouse
/ validresponse = (drink1, nodrink1)
/ skip = [!checkboxes.q1.selected.1]
/ skip = [!checkboxes.q2.selected.1]
</trial>



Dave you star, works perfectly

thanks very much

Jack
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search