Post by drjonathankim on Aug 5, 2022 11:53:12 GMT
Hi all,
I have run into an issue with using the 'if' and 'if else' commands to define what a table contains, and I was hoping that someone would be able to provide insight. What I want to do is, using the 'var in' command, bring a per-participant numeric value into an experiment and use this to define which table of stimuli an individual will see. The 'var in' side is working perfectly, the issue I'm having is specifically in how to define a table with 'if' and 'if else' statements. It seems that the code wishes for if else statements to either show participants a specific thing or to be modifiers after a table, task, or block is set. As an example for tables, if I had the code
then it would take this as being a table composed of four, two, and one column, and will therefore throw up the error 'ERROR: table_unequal_rows in line: 3'. Similarly, while a simple 'Include tableX.txt' command works, using 'if else' statements to include a specific table returns the same error.
As an example for tasks, if I code the tables separately and then had the task code
then the inclusion of multiple lines referencing a table throws up the error 'ERROR: multiple_tables in line: 6'.
And as an example for blocks, if I code the tasks separately and then had the block code
then it sees 'if' as the task name and throws up the error 'ERROR: non_existing_task_in_block in line: 3... the task 'if' has never been defined as a task.' If instead I had the code
then it doesn't recognise the 'if' statement, returning 'ERROR: unknown_statement in line: 2'. There is always the option to instead make a huge number of experiments that differ only in which table is attached, but I would like to avoid that if possible so as to not have my UI filled with a ton of experiments that each were only used once. Would anyone have any insight into how to deal with this?
I have run into an issue with using the 'if' and 'if else' commands to define what a table contains, and I was hoping that someone would be able to provide insight. What I want to do is, using the 'var in' command, bring a per-participant numeric value into an experiment and use this to define which table of stimuli an individual will see. The 'var in' side is working perfectly, the issue I'm having is specifically in how to define a table with 'if' and 'if else' statements. It seems that the code wishes for if else statements to either show participants a specific thing or to be modifiers after a table, task, or block is set. As an example for tables, if I had the code
table 1
if &stimulus == 1
one two
fi
if &stimulus == 1
one two
fi
As an example for tasks, if I code the tables separately and then had the task code
task 1
if &stimulus == 1
table test1
else
if &stimulus == 2
table test2
fi
if &stimulus == 1
table test1
else
if &stimulus == 2
table test2
fi
And as an example for blocks, if I code the tasks separately and then had the block code
block 1
tasklist
if &stimulus == 1
task1 1
else
if &stimulus == 2
task2 1
fi
end
tasklist
if &stimulus == 1
task1 1
else
if &stimulus == 2
task2 1
fi
end
block instructions
if &stimulus == 1
tasklist
task1 1
else
if &stimulus == 2
tasklist
task2 1
fi
end
if &stimulus == 1
tasklist
task1 1
else
if &stimulus == 2
tasklist
task2 1
fi
end