Show_if function and adding 'and'
Hi!
I am new to python and opensesame and I have little background in coding so. I am trying to make a cognitive task for android platform. I am stuck at presenting a stimulus target that needs to change according two independent variable.
I have reviewed the beginner tutorials on flanker and cats and dogs task but my situation is a little different.
My task has 3 IVs which are:
- Target position (Left & Right)
- Cue (No cue, neutral cue, valid cue left, valid cue right, invalid cue left, invalid cue right). Although, the above-mentioned link shows only four possible cue condition I've included all possible situation for the cue.
- Target type ( congruent left, congruent right, incongruent left, incongruent right)
For this purpose I wrote the following correction to the sketchpad in line code:
draw image 0 0 "rectanglesetup.jpg" scale=1 center=1 z_index=0 show_if="always"
draw image 192 0 "left_congruent.png" scale=1 center=1 z_index=0 show_if="[arrow_condition]=congruent_left" and ''[cue_condition]=left_congruent"
However, opensesame did'nt saved the script. I have tired this many times but the script never gets saved.
With the above mentioned code I am trying to display the target inside a rectangular box (rectanglesetup.jpg) and the target (which are four types) to be presented inside the rectangular box will vary according to the type of target and the cue condition. The cue condition precedes the Target presentation.
Comments
Hi,
The entire show-if statement should be one string:
See? If you need to quote within the string (in your case you don't though), you can either escape the double quotes with a blackslash (
\"
), or use single quotes ('
).Cheers,
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Thanks Sebastiaan
Though, I am having a different problem in my task. I am going to post a new question.