Terminating dragdrop trial


Author
Message
Denise
Denise
Associate Member (129 reputation)Associate Member (129 reputation)Associate Member (129 reputation)Associate Member (129 reputation)Associate Member (129 reputation)Associate Member (129 reputation)Associate Member (129 reputation)Associate Member (129 reputation)Associate Member (129 reputation)
Group: Forum Members
Posts: 2, Visits: 51
Dear all,

I am new to Inquisit and currently trying to program a new script with the help of the manual and the forum.

At the moment, I want to do the following (which seems quite simple to me): I have 8 pictures, which are my droptargets, and 8 pictures, which are my dropsources and which shall be dropped onto the targets. There is no correct solution and I do not want to record the data (it is just supposed to be a stimulus setting).

With the help of the following threads https://www.millisecond.com/forums/Topic24644-1.aspxhttps://www.millisecond.com/forums/Topic18181.aspx, and https://www.millisecond.com/forums/Topic25457-1.aspx I have managed to create a page, where all droptargets and dropsources are shown correctly and where I can allocate the 8 sources to the 8 targets. However, after the allocation, the script just does not continue, although in the next step I would like to show a picture with the optimal allocation of the different stimuli. I have tried everything I could think of, but the script just stops there, although all sources have been allocated.

I have experimented with two versions of the script. The first version works exactly as I would like it to work, except for the problem described above. The trial "end" is never reached:

<block myblock>
/ trials = [1 = start; 2 = end]
/ recorddata = false
</block>

<trial start>
/ stimulusframes = [1=Instruction, Target1, Target2, Target3, Target4, Target5, Target6, Target7, Target8, Source1, Source2, Source3, Source4, Source5, Source6, Source7, Source8]
/ inputdevice = dragdrop
/ showmousecursor = true
/ isvalidresponse = [(trial.dragdrop.response == Target1) && (trial.dragdrop.response == Target2) && (trial.dragdrop.response == Target3) && (trial.dragdrop.response == Target4) && (trial.dragdrop.response == Target5) && (trial.dragdrop.response == Target6) && (trial.dragdrop.response == Target7) && (trial.dragdrop.response == Target8)]
/ recorddata = false
</trial>

<trial end>
/ stimulusframes = [1=Solution, Continue]
/ validresponse = (" ")
/ recorddata = false
</trial>
...
 
Based on the thread https://www.millisecond.com/forums/Topic24644-1.aspx I have also created another version of the script, to solve my problem. Still, also with this version I could drag and drop pictures for all eternity, as here again the script does not continue to the last trial. Moreover, with this version I have the problem that once I have allocated a source onto a target and then decide to allocate in on another target, the first target is blocked for all sources for good - except for target no. 4 and no. 8, onto which all sources can be dropped at will:

<block myblock>
/ trials = [1=start]
</block>

<expressions>
/ available_p1_slots = if(mod(values.p1_count,2)==0) true else false
/ available_p2_slots = if(mod(values.p2_count,2)==0) true else false
/ available_p3_slots = if(mod(values.p3_count,2)==0) true else false
/ available_p4_slots = if(mod(values.p4_count,2)==0) true else false
/ available_p5_slots = if(mod(values.p5_count,2)==0) true else false
/ available_p6_slots = if(mod(values.p6_count,2)==0) true else false
/ available_p7_slots = if(mod(values.p7_count,2)==0) true else false
/ available_p8_slots = if(mod(values.p8_count,2)==0) true else false
</expressions>

<values>
/ p1_count = 0
/ p2_count = 0
/ p3_count = 0
/ p4_count = 0
/ p5_count = 0
/ p6_count = 0
/ p7_count = 0
/ p8_count = 0
</values>

<trial start>
/ ontrialbegin = [
values.p1_count=0;
values.p2_count=0;
values.p3_count=0;
values.p4_count=0;
values.p5_count=0;
values.p6_count=0;
values.p7_count=0;
values.p8_count=0;
]
/ branch = [
  trial.mytrial
]
/ trialduration = 0
</trial>

