Help, inserting instructions before Block 3


Author
Message
oconnordavid15
oconnordavid15
Respected Member (477 reputation)Respected Member (477 reputation)Respected Member (477 reputation)Respected Member (477 reputation)Respected Member (477 reputation)Respected Member (477 reputation)Respected Member (477 reputation)Respected Member (477 reputation)Respected Member (477 reputation)
Group: Forum Members
Posts: 39, Visits: 63
Dave - 1/25/2022
oconnordavid15 - 1/25/2022
oconnordavid15 - 1/21/2022
oconnordavid15 - 1/21/2022
Dave - 1/21/2022
oconnordavid15 - 1/21/2022
Dave - 1/21/2022
oconnordavid15 - 1/21/2022
Dave - 1/20/2022
oconnordavid15 - 1/20/2022
Hello, I am looking to insert the following instructions 

<page Practice_Trials>
^^ Thank you. For the following trials, the task will stay the same, it is your task to determine which color is more frequent..
</page>


after trial block 2 and before trial block 3.

Sincerely,
David

Set up a block that displays the page per its /pre- or /postinstructions, run that block at the desired point per your <expt>'s /blocks.

Hi Dave, ok ill give it a shot!

It's really simple.

<block post_practice_instructions>
/ preinstructions = (page.Practice_Trials)
</block>

with

<expt experiment>
/blocks = [1=boxtask_pressure9; 2=boxtask_pressure64; 3=post_practice_instructions; 4-13=boxtask_pressure9; 14-23=boxtask_pressure64]
...
</expt>


You're the best Dave, thank you.

Can we have 10 of each trial type but with random selection?

/blocks = [1=boxtask_pressure9; 2=boxtask_pressure64; 3=post_practice_instructions; 4-23=noreplace(boxtask_pressure9,boxtask_pressure64)]

Basics such as random block or trial selection you will find covered in the tutorials, for example.

Amazing! Going to give it a try right no

Works like a charm! Thanks Dave

Hi Dave,

Can we embed logic into the summary data sheet?

For example,

Rather than outputting



In milliseconds, can I input logic to divide by 1000 to get seconds?

From column "draws", can I create a column which has "draws as a % of total boxes"?



Goal for Summary Output

<expressions>
/ elapsedtime_s = script.elapsedtime/1000
</expressions>

and log expressions.elapsedtime_s to the summary data file. Same for the draws. Divide by the relevant N, multiply by 100 if you want percentages.

Hi Dave,

Worked like a charm, the output sheets really coming along. As far as output values, do you know why I am getting half correct output ("selected color") and half incorrect output ("-88") for the output values below?

values.colordecision_trial01,
values.colordecision_trial02,
values.colordecision_trial03,
values.colordecision_trial04,
values.colordecision_trial05,
values.colordecision_trial06,
values.colordecision_trial07,
values.colordecision_trial08,
values.colordecision_trial09,
values.colordecision_trial10,
values.colordecision_trial11,
values.colordecision_trial12,
values.colordecision_trial13,
values.colordecision_trial14,
values.colordecision_trial15,
values.colordecision_trial16,
values.colordecision_trial17,
values.colordecision_trial18,
values.colordecision_trial19,
values.colordecision_trial20,
values.colordecision_trial21,
values.colordecision_trial22
oconnordavid15
oconnordavid15
Respected Member (477 reputation)Respected Member (477 reputation)Respected Member (477 reputation)Respected Member (477 reputation)Respected Member (477 reputation)Respected Member (477 reputation)Respected Member (477 reputation)Respected Member (477 reputation)Respected Member (477 reputation)
Group: Forum Members
Posts: 39, Visits: 63
oconnordavid15 - 1/26/2022
Dave - 1/25/2022
oconnordavid15 - 1/25/2022
oconnordavid15 - 1/21/2022
oconnordavid15 - 1/21/2022
Dave - 1/21/2022
oconnordavid15 - 1/21/2022
Dave - 1/21/2022
oconnordavid15 - 1/21/2022
Dave - 1/20/2022
oconnordavid15 - 1/20/2022
Hello, I am looking to insert the following instructions 

<page Practice_Trials>
^^ Thank you. For the following trials, the task will stay the same, it is your task to determine which color is more frequent..
</page>


after trial block 2 and before trial block 3.

Sincerely,
David

Set up a block that displays the page per its /pre- or /postinstructions, run that block at the desired point per your <expt>'s /blocks.

Hi Dave, ok ill give it a shot!

It's really simple.

<block post_practice_instructions>
/ preinstructions = (page.Practice_Trials)
</block>

with

<expt experiment>
/blocks = [1=boxtask_pressure9; 2=boxtask_pressure64; 3=post_practice_instructions; 4-13=boxtask_pressure9; 14-23=boxtask_pressure64]
...
</expt>


You're the best Dave, thank you.

Can we have 10 of each trial type but with random selection?

/blocks = [1=boxtask_pressure9; 2=boxtask_pressure64; 3=post_practice_instructions; 4-23=noreplace(boxtask_pressure9,boxtask_pressure64)]

Basics such as random block or trial selection you will find covered in the tutorials, for example.

Amazing! Going to give it a try right no

Works like a charm! Thanks Dave

Hi Dave,

Can we embed logic into the summary data sheet?

For example,

Rather than outputting



In milliseconds, can I input logic to divide by 1000 to get seconds?

From column "draws", can I create a column which has "draws as a % of total boxes"?



Goal for Summary Output

<expressions>
/ elapsedtime_s = script.elapsedtime/1000
</expressions>

and log expressions.elapsedtime_s to the summary data file. Same for the draws. Divide by the relevant N, multiply by 100 if you want percentages.

Hi Dave,

