Thank you, Dave, for your response. I'm attaching my script. We aim to send information rather than retrieve it from the Python server.
Is it possible to send information via Inquisit, such as in this example: id, shape.indicator.height, text.stim.currentitem?
Here is our script.
<values>
/ viewtime = 3000
/stimnumber = 1
</values>
<expressions>
/ viewtime = values.viewtime
</expressions>
<expt>
/ blocks = [1= viewingtime; 2 = response; 3 = viewingtime; 4 = response]
</expt>
<page startinstr>
^After pressing the spacebar you will see a screen with up and down arrows.
^Pressing the up arrow will increase the amount of this yoghurt you will receive in the session and the down arrow will decrease this amount.
^^You will have 3 seconds to make adjustments to the yoghurt amount you want to consume.
</page>
<instruct>
/ nextkey = (57)
</instruct>
<block viewingtime>
/ onblockbegin = [
values.viewtime = 3000;
shape.indicator.height = 50%;
values.stimnumber = list.stimnumbers.nextindex;
]
/ trials = [1=viewtrial]
/ preinstructions = (startinstr)
/ stop = [
block.viewingtime.elapsedtime >= expressions.viewtime;
]
</block>
<block response>
/ trials = [1=do_POST_request]
</block>
//on the keyboard
//press the UP arrow to increase view time
/ press DOWN arrow to decrease view time
<trial viewtrial>
/ ontrialend = [
if (trial.viewtrial.response == 200) {
shape.indicator.height += 2%;
};
if (trial.viewtrial.response == 208){
shape.indicator.height -= 2%;
};
]
/ stimulusframes = [1=clearscreen, stim, up, down, indicator, small_teaspoon, medium_teaspoon, large_teaspoon]
/ validresponse = (200, 208)
/ timeout = 3000
/ branch = [
trial.viewtrial;
]
</trial>
<picture GET_request>
/ erase = false
</picture>
<trial do_POST_request>
/ ontrialbegin = [
var url = concat("
http://10.8.0.100:8080/?id=", script.subjectid);
url = concat(url, "&height=");
url = concat(url, shape.indicator.height);
url = concat(url, "&sample=");
url = concat(url, text.stim.currentitem);
pciture.GET_request.appenditem(url);
trial.do_POST_request.insertstimulusframe(picture.GET_request, 1);
]
/ trialduration = 50
/ validresponse = (noresponse)
</trial>
//3 items in this example
<list stimnumbers>
/ poolsize = 2
</list>
<text stim>
/ items = ("281", "354")
/ select = values.stimnumber
/ erase = false
</text>
<text up>
/ items = ("↑")
/ erase = false
/ position = (30%, 50%)
</text>
<text down>
/ items = ("↓")
/ erase = false
/ position = (70%, 50%)
</text>
<shape indicator>
/ shape = rectangle
/ color = blue
/ position = (10%, 90%)
/ size = (5%, 8%)
/ erase = false
/ halign = center
/ valign = bottom
</shape>
<picture small_teaspoon>
/ items = ("teaspoonsx2.png")
/ position = (5%, 90%)
/ size = (5%, 8%)
/ erase = false
/ valign = bottom
</picture>
<picture medium_teaspoon>
/ items = ("teaspoonx4.png")
/ position = (5%, 50%)
/ size = (5%, 8%)
/ erase = false
/ valign = bottom
</picture>
<picture large_teaspoon>
/ items = ("teaspoonx8.png")
/ position = (5%, 10%)
/ size = (5%, 8%)
/ erase = false
/ valign = bottom
</picture>
<text anchor_min>
/ items= ("10g")
/erase = false
/ position = (5%, 90%)
/ erase = false
</text>
<text anchor_max>
/ items= ("50g")
/erase = false
/ position = (5%, 10%)
/ erase = false
</text>
<text anchor_middle>
/ items= ("30g")
/erase = false
/ position = (5%, 50%)
/ erase = false
</text>
<data>
/ columns = (date time subject group blocknum blockcode trialnum trialcode response latency text.stim.currentitem shape.indicator.height)
/ items= ("50g")
/erase = false
/ position = (5%, 10%)
/ erase = false
</text>)
/ separatefiles = true
</data>