<trial mytrial>
/ ontrialbegin = [

picture.Target1.droptarget = expressions.available_p1_slots;
picture.Target2.droptarget = expressions.available_p2_slots;
picture.Target3.droptarget = expressions.available_p3_slots;
picture.Target4.droptarget = expressions.available_p4_slots;
picture.Target5.droptarget = expressions.available_p5_slots;
picture.Target6.droptarget = expressions.available_p6_slots;
picture.Target7.droptarget = expressions.available_p7_slots;
picture.Target8.droptarget = expressions.available_p8_slots;
]

/ ontrialend = [

picture.Target1.droptarget = expressions.available_p1_slots;
picture.Target2.droptarget = expressions.available_p2_slots;
picture.Target3.droptarget = expressions.available_p3_slots;
picture.Target4.droptarget = expressions.available_p4_slots;
picture.Target5.droptarget = expressions.available_p5_slots;
picture.Target6.droptarget = expressions.available_p6_slots;
picture.Target7.droptarget = expressions.available_p7_slots;
picture.Target8.droptarget = expressions.available_p8_slots;
]

/ stimulustimes = [0 = Instruction, Target1, Target2, Target3, Target4, Target5, Target6, Target7, Target8, Source1, Source2, Source3, Source4, Source5, Source6, Source7, Source8]
/ validresponse = (Target1, Target2, Target3, Target4, Target5, Target6, Target7, Target8)
/ isvalidresponse = [
if (trial.mytrial.response == "Target1")
{
  values.p1_count += 1;
  picture.Target1.droptarget;
}
else if (trial.mytrial.response == "Target2")
{
  values.p2_count += 1;
  picture.Target2.droptarget;
}
else if (trial.mytrial.response == "Target3")
{
  values.p3_count += 1;
  picture.Target3.droptarget;
}
else if (trial.mytrial.response == "Target4")
{
  values.p4_count += 1;
  picture.Target4.droptarget;
}
else if (trial.mytrial.response == "Target5")
{
  values.p5_count += 1;
  picture.Target5.droptarget;
}
else if (trial.mytrial.response == "Target6")
{
  values.p6_count += 1;
  picture.Target6.droptarget;
}
else if (trial.mytrial.response == "Target7")
{
  values.p7_count += 1;
  picture.Target7.droptarget;
}
else if (trial.mytrial.response == "Target8")
{
  values.p8_count += 1;
  picture.Target8.droptarget;
}
else
  true;
]
/ inputdevice = dragdrop
/ branch = [
if ((expressions.available_p1_slots + expressions.available_p2_slots + expressions.available_p3_slots + expressions.available_p4_slots + expressions.available_p5_slots + expressions.available_p6_slots + expressions.available_p7_slots + expressions.available_p8_slots) <= 0) trial.end else trial.mytrial
]
</trial>

<trial end>
/ stimulusframes = [1=Solution, Continue]
/ validresponse = (" ")
</trial>
...

If anybody has a hint for me what I have to improve, I would be very grateful! I apologize, if I have made obvious mistakes.

Many thanks in advance for your help!

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: 104K
Denise - Thursday, January 24, 2019
Dear all,

I am new to Inquisit and currently trying to program a new script with the help of the manual and the forum.

At the moment, I want to do the following (which seems quite simple to me): I have 8 pictures, which are my droptargets, and 8 pictures, which are my dropsources and which shall be dropped onto the targets. There is no correct solution and I do not want to record the data (it is just supposed to be a stimulus setting).

With the help of the following threads https://www.millisecond.com/forums/Topic24644-1.aspxhttps://www.millisecond.com/forums/Topic18181.aspx, and https://www.millisecond.com/forums/Topic25457-1.aspx I have managed to create a page, where all droptargets and dropsources are shown correctly and where I can allocate the 8 sources to the 8 targets. However, after the allocation, the script just does not continue, although in the next step I would like to show a picture with the optimal allocation of the different stimuli. I have tried everything I could think of, but the script just stops there, although all sources have been allocated.

I have experimented with two versions of the script. The first version works exactly as I would like it to work, except for the problem described above. The trial "end" is never reached:

<block myblock>
/ trials = [1 = start; 2 = end]
/ recorddata = false
</block>