Worked like a charm, the output sheets really coming along. As far as output values, do you know why I am getting half correct output ("selected color") and half incorrect output ("-88") for the output values below?

values.colordecision_trial01,
values.colordecision_trial02,
values.colordecision_trial03,
values.colordecision_trial04,
values.colordecision_trial05,
values.colordecision_trial06,
values.colordecision_trial07,
values.colordecision_trial08,
values.colordecision_trial09,
values.colordecision_trial10,
values.colordecision_trial11,
values.colordecision_trial12,
values.colordecision_trial13,
values.colordecision_trial14,
values.colordecision_trial15,
values.colordecision_trial16,
values.colordecision_trial17,
values.colordecision_trial18,
values.colordecision_trial19,
values.colordecision_trial20,
values.colordecision_trial21,
values.colordecision_trial22


Attachments
ninesixtyfourFINAL3RANDOM.iqx (108 views, 133.00 KB)
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: 12K, Visits: 98K
oconnordavid15 - 1/26/2022
oconnordavid15 - 1/26/2022
Dave - 1/25/2022
oconnordavid15 - 1/25/2022
oconnordavid15 - 1/21/2022
oconnordavid15 - 1/21/2022
Dave - 1/21/2022
oconnordavid15 - 1/21/2022
Dave - 1/21/2022
oconnordavid15 - 1/21/2022
Dave - 1/20/2022
oconnordavid15 - 1/20/2022
Hello, I am looking to insert the following instructions 

<page Practice_Trials>
^^ Thank you. For the following trials, the task will stay the same, it is your task to determine which color is more frequent..
</page>


after trial block 2 and before trial block 3.

Sincerely,
David

Set up a block that displays the page per its /pre- or /postinstructions, run that block at the desired point per your <expt>'s /blocks.

Hi Dave, ok ill give it a shot!

It's really simple.

<block post_practice_instructions>
/ preinstructions = (page.Practice_Trials)
</block>

with

<expt experiment>
/blocks = [1=boxtask_pressure9; 2=boxtask_pressure64; 3=post_practice_instructions; 4-13=boxtask_pressure9; 14-23=boxtask_pressure64]
...
</expt>


You're the best Dave, thank you.

Can we have 10 of each trial type but with random selection?

/blocks = [1=boxtask_pressure9; 2=boxtask_pressure64; 3=post_practice_instructions; 4-23=noreplace(boxtask_pressure9,boxtask_pressure64)]

Basics such as random block or trial selection you will find covered in the tutorials, for example.

Amazing! Going to give it a try right no

Works like a charm! Thanks Dave

Hi Dave,

Can we embed logic into the summary data sheet?

For example,

Rather than outputting



In milliseconds, can I input logic to divide by 1000 to get seconds?

From column "draws", can I create a column which has "draws as a % of total boxes"?



Goal for Summary Output

<expressions>
/ elapsedtime_s = script.elapsedtime/1000
</expressions>

and log expressions.elapsedtime_s to the summary data file. Same for the draws. Divide by the relevant N, multiply by 100 if you want percentages.

Hi Dave,

Worked like a charm, the output sheets really coming along. As far as output values, do you know why I am getting half correct output ("selected color") and half incorrect output ("-88") for the output values below?

values.colordecision_trial01,
values.colordecision_trial02,
values.colordecision_trial03,
values.colordecision_trial04,
values.colordecision_trial05,
values.colordecision_trial06,
values.colordecision_trial07,
values.colordecision_trial08,
values.colordecision_trial09,
values.colordecision_trial10,
values.colordecision_trial11,
values.colordecision_trial12,
values.colordecision_trial13,
values.colordecision_trial14,
values.colordecision_trial15,
values.colordecision_trial16,
values.colordecision_trial17,
values.colordecision_trial18,
values.colordecision_trial19,
values.colordecision_trial20,
values.colordecision_trial21,
values.colordecision_trial22


> As far as output values, do you know why I am getting half correct output ("selected color") and half incorrect output ("-88") for the output values below?

Because your if() -else if() syntax is broken; You have statement separators (,) where there shouldn't be any. 


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: 12K, Visits: 98K
Dave - 1/26/2022
oconnordavid15 - 1/26/2022
oconnordavid15 - 1/26/2022
Dave - 1/25/2022
oconnordavid15 - 1/25/2022
oconnordavid15 - 1/21/2022
oconnordavid15 - 1/21/2022
Dave - 1/21/2022
oconnordavid15 - 1/21/2022
Dave - 1/21/2022
oconnordavid15 - 1/21/2022
Dave - 1/20/2022
oconnordavid15 - 1/20/2022
Hello, I am looking to insert the following instructions 

<page Practice_Trials>
^^ Thank you. For the following trials, the task will stay the same, it is your task to determine which color is more frequent..
</page>


after trial block 2 and before trial block 3.

Sincerely,
David

Set up a block that displays the page per its /pre- or /postinstructions, run that block at the desired point per your <expt>'s /blocks.

Hi Dave, ok ill give it a shot!

It's really simple.

<block post_practice_instructions>
/ preinstructions = (page.Practice_Trials)
</block>

with

<expt experiment>
/blocks = [1=boxtask_pressure9; 2=boxtask_pressure64; 3=post_practice_instructions; 4-13=boxtask_pressure9; 14-23=boxtask_pressure64]
...
</expt>


You're the best Dave, thank you.

Can we have 10 of each trial type but with random selection?

/blocks = [1=boxtask_pressure9; 2=boxtask_pressure64; 3=post_practice_instructions; 4-23=noreplace(boxtask_pressure9,boxtask_pressure64)]

Basics such as random block or trial selection you will find covered in the tutorials, for example.

Amazing! Going to give it a try right no

Works like a charm! Thanks Dave

Hi Dave,

Can we embed logic into the summary data sheet?

For example,

Rather than outputting



In milliseconds, can I input logic to divide by 1000 to get seconds?

From column "draws", can I create a column which has "draws as a % of total boxes"?



Goal for Summary Output

<expressions>
/ elapsedtime_s = script.elapsedtime/1000
</expressions>

and log expressions.elapsedtime_s to the summary data file. Same for the draws. Divide by the relevant N, multiply by 100 if you want percentages.

Hi Dave,

Worked like a charm, the output sheets really coming along. As far as output values, do you know why I am getting half correct output ("selected color") and half incorrect output ("-88") for the output values below?

values.colordecision_trial01,
values.colordecision_trial02,
values.colordecision_trial03,
values.colordecision_trial04,
values.colordecision_trial05,
values.colordecision_trial06,
values.colordecision_trial07,
values.colordecision_trial08,
values.colordecision_trial09,
values.colordecision_trial10,
values.colordecision_trial11,
values.colordecision_trial12,
values.colordecision_trial13,
values.colordecision_trial14,
values.colordecision_trial15,
values.colordecision_trial16,
values.colordecision_trial17,
values.colordecision_trial18,
values.colordecision_trial19,
values.colordecision_trial20,
values.colordecision_trial21,
values.colordecision_trial22


> As far as output values, do you know why I am getting half correct output ("selected color") and half incorrect output ("-88") for the output values below?

Because your if() -else if() syntax is broken; You have statement separators (,) where there shouldn't be any. 


This thing is a bit of mess now. You need to be a little more careful to not break things when you add or change things. Beyond a host of minor syntax mistakes, there are some things that do not make sense:
- Why are the color sequences for the 9-box trials all 12 items long? Obviously it's not possible to uncover 12 colored dots when there are only 9 boxes to open.
- It looks like you're not taking into account that you are now randomizing 9-box and 64-box blocks/trials. Block/trial number 3 might be a 9-box block/trial in one run, but a 64-box block/trial in the other. That is, you will end up assigning a color sequence of only 9 (or 12, see above) colors to a 64-box block/trial and -- vice versa -- a color sequence of length 64 to a 9-box block/trial. What's up with that? Is that intentional?

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: 12K, Visits: 98K
Dave - 1/26/2022
Dave - 1/26/2022
oconnordavid15 - 1/26/2022
oconnordavid15 - 1/26/2022
Dave - 1/25/2022
oconnordavid15 - 1/25/2022
oconnordavid15 - 1/21/2022
oconnordavid15 - 1/21/2022
Dave - 1/21/2022
oconnordavid15 - 1/21/2022
Dave - 1/21/2022
oconnordavid15 - 1/21/2022
Dave - 1/20/2022
oconnordavid15 - 1/20/2022
Hello, I am looking to insert the following instructions 

<page Practice_Trials>
^^ Thank you. For the following trials, the task will stay the same, it is your task to determine which color is more frequent..
</page>


after trial block 2 and before trial block 3.

Sincerely,
David

Set up a block that displays the page per its /pre- or /postinstructions, run that block at the desired point per your <expt>'s /blocks.

Hi Dave, ok ill give it a shot!

It's really simple.

<block post_practice_instructions>
/ preinstructions = (page.Practice_Trials)
</block>

with

<expt experiment>
/blocks = [1=boxtask_pressure9; 2=boxtask_pressure64; 3=post_practice_instructions; 4-13=boxtask_pressure9; 14-23=boxtask_pressure64]
...
</expt>


You're the best Dave, thank you.

Can we have 10 of each trial type but with random selection?

/blocks = [1=boxtask_pressure9; 2=boxtask_pressure64; 3=post_practice_instructions; 4-23=noreplace(boxtask_pressure9,boxtask_pressure64)]

Basics such as random block or trial selection you will find covered in the tutorials, for example.

Amazing! Going to give it a try right no

Works like a charm! Thanks Dave

Hi Dave,

Can we embed logic into the summary data sheet?

For example,

Rather than outputting



In milliseconds, can I input logic to divide by 1000 to get seconds?

From column "draws", can I create a column which has "draws as a % of total boxes"?



Goal for Summary Output

<expressions>
/ elapsedtime_s = script.elapsedtime/1000
</expressions>

and log expressions.elapsedtime_s to the summary data file. Same for the draws. Divide by the relevant N, multiply by 100 if you want percentages.

Hi Dave,

Worked like a charm, the output sheets really coming along. As far as output values, do you know why I am getting half correct output ("selected color") and half incorrect output ("-88") for the output values below?

values.colordecision_trial01,
values.colordecision_trial02,
values.colordecision_trial03,
values.colordecision_trial04,
values.colordecision_trial05,
values.colordecision_trial06,
values.colordecision_trial07,
values.colordecision_trial08,
values.colordecision_trial09,
values.colordecision_trial10,
values.colordecision_trial11,
values.colordecision_trial12,
values.colordecision_trial13,
values.colordecision_trial14,
values.colordecision_trial15,
values.colordecision_trial16,
values.colordecision_trial17,
values.colordecision_trial18,
values.colordecision_trial19,
values.colordecision_trial20,
values.colordecision_trial21,
values.colordecision_trial22


> As far as output values, do you know why I am getting half correct output ("selected color") and half incorrect output ("-88") for the output values below?

Because your if() -else if() syntax is broken; You have statement separators (,) where there shouldn't be any. 


This thing is a bit of mess now. You need to be a little more careful to not break things when you add or change things. Beyond a host of minor syntax mistakes, there are some things that do not make sense:
- Why are the color sequences for the 9-box trials all 12 items long? Obviously it's not possible to uncover 12 colored dots when there are only 9 boxes to open.
- It looks like you're not taking into account that you are now randomizing 9-box and 64-box blocks/trials. Block/trial number 3 might be a 9-box block/trial in one run, but a 64-box block/trial in the other. That is, you will end up assigning a color sequence of only 9 (or 12, see above) colors to a 64-box block/trial and -- vice versa -- a color sequence of length 64 to a 9-box block/trial. What's up with that? Is that intentional?