<trial start>
/ stimulusframes = [1=Instruction, Target1, Target2, Target3, Target4, Target5, Target6, Target7, Target8, Source1, Source2, Source3, Source4, Source5, Source6, Source7, Source8]
/ inputdevice = dragdrop
/ showmousecursor = true
/ isvalidresponse = [(trial.dragdrop.response == Target1) && (trial.dragdrop.response == Target2) && (trial.dragdrop.response == Target3) && (trial.dragdrop.response == Target4) && (trial.dragdrop.response == Target5) && (trial.dragdrop.response == Target6) && (trial.dragdrop.response == Target7) && (trial.dragdrop.response == Target8)]
/ recorddata = false
</trial>

<trial end>
/ stimulusframes = [1=Solution, Continue]
/ validresponse = (" ")
/ recorddata = false
</trial>
...
 
Based on the thread https://www.millisecond.com/forums/Topic24644-1.aspx I have also created another version of the script, to solve my problem. Still, also with this version I could drag and drop pictures for all eternity, as here again the script does not continue to the last trial. Moreover, with this version I have the problem that once I have allocated a source onto a target and then decide to allocate in on another target, the first target is blocked for all sources for good - except for target no. 4 and no. 8, onto which all sources can be dropped at will:

<block myblock>
/ trials = [1=start]
</block>

<expressions>
/ available_p1_slots = if(mod(values.p1_count,2)==0) true else false
/ available_p2_slots = if(mod(values.p2_count,2)==0) true else false
/ available_p3_slots = if(mod(values.p3_count,2)==0) true else false
/ available_p4_slots = if(mod(values.p4_count,2)==0) true else false
/ available_p5_slots = if(mod(values.p5_count,2)==0) true else false
/ available_p6_slots = if(mod(values.p6_count,2)==0) true else false
/ available_p7_slots = if(mod(values.p7_count,2)==0) true else false
/ available_p8_slots = if(mod(values.p8_count,2)==0) true else false
</expressions>

<values>
/ p1_count = 0
/ p2_count = 0
/ p3_count = 0
/ p4_count = 0
/ p5_count = 0
/ p6_count = 0
/ p7_count = 0
/ p8_count = 0
</values>

<trial start>
/ ontrialbegin = [
values.p1_count=0;
values.p2_count=0;
values.p3_count=0;
values.p4_count=0;
values.p5_count=0;
values.p6_count=0;
values.p7_count=0;
values.p8_count=0;
]
/ branch = [
  trial.mytrial
]
/ trialduration = 0
</trial>

<trial mytrial>
/ ontrialbegin = [

picture.Target1.droptarget = expressions.available_p1_slots;
picture.Target2.droptarget = expressions.available_p2_slots;
picture.Target3.droptarget = expressions.available_p3_slots;
picture.Target4.droptarget = expressions.available_p4_slots;
picture.Target5.droptarget = expressions.available_p5_slots;
picture.Target6.droptarget = expressions.available_p6_slots;
picture.Target7.droptarget = expressions.available_p7_slots;
picture.Target8.droptarget = expressions.available_p8_slots;
]

/ ontrialend = [

picture.Target1.droptarget = expressions.available_p1_slots;
picture.Target2.droptarget = expressions.available_p2_slots;
picture.Target3.droptarget = expressions.available_p3_slots;
picture.Target4.droptarget = expressions.available_p4_slots;
picture.Target5.droptarget = expressions.available_p5_slots;
picture.Target6.droptarget = expressions.available_p6_slots;
picture.Target7.droptarget = expressions.available_p7_slots;
picture.Target8.droptarget = expressions.available_p8_slots;
]

/ stimulustimes = [0 = Instruction, Target1, Target2, Target3, Target4, Target5, Target6, Target7, Target8, Source1, Source2, Source3, Source4, Source5, Source6, Source7, Source8]
/ validresponse = (Target1, Target2, Target3, Target4, Target5, Target6, Target7, Target8)
/ isvalidresponse = [
if (trial.mytrial.response == "Target1")
{
  values.p1_count += 1;
  picture.Target1.droptarget;
}
else if (trial.mytrial.response == "Target2")
{
  values.p2_count += 1;
  picture.Target2.droptarget;
}
else if (trial.mytrial.response == "Target3")
{
  values.p3_count += 1;
  picture.Target3.droptarget;
}
else if (trial.mytrial.response == "Target4")
{
  values.p4_count += 1;
  picture.Target4.droptarget;
}
else if (trial.mytrial.response == "Target5")
{
  values.p5_count += 1;
  picture.Target5.droptarget;
}
else if (trial.mytrial.response == "Target6")
{
  values.p6_count += 1;
  picture.Target6.droptarget;
}
else if (trial.mytrial.response == "Target7")
{
  values.p7_count += 1;
  picture.Target7.droptarget;
}
else if (trial.mytrial.response == "Target8")
{
  values.p8_count += 1;
  picture.Target8.droptarget;
}
else
  true;
]
/ inputdevice = dragdrop
/ branch = [
if ((expressions.available_p1_slots + expressions.available_p2_slots + expressions.available_p3_slots + expressions.available_p4_slots + expressions.available_p5_slots + expressions.available_p6_slots + expressions.available_p7_slots + expressions.available_p8_slots) <= 0) trial.end else trial.mytrial
]
</trial>