Attached is a major revision of the script, based on my best guesses for the correct / intended behavior. Some open questions remain.
- Compare side by side (use a diff tool)  to the previous, faulty script and work through all the changes until you understand them. Ask specific questions if cannot make sense of a particular change.
- Add comments to the code as you go along. This will help somebody else understand it; it will also help you better understand it if you need to revist the code months or years from now.
- For future additions to the code, think through the consequences any particular change will have (cf. the block randomization mentioned previously)  and take them into account.

Attachments
oconnordavid15
oconnordavid15
Respected Member (477 reputation)Respected Member (477 reputation)Respected Member (477 reputation)Respected Member (477 reputation)Respected Member (477 reputation)Respected Member (477 reputation)Respected Member (477 reputation)Respected Member (477 reputation)Respected Member (477 reputation)
Group: Forum Members
Posts: 39, Visits: 63
Dave - 1/27/2022
Dave - 1/26/2022
Dave - 1/26/2022
oconnordavid15 - 1/26/2022
oconnordavid15 - 1/26/2022
Dave - 1/25/2022
oconnordavid15 - 1/25/2022
oconnordavid15 - 1/21/2022
oconnordavid15 - 1/21/2022
Dave - 1/21/2022
oconnordavid15 - 1/21/2022
Dave - 1/21/2022
oconnordavid15 - 1/21/2022
Dave - 1/20/2022
oconnordavid15 - 1/20/2022
Hello, I am looking to insert the following instructions 

<page Practice_Trials>
^^ Thank you. For the following trials, the task will stay the same, it is your task to determine which color is more frequent..
</page>


after trial block 2 and before trial block 3.

Sincerely,
David

Set up a block that displays the page per its /pre- or /postinstructions, run that block at the desired point per your <expt>'s /blocks.

Hi Dave, ok ill give it a shot!

It's really simple.

<block post_practice_instructions>
/ preinstructions = (page.Practice_Trials)
</block>

with

<expt experiment>
/blocks = [1=boxtask_pressure9; 2=boxtask_pressure64; 3=post_practice_instructions; 4-13=boxtask_pressure9; 14-23=boxtask_pressure64]
...
</expt>


You're the best Dave, thank you.

Can we have 10 of each trial type but with random selection?

/blocks = [1=boxtask_pressure9; 2=boxtask_pressure64; 3=post_practice_instructions; 4-23=noreplace(boxtask_pressure9,boxtask_pressure64)]

Basics such as random block or trial selection you will find covered in the tutorials, for example.

Amazing! Going to give it a try right no

Works like a charm! Thanks Dave

Hi Dave,

Can we embed logic into the summary data sheet?

For example,

Rather than outputting



In milliseconds, can I input logic to divide by 1000 to get seconds?

From column "draws", can I create a column which has "draws as a % of total boxes"?



Goal for Summary Output

<expressions>
/ elapsedtime_s = script.elapsedtime/1000
</expressions>

and log expressions.elapsedtime_s to the summary data file. Same for the draws. Divide by the relevant N, multiply by 100 if you want percentages.

Hi Dave,

Worked like a charm, the output sheets really coming along. As far as output values, do you know why I am getting half correct output ("selected color") and half incorrect output ("-88") for the output values below?

values.colordecision_trial01,
values.colordecision_trial02,
values.colordecision_trial03,
values.colordecision_trial04,
values.colordecision_trial05,
values.colordecision_trial06,
values.colordecision_trial07,
values.colordecision_trial08,
values.colordecision_trial09,
values.colordecision_trial10,
values.colordecision_trial11,
values.colordecision_trial12,
values.colordecision_trial13,
values.colordecision_trial14,
values.colordecision_trial15,
values.colordecision_trial16,
values.colordecision_trial17,
values.colordecision_trial18,
values.colordecision_trial19,
values.colordecision_trial20,
values.colordecision_trial21,
values.colordecision_trial22


> As far as output values, do you know why I am getting half correct output ("selected color") and half incorrect output ("-88") for the output values below?

Because your if() -else if() syntax is broken; You have statement separators (,) where there shouldn't be any. 


This thing is a bit of mess now. You need to be a little more careful to not break things when you add or change things. Beyond a host of minor syntax mistakes, there are some things that do not make sense:
- Why are the color sequences for the 9-box trials all 12 items long? Obviously it's not possible to uncover 12 colored dots when there are only 9 boxes to open.
- It looks like you're not taking into account that you are now randomizing 9-box and 64-box blocks/trials. Block/trial number 3 might be a 9-box block/trial in one run, but a 64-box block/trial in the other. That is, you will end up assigning a color sequence of only 9 (or 12, see above) colors to a 64-box block/trial and -- vice versa -- a color sequence of length 64 to a 9-box block/trial. What's up with that? Is that intentional?

Attached is a major revision of the script, based on my best guesses for the correct / intended behavior. Some open questions remain.
- Compare side by side (use a diff tool)  to the previous, faulty script and work through all the changes until you understand them. Ask specific questions if cannot make sense of a particular change.
- Add comments to the code as you go along. This will help somebody else understand it; it will also help you better understand it if you need to revist the code months or years from now.
- For future additions to the code, think through the consequences any particular change will have (cf. the block randomization mentioned previously)  and take them into account.

It's beautiful, I'm actually astonished at how much help you've given, thank you Dave.

Given each trial has two color choices. Can we make an expression which returns "1" if a choice is correct or "0" if a choice is incorrect? We are looking to output "Accuracy". I am not sure how the logic would work here, given trials are selected randomly.




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: 12K, Visits: 98K
oconnordavid15 - 1/27/2022
Dave - 1/27/2022
Dave - 1/26/2022
Dave - 1/26/2022
oconnordavid15 - 1/26/2022
oconnordavid15 - 1/26/2022
Dave - 1/25/2022
oconnordavid15 - 1/25/2022
oconnordavid15 - 1/21/2022
oconnordavid15 - 1/21/2022
Dave - 1/21/2022
oconnordavid15 - 1/21/2022
Dave - 1/21/2022
oconnordavid15 - 1/21/2022
Dave - 1/20/2022
oconnordavid15 - 1/20/2022
Hello, I am looking to insert the following instructions 

<page Practice_Trials>
^^ Thank you. For the following trials, the task will stay the same, it is your task to determine which color is more frequent..
</page>


after trial block 2 and before trial block 3.

Sincerely,
David

Set up a block that displays the page per its /pre- or /postinstructions, run that block at the desired point per your <expt>'s /blocks.

Hi Dave, ok ill give it a shot!

It's really simple.

<block post_practice_instructions>
/ preinstructions = (page.Practice_Trials)
</block>

with

<expt experiment>
/blocks = [1=boxtask_pressure9; 2=boxtask_pressure64; 3=post_practice_instructions; 4-13=boxtask_pressure9; 14-23=boxtask_pressure64]
...
</expt>


You're the best Dave, thank you.

Can we have 10 of each trial type but with random selection?

/blocks = [1=boxtask_pressure9; 2=boxtask_pressure64; 3=post_practice_instructions; 4-23=noreplace(boxtask_pressure9,boxtask_pressure64)]

Basics such as random block or trial selection you will find covered in the tutorials, for example.

Amazing! Going to give it a try right no

Works like a charm! Thanks Dave

Hi Dave,

Can we embed logic into the summary data sheet?

For example,

Rather than outputting



In milliseconds, can I input logic to divide by 1000 to get seconds?

From column "draws", can I create a column which has "draws as a % of total boxes"?



Goal for Summary Output

<expressions>
/ elapsedtime_s = script.elapsedtime/1000
</expressions>

and log expressions.elapsedtime_s to the summary data file. Same for the draws. Divide by the relevant N, multiply by 100 if you want percentages.

Hi Dave,

Worked like a charm, the output sheets really coming along. As far as output values, do you know why I am getting half correct output ("selected color") and half incorrect output ("-88") for the output values below?

values.colordecision_trial01,
values.colordecision_trial02,
values.colordecision_trial03,
values.colordecision_trial04,
values.colordecision_trial05,
values.colordecision_trial06,
values.colordecision_trial07,
values.colordecision_trial08,
values.colordecision_trial09,
values.colordecision_trial10,
values.colordecision_trial11,
values.colordecision_trial12,
values.colordecision_trial13,
values.colordecision_trial14,
values.colordecision_trial15,
values.colordecision_trial16,
values.colordecision_trial17,
values.colordecision_trial18,
values.colordecision_trial19,
values.colordecision_trial20,
values.colordecision_trial21,
values.colordecision_trial22


> As far as output values, do you know why I am getting half correct output ("selected color") and half incorrect output ("-88") for the output values below?

Because your if() -else if() syntax is broken; You have statement separators (,) where there shouldn't be any. 


This thing is a bit of mess now. You need to be a little more careful to not break things when you add or change things. Beyond a host of minor syntax mistakes, there are some things that do not make sense:
- Why are the color sequences for the 9-box trials all 12 items long? Obviously it's not possible to uncover 12 colored dots when there are only 9 boxes to open.
- It looks like you're not taking into account that you are now randomizing 9-box and 64-box blocks/trials. Block/trial number 3 might be a 9-box block/trial in one run, but a 64-box block/trial in the other. That is, you will end up assigning a color sequence of only 9 (or 12, see above) colors to a 64-box block/trial and -- vice versa -- a color sequence of length 64 to a 9-box block/trial. What's up with that? Is that intentional?

Attached is a major revision of the script, based on my best guesses for the correct / intended behavior. Some open questions remain.
- Compare side by side (use a diff tool)  to the previous, faulty script and work through all the changes until you understand them. Ask specific questions if cannot make sense of a particular change.
- Add comments to the code as you go along. This will help somebody else understand it; it will also help you better understand it if you need to revist the code months or years from now.
- For future additions to the code, think through the consequences any particular change will have (cf. the block randomization mentioned previously)  and take them into account.

It's beautiful, I'm actually astonished at how much help you've given, thank you Dave.

Given each trial has two color choices. Can we make an expression which returns "1" if a choice is correct or "0" if a choice is incorrect? We are looking to output "Accuracy". I am not sure how the logic would work here, given trials are selected randomly.




> We are looking to output "Accuracy". I am not sure how the logic would work here, given trials are selected randomly.

The random selection is irrelevant, you know which trial is which because there is a unique identifier. That is one of the many things I fixed in the script. Take another look at that, please, and go from there.
oconnordavid15
oconnordavid15
Respected Member (477 reputation)Respected Member (477 reputation)Respected Member (477 reputation)Respected Member (477 reputation)Respected Member (477 reputation)Respected Member (477 reputation)Respected Member (477 reputation)Respected Member (477 reputation)Respected Member (477 reputation)
Group: Forum Members
Posts: 39, Visits: 63
Dave - 1/27/2022
oconnordavid15 - 1/27/2022
Dave - 1/27/2022
Dave - 1/26/2022
Dave - 1/26/2022
oconnordavid15 - 1/26/2022
oconnordavid15 - 1/26/2022
Dave - 1/25/2022
oconnordavid15 - 1/25/2022
oconnordavid15 - 1/21/2022
oconnordavid15 - 1/21/2022
Dave - 1/21/2022
oconnordavid15 - 1/21/2022
Dave - 1/21/2022
oconnordavid15 - 1/21/2022
Dave - 1/20/2022
oconnordavid15 - 1/20/2022
Hello, I am looking to insert the following instructions 