<trial end>
/ stimulusframes = [1=Solution, Continue]
/ validresponse = (" ")
</trial>
...

If anybody has a hint for me what I have to improve, I would be very grateful! I apologize, if I have made obvious mistakes.

Many thanks in advance for your help!

If you want to keep things simple, you can do something like this:

<block myblock>
/ trials = [1 = start; 2 = end]
/ recorddata = false
</block>

<trial start>
/ stimulusframes = [1=Target1, Target2, Target3, Target4, Source1, Source2, Source3, Source4, done]
/ inputdevice = dragdrop
/ showmousecursor = true
/ validresponse = (target1, target2, target3, target4, done)
/ isvalidresponse = [
trial.start.response == "done";
]
/ recorddata = false
</trial>

<trial end>
/ stimulusframes = [1=end]
/ validresponse = (" ")
/ recorddata = false
</trial>

<text source1>
/ items = ("S1")
/ dropsource = true
/ position = (20%, 45%)
</text>

<text source2>
/ items = ("S2")
/ dropsource = true
/ position = (40%, 45%)
</text>

<text source3>
/ items = ("S3")
/ dropsource = true
/ position = (60%, 45%)
</text>

<text source4>
/ items = ("S2")
/ dropsource = true
/ position = (80%, 45%)
</text>

<text target1>
/ items = ("T1")
/ droptarget = true
/ position = (20%, 55%)
</text>

<text target2>
/ items = ("T2")
/ droptarget = true
/ position = (40%, 55%)
</text>

<text target3>
/ items = ("T3")
/ droptarget = true
/ position = (60%, 55%)
</text>

<text target4>
/ items = ("T4")
/ droptarget = true
/ position = (80%, 55%)
</text>

<text end>
/ items = ("end")
</text>

<text done>
/ items = ("done")
/ position = (50%, 80%)
</text>

As for the remainder of your code, it is too incomplete in both cases for me to say where the specific mistakes are. You didn't include the actual definitions for the <picture> elements serving as dropsources and -targets, you didn't include the <expressions>, you didn't provide the actual images (i.e. it would not be possible for anyone to actually run the script).

As for

<trial start>
/ stimulusframes = [1=Instruction, Target1, Target2, Target3, Target4, Target5, Target6, Target7, Target8, Source1, Source2, Source3, Source4, Source5, Source6, Source7, Source8]
/ inputdevice = dragdrop
/ showmousecursor = true
/ isvalidresponse = [(trial.dragdrop.response == Target1) && (trial.dragdrop.response == Target2) && (trial.dragdrop.response == Target3) && (trial.dragdrop.response == Target4) && (trial.dragdrop.response == Target5) && (trial.dragdrop.response == Target6) && (trial.dragdrop.response == Target7) && (trial.dragdrop.response == Target8)]
/ recorddata = false
</trial>

the /isvalidresponse definition is puzzling. First, there is no <trial dragdrop> anywhere in that code, and yet that's what you reference for response validation. Second, that /isvalidresponse logic will never evaluate to true because the response cannot be target1 AND target2 AND target3 AND target4 all at the same time. That, in short, is why the trial does not / cannot move on.



Denise
Denise
Associate Member (129 reputation)Associate Member (129 reputation)Associate Member (129 reputation)Associate Member (129 reputation)Associate Member (129 reputation)Associate Member (129 reputation)Associate Member (129 reputation)Associate Member (129 reputation)Associate Member (129 reputation)
Group: Forum Members
Posts: 2, Visits: 51
Thank you very much for the quick help!!

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search