<page Practice_Trials>
^^ Thank you. For the following trials, the task will stay the same, it is your task to determine which color is more frequent..
</page>


after trial block 2 and before trial block 3.

Sincerely,
David

Set up a block that displays the page per its /pre- or /postinstructions, run that block at the desired point per your <expt>'s /blocks.

Hi Dave, ok ill give it a shot!

It's really simple.

<block post_practice_instructions>
/ preinstructions = (page.Practice_Trials)
</block>

with

<expt experiment>
/blocks = [1=boxtask_pressure9; 2=boxtask_pressure64; 3=post_practice_instructions; 4-13=boxtask_pressure9; 14-23=boxtask_pressure64]
...
</expt>


You're the best Dave, thank you.

Can we have 10 of each trial type but with random selection?

/blocks = [1=boxtask_pressure9; 2=boxtask_pressure64; 3=post_practice_instructions; 4-23=noreplace(boxtask_pressure9,boxtask_pressure64)]

Basics such as random block or trial selection you will find covered in the tutorials, for example.

Amazing! Going to give it a try right no

Works like a charm! Thanks Dave

Hi Dave,

Can we embed logic into the summary data sheet?

For example,

Rather than outputting



In milliseconds, can I input logic to divide by 1000 to get seconds?

From column "draws", can I create a column which has "draws as a % of total boxes"?



Goal for Summary Output

<expressions>
/ elapsedtime_s = script.elapsedtime/1000
</expressions>

and log expressions.elapsedtime_s to the summary data file. Same for the draws. Divide by the relevant N, multiply by 100 if you want percentages.

Hi Dave,

Worked like a charm, the output sheets really coming along. As far as output values, do you know why I am getting half correct output ("selected color") and half incorrect output ("-88") for the output values below?

values.colordecision_trial01,
values.colordecision_trial02,
values.colordecision_trial03,
values.colordecision_trial04,
values.colordecision_trial05,
values.colordecision_trial06,
values.colordecision_trial07,
values.colordecision_trial08,
values.colordecision_trial09,
values.colordecision_trial10,
values.colordecision_trial11,
values.colordecision_trial12,
values.colordecision_trial13,
values.colordecision_trial14,
values.colordecision_trial15,
values.colordecision_trial16,
values.colordecision_trial17,
values.colordecision_trial18,
values.colordecision_trial19,
values.colordecision_trial20,
values.colordecision_trial21,
values.colordecision_trial22


> As far as output values, do you know why I am getting half correct output ("selected color") and half incorrect output ("-88") for the output values below?

Because your if() -else if() syntax is broken; You have statement separators (,) where there shouldn't be any. 


This thing is a bit of mess now. You need to be a little more careful to not break things when you add or change things. Beyond a host of minor syntax mistakes, there are some things that do not make sense:
- Why are the color sequences for the 9-box trials all 12 items long? Obviously it's not possible to uncover 12 colored dots when there are only 9 boxes to open.
- It looks like you're not taking into account that you are now randomizing 9-box and 64-box blocks/trials. Block/trial number 3 might be a 9-box block/trial in one run, but a 64-box block/trial in the other. That is, you will end up assigning a color sequence of only 9 (or 12, see above) colors to a 64-box block/trial and -- vice versa -- a color sequence of length 64 to a 9-box block/trial. What's up with that? Is that intentional?

Attached is a major revision of the script, based on my best guesses for the correct / intended behavior. Some open questions remain.
- Compare side by side (use a diff tool)  to the previous, faulty script and work through all the changes until you understand them. Ask specific questions if cannot make sense of a particular change.
- Add comments to the code as you go along. This will help somebody else understand it; it will also help you better understand it if you need to revist the code months or years from now.
- For future additions to the code, think through the consequences any particular change will have (cf. the block randomization mentioned previously)  and take them into account.

It's beautiful, I'm actually astonished at how much help you've given, thank you Dave.

Given each trial has two color choices. Can we make an expression which returns "1" if a choice is correct or "0" if a choice is incorrect? We are looking to output "Accuracy". I am not sure how the logic would work here, given trials are selected randomly.




> We are looking to output "Accuracy". I am not sure how the logic would work here, given trials are selected randomly.

The random selection is irrelevant, you know which trial is which because there is a unique identifier. That is one of the many things I fixed in the script. Take another look at that, please, and go from there.

Hi Dave,

I created
/ accuracy_trial01 - 22 under values.

for the logic I put,

if(values.colordecision_trial01 = list.colors_text_trial01;)
{
values.accuracy_trial01 = 1;
}
else
{
values.accuracy_trial01 = 0;
}

and then I added values.accuracy_trial01 - 22 in summary data

How can I fix my logic so it works?

Sorry if im missing something
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: 12K, Visits: 98K
oconnordavid15 - 1/28/2022
Dave - 1/27/2022
oconnordavid15 - 1/27/2022
Dave - 1/27/2022
Dave - 1/26/2022
Dave - 1/26/2022
oconnordavid15 - 1/26/2022
oconnordavid15 - 1/26/2022
Dave - 1/25/2022
oconnordavid15 - 1/25/2022
oconnordavid15 - 1/21/2022
oconnordavid15 - 1/21/2022
Dave - 1/21/2022
oconnordavid15 - 1/21/2022
Dave - 1/21/2022
oconnordavid15 - 1/21/2022
Dave - 1/20/2022
oconnordavid15 - 1/20/2022
Hello, I am looking to insert the following instructions 

<page Practice_Trials>
^^ Thank you. For the following trials, the task will stay the same, it is your task to determine which color is more frequent..
</page>


after trial block 2 and before trial block 3.

Sincerely,
David

Set up a block that displays the page per its /pre- or /postinstructions, run that block at the desired point per your <expt>'s /blocks.

Hi Dave, ok ill give it a shot!

It's really simple.

<block post_practice_instructions>
/ preinstructions = (page.Practice_Trials)
</block>

with

<expt experiment>
/blocks = [1=boxtask_pressure9; 2=boxtask_pressure64; 3=post_practice_instructions; 4-13=boxtask_pressure9; 14-23=boxtask_pressure64]
...
</expt>


You're the best Dave, thank you.

Can we have 10 of each trial type but with random selection?

/blocks = [1=boxtask_pressure9; 2=boxtask_pressure64; 3=post_practice_instructions; 4-23=noreplace(boxtask_pressure9,boxtask_pressure64)]

Basics such as random block or trial selection you will find covered in the tutorials, for example.

Amazing! Going to give it a try right no

Works like a charm! Thanks Dave

Hi Dave,

Can we embed logic into the summary data sheet?

For example,

Rather than outputting



In milliseconds, can I input logic to divide by 1000 to get seconds?

From column "draws", can I create a column which has "draws as a % of total boxes"?



Goal for Summary Output

<expressions>
/ elapsedtime_s = script.elapsedtime/1000
</expressions>

and log expressions.elapsedtime_s to the summary data file. Same for the draws. Divide by the relevant N, multiply by 100 if you want percentages.

Hi Dave,

Worked like a charm, the output sheets really coming along. As far as output values, do you know why I am getting half correct output ("selected color") and half incorrect output ("-88") for the output values below?

values.colordecision_trial01,
values.colordecision_trial02,
values.colordecision_trial03,
values.colordecision_trial04,
values.colordecision_trial05,
values.colordecision_trial06,
values.colordecision_trial07,
values.colordecision_trial08,
values.colordecision_trial09,
values.colordecision_trial10,
values.colordecision_trial11,
values.colordecision_trial12,
values.colordecision_trial13,
values.colordecision_trial14,
values.colordecision_trial15,
values.colordecision_trial16,
values.colordecision_trial17,
values.colordecision_trial18,
values.colordecision_trial19,
values.colordecision_trial20,
values.colordecision_trial21,
values.colordecision_trial22


> As far as output values, do you know why I am getting half correct output ("selected color") and half incorrect output ("-88") for the output values below?

Because your if() -else if() syntax is broken; You have statement separators (,) where there shouldn't be any. 


This thing is a bit of mess now. You need to be a little more careful to not break things when you add or change things. Beyond a host of minor syntax mistakes, there are some things that do not make sense:
- Why are the color sequences for the 9-box trials all 12 items long? Obviously it's not possible to uncover 12 colored dots when there are only 9 boxes to open.
- It looks like you're not taking into account that you are now randomizing 9-box and 64-box blocks/trials. Block/trial number 3 might be a 9-box block/trial in one run, but a 64-box block/trial in the other. That is, you will end up assigning a color sequence of only 9 (or 12, see above) colors to a 64-box block/trial and -- vice versa -- a color sequence of length 64 to a 9-box block/trial. What's up with that? Is that intentional?

Attached is a major revision of the script, based on my best guesses for the correct / intended behavior. Some open questions remain.
- Compare side by side (use a diff tool)  to the previous, faulty script and work through all the changes until you understand them. Ask specific questions if cannot make sense of a particular change.
- Add comments to the code as you go along. This will help somebody else understand it; it will also help you better understand it if you need to revist the code months or years from now.
- For future additions to the code, think through the consequences any particular change will have (cf. the block randomization mentioned previously)  and take them into account.

It's beautiful, I'm actually astonished at how much help you've given, thank you Dave.

Given each trial has two color choices. Can we make an expression which returns "1" if a choice is correct or "0" if a choice is incorrect? We are looking to output "Accuracy". I am not sure how the logic would work here, given trials are selected randomly.




> We are looking to output "Accuracy". I am not sure how the logic would work here, given trials are selected randomly.

The random selection is irrelevant, you know which trial is which because there is a unique identifier. That is one of the many things I fixed in the script. Take another look at that, please, and go from there.

Hi Dave,

I created
/ accuracy_trial01 - 22 under values.

for the logic I put,

if(values.colordecision_trial01 = list.colors_text_trial01;)
{
values.accuracy_trial01 = 1;
}
else
{
values.accuracy_trial01 = 0;
}

and then I added values.accuracy_trial01 - 22 in summary data

How can I fix my logic so it works?

Sorry if im missing something

> if(values.colordecision_trial01 = list.colors_text_trial01;)

= is the assignment operator. It's the wrong operator. You're performing a logical check -- whether the statement is TRUE or FALSE -- and thus need the logical equivalence operator ==. See the operators topic in the documentation.

list.colors_text_trial01 does not return anything. Which property of the list do you (think you) need to query? See the language reference for <list> elements for all available properties.


oconnordavid15
oconnordavid15
Respected Member (477 reputation)Respected Member (477 reputation)Respected Member (477 reputation)Respected Member (477 reputation)Respected Member (477 reputation)Respected Member (477 reputation)Respected Member (477 reputation)Respected Member (477 reputation)Respected Member (477 reputation)
Group: Forum Members
Posts: 39, Visits: 63
Dave - 1/28/2022
oconnordavid15 - 1/28/2022
Dave - 1/27/2022
oconnordavid15 - 1/27/2022
Dave - 1/27/2022
Dave - 1/26/2022
Dave - 1/26/2022
oconnordavid15 - 1/26/2022
oconnordavid15 - 1/26/2022
Dave - 1/25/2022
oconnordavid15 - 1/25/2022
oconnordavid15 - 1/21/2022
oconnordavid15 - 1/21/2022
Dave - 1/21/2022
oconnordavid15 - 1/21/2022
Dave - 1/21/2022
oconnordavid15 - 1/21/2022
Dave - 1/20/2022
oconnordavid15 - 1/20/2022
Hello, I am looking to insert the following instructions 

<page Practice_Trials>
^^ Thank you. For the following trials, the task will stay the same, it is your task to determine which color is more frequent..
</page>


after trial block 2 and before trial block 3.

Sincerely,
David

Set up a block that displays the page per its /pre- or /postinstructions, run that block at the desired point per your <expt>'s /blocks.

Hi Dave, ok ill give it a shot!

It's really simple.

<block post_practice_instructions>
/ preinstructions = (page.Practice_Trials)
</block>

with

<expt experiment>
/blocks = [1=boxtask_pressure9; 2=boxtask_pressure64; 3=post_practice_instructions; 4-13=boxtask_pressure9; 14-23=boxtask_pressure64]
...
</expt>


You're the best Dave, thank you.

Can we have 10 of each trial type but with random selection?

/blocks = [1=boxtask_pressure9; 2=boxtask_pressure64; 3=post_practice_instructions; 4-23=noreplace(boxtask_pressure9,boxtask_pressure64)]

Basics such as random block or trial selection you will find covered in the tutorials, for example.

Amazing! Going to give it a try right no

Works like a charm! Thanks Dave

Hi Dave,

Can we embed logic into the summary data sheet?

For example,

Rather than outputting



In milliseconds, can I input logic to divide by 1000 to get seconds?

From column "draws", can I create a column which has "draws as a % of total boxes"?



Goal for Summary Output

<expressions>
/ elapsedtime_s = script.elapsedtime/1000
</expressions>

and log expressions.elapsedtime_s to the summary data file. Same for the draws. Divide by the relevant N, multiply by 100 if you want percentages.

Hi Dave,

Worked like a charm, the output sheets really coming along. As far as output values, do you know why I am getting half correct output ("selected color") and half incorrect output ("-88") for the output values below?

values.colordecision_trial01,
values.colordecision_trial02,
values.colordecision_trial03,
values.colordecision_trial04,
values.colordecision_trial05,
values.colordecision_trial06,
values.colordecision_trial07,
values.colordecision_trial08,
values.colordecision_trial09,
values.colordecision_trial10,
values.colordecision_trial11,
values.colordecision_trial12,
values.colordecision_trial13,
values.colordecision_trial14,
values.colordecision_trial15,
values.colordecision_trial16,
values.colordecision_trial17,
values.colordecision_trial18,
values.colordecision_trial19,
values.colordecision_trial20,
values.colordecision_trial21,
values.colordecision_trial22


> As far as output values, do you know why I am getting half correct output ("selected color") and half incorrect output ("-88") for the output values below?

Because your if() -else if() syntax is broken; You have statement separators (,) where there shouldn't be any. 


This thing is a bit of mess now. You need to be a little more careful to not break things when you add or change things. Beyond a host of minor syntax mistakes, there are some things that do not make sense:
- Why are the color sequences for the 9-box trials all 12 items long? Obviously it's not possible to uncover 12 colored dots when there are only 9 boxes to open.
- It looks like you're not taking into account that you are now randomizing 9-box and 64-box blocks/trials. Block/trial number 3 might be a 9-box block/trial in one run, but a 64-box block/trial in the other. That is, you will end up assigning a color sequence of only 9 (or 12, see above) colors to a 64-box block/trial and -- vice versa -- a color sequence of length 64 to a 9-box block/trial. What's up with that? Is that intentional?

Attached is a major revision of the script, based on my best guesses for the correct / intended behavior. Some open questions remain.
- Compare side by side (use a diff tool)  to the previous, faulty script and work through all the changes until you understand them. Ask specific questions if cannot make sense of a particular change.
- Add comments to the code as you go along. This will help somebody else understand it; it will also help you better understand it if you need to revist the code months or years from now.
- For future additions to the code, think through the consequences any particular change will have (cf. the block randomization mentioned previously)  and take them into account.

It's beautiful, I'm actually astonished at how much help you've given, thank you Dave.

Given each trial has two color choices. Can we make an expression which returns "1" if a choice is correct or "0" if a choice is incorrect? We are looking to output "Accuracy". I am not sure how the logic would work here, given trials are selected randomly.




> We are looking to output "Accuracy". I am not sure how the logic would work here, given trials are selected randomly.

The random selection is irrelevant, you know which trial is which because there is a unique identifier. That is one of the many things I fixed in the script. Take another look at that, please, and go from there.

Hi Dave,

I created
/ accuracy_trial01 - 22 under values.

for the logic I put,

if(values.colordecision_trial01 = list.colors_text_trial01;)
{
values.accuracy_trial01 = 1;
}
else
{
values.accuracy_trial01 = 0;
}

and then I added values.accuracy_trial01 - 22 in summary data

How can I fix my logic so it works?

Sorry if im missing something

> if(values.colordecision_trial01 = list.colors_text_trial01;)

= is the assignment operator. It's the wrong operator. You're performing a logical check -- whether the statement is TRUE or FALSE -- and thus need the logical equivalence operator ==. See the operators topic in the documentation.

list.colors_text_trial01 does not return anything. Which property of the list do you (think you) need to query? See the language reference for <list> elements for all available properties.


Hi Dave,

Could I query the list for the mean?

if(values.colordecision_trial01 == list.colors_text_trial01.mean;)
{
values.accuracy_trial01 = 1;
}
else
{
values.accuracy_trial01 = 0;
}
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search