Millisecond Forums

branching a block

https://forums.millisecond.com/Topic30367.aspx

By xizhouxie - 12/7/2020

We are working on a task where participants watch a video and answer a question about the video by typing in their response. If they type in the wrong response (anything but the letter L), we want them to be told of their mistake and then go back and watch the video again, and then take the little quiz where they provide an answer. If they provide the answer incorrectly for the second time, we want them to see a message telling them the program will quit, and then the study ends. If they type the correct answer initially or on their second attempt, we want them to be able to move on to the block called pretest. 

We have found that for whatever reason, our branching does not work. Below is our code where the branching takes place:

<openended characterresponse>
/ stimulusframes = [1=VidACinstruct]    
/ position = (50, 45)
/ linelength = 75
/ numlines = 2
/ charlimit = 10
/ buttonlabel = "Submit"
/ correctresponse = ("L")
/ validresponse = (anyresponse)
/ branch = [if (contains(openended.characterresponse.response, "L") == true) block.pretest;
if (contains(openended.characterresponse.response, "L") == false && values.incorrectresponsetrial == 0) trial.videoerror1;
if (contains(openended.characterresponse.response, "L") == false && values.incorrectresponsetrial != 0) trial.videoerror2]
</openended>

<trial videoerror1>
/ validkeys = ("k")
/ stimulusframes = [1=VidACerror1; 2= MCCinstructions; ]
/ ontrialend = [openended.characterresponse]
/ ontrialbegin = [values.incorrectresponsetrial = 1]
</trial>


<trial videoerror2>
/ validkeys = ("k")
/ stimulusframes = [1= ACerrormessage]
/ ontrialend = [values.incorrectresponsetrial = 2]
/ quit = [ values.incorrectresponsetrial == 2]
</trial>

<expt Pretest>
/ blocks = [1= consentform; 2=MCCvid; 3= VideoQ;]
</expt>

<values incorrectresponsetrial>
/ incorrectresponsetrial = 0
</values>

We are also confused about what we should put in our experiment. Currently, we have these three blocks, however, even if the person types the correct answer in VideoQ it is not branching to our Pretest block like we want. When we added 4=pretest; 5=demographics; to our experiment, regardless if they answer the question in VideoQ incorrectly, they moved on to our Pretest block.

Please help, we have tried different ways of writing the branching and putting it in different elements and nothing is working. Thank you!
By Dave - 12/7/2020

xizhouxie - 12/7/2020
We are working on a task where participants watch a video and answer a question about the video by typing in their response. If they type in the wrong response (anything but the letter L), we want them to be told of their mistake and then go back and watch the video again, and then take the little quiz where they provide an answer. If they provide the answer incorrectly for the second time, we want them to see a message telling them the program will quit, and then the study ends. If they type the correct answer initially or on their second attempt, we want them to be able to move on to the block called pretest. 

We have found that for whatever reason, our branching does not work. Below is our code where the branching takes place:

<openended characterresponse>
/ stimulusframes = [1=VidACinstruct]    
/ position = (50, 45)
/ linelength = 75
/ numlines = 2
/ charlimit = 10
/ buttonlabel = "Submit"
/ correctresponse = ("L")
/ validresponse = (anyresponse)
/ branch = [if (contains(openended.characterresponse.response, "L") == true) block.pretest;
if (contains(openended.characterresponse.response, "L") == false && values.incorrectresponsetrial == 0) trial.videoerror1;
if (contains(openended.characterresponse.response, "L") == false && values.incorrectresponsetrial != 0) trial.videoerror2]
</openended>

<trial videoerror1>
/ validkeys = ("k")
/ stimulusframes = [1=VidACerror1; 2= MCCinstructions; ]
/ ontrialend = [openended.characterresponse]
/ ontrialbegin = [values.incorrectresponsetrial = 1]
</trial>


<trial videoerror2>
/ validkeys = ("k")
/ stimulusframes = [1= ACerrormessage]
/ ontrialend = [values.incorrectresponsetrial = 2]
/ quit = [ values.incorrectresponsetrial == 2]
</trial>

<expt Pretest>
/ blocks = [1= consentform; 2=MCCvid; 3= VideoQ;]
</expt>

<values incorrectresponsetrial>
/ incorrectresponsetrial = 0
</values>

We are also confused about what we should put in our experiment. Currently, we have these three blocks, however, even if the person types the correct answer in VideoQ it is not branching to our Pretest block like we want. When we added 4=pretest; 5=demographics; to our experiment, regardless if they answer the question in VideoQ incorrectly, they moved on to our Pretest block.

Please help, we have tried different ways of writing the branching and putting it in different elements and nothing is working. Thank you!


<openended characterresponse>
/ stimulusframes = [1=VidACinstruct] 
/ position = (50, 45)
/ linelength = 75
/ numlines = 2
/ charlimit = 10
/ buttonlabel = "Submit"
/ correctresponse = ("L")
/ validresponse = (anyresponse)
/ branch = [if (contains(openended.characterresponse.response, "L") == true) block.pretest;
if (contains(openended.characterresponse.response, "L") == false && values.incorrectresponsetrial == 0) trial.videoerror1;
if (contains(openended.characterresponse.response, "L") == false && values.incorrectresponsetrial != 0) trial.videoerror2]
</openended>

An <openended> element is a <trial>. A trial cannot branch to a block. It can only branch to a trial. Only a block can branch to a different block.
By xizhouxie - 12/7/2020

Dave - 12/7/2020
xizhouxie - 12/7/2020
We are working on a task where participants watch a video and answer a question about the video by typing in their response. If they type in the wrong response (anything but the letter L), we want them to be told of their mistake and then go back and watch the video again, and then take the little quiz where they provide an answer. If they provide the answer incorrectly for the second time, we want them to see a message telling them the program will quit, and then the study ends. If they type the correct answer initially or on their second attempt, we want them to be able to move on to the block called pretest. 

We have found that for whatever reason, our branching does not work. Below is our code where the branching takes place:

<openended characterresponse>
/ stimulusframes = [1=VidACinstruct]    
/ position = (50, 45)
/ linelength = 75
/ numlines = 2
/ charlimit = 10
/ buttonlabel = "Submit"
/ correctresponse = ("L")
/ validresponse = (anyresponse)
/ branch = [if (contains(openended.characterresponse.response, "L") == true) block.pretest;
if (contains(openended.characterresponse.response, "L") == false && values.incorrectresponsetrial == 0) trial.videoerror1;
if (contains(openended.characterresponse.response, "L") == false && values.incorrectresponsetrial != 0) trial.videoerror2]
</openended>

<trial videoerror1>
/ validkeys = ("k")
/ stimulusframes = [1=VidACerror1; 2= MCCinstructions; ]
/ ontrialend = [openended.characterresponse]
/ ontrialbegin = [values.incorrectresponsetrial = 1]
</trial>


<trial videoerror2>
/ validkeys = ("k")
/ stimulusframes = [1= ACerrormessage]
/ ontrialend = [values.incorrectresponsetrial = 2]
/ quit = [ values.incorrectresponsetrial == 2]
</trial>

<expt Pretest>
/ blocks = [1= consentform; 2=MCCvid; 3= VideoQ;]
</expt>

<values incorrectresponsetrial>
/ incorrectresponsetrial = 0
</values>

We are also confused about what we should put in our experiment. Currently, we have these three blocks, however, even if the person types the correct answer in VideoQ it is not branching to our Pretest block like we want. When we added 4=pretest; 5=demographics; to our experiment, regardless if they answer the question in VideoQ incorrectly, they moved on to our Pretest block.

Please help, we have tried different ways of writing the branching and putting it in different elements and nothing is working. Thank you!


<openended characterresponse>
/ stimulusframes = [1=VidACinstruct] 
/ position = (50, 45)
/ linelength = 75
/ numlines = 2
/ charlimit = 10
/ buttonlabel = "Submit"
/ correctresponse = ("L")
/ validresponse = (anyresponse)
/ branch = [if (contains(openended.characterresponse.response, "L") == true) block.pretest;
if (contains(openended.characterresponse.response, "L") == false && values.incorrectresponsetrial == 0) trial.videoerror1;
if (contains(openended.characterresponse.response, "L") == false && values.incorrectresponsetrial != 0) trial.videoerror2]
</openended>

An <openended> element is a <trial>. A trial cannot branch to a block. It can only branch to a trial. Only a block can branch to a different block.

so should i put this intire branch within the block that this trial is in
By Dave - 12/7/2020

xizhouxie - 12/7/2020
Dave - 12/7/2020
xizhouxie - 12/7/2020
We are working on a task where participants watch a video and answer a question about the video by typing in their response. If they type in the wrong response (anything but the letter L), we want them to be told of their mistake and then go back and watch the video again, and then take the little quiz where they provide an answer. If they provide the answer incorrectly for the second time, we want them to see a message telling them the program will quit, and then the study ends. If they type the correct answer initially or on their second attempt, we want them to be able to move on to the block called pretest. 

We have found that for whatever reason, our branching does not work. Below is our code where the branching takes place:

<openended characterresponse>
/ stimulusframes = [1=VidACinstruct]    
/ position = (50, 45)
/ linelength = 75
/ numlines = 2
/ charlimit = 10
/ buttonlabel = "Submit"
/ correctresponse = ("L")
/ validresponse = (anyresponse)
/ branch = [if (contains(openended.characterresponse.response, "L") == true) block.pretest;
if (contains(openended.characterresponse.response, "L") == false && values.incorrectresponsetrial == 0) trial.videoerror1;
if (contains(openended.characterresponse.response, "L") == false && values.incorrectresponsetrial != 0) trial.videoerror2]
</openended>

<trial videoerror1>
/ validkeys = ("k")
/ stimulusframes = [1=VidACerror1; 2= MCCinstructions; ]
/ ontrialend = [openended.characterresponse]
/ ontrialbegin = [values.incorrectresponsetrial = 1]
</trial>


<trial videoerror2>
/ validkeys = ("k")
/ stimulusframes = [1= ACerrormessage]
/ ontrialend = [values.incorrectresponsetrial = 2]
/ quit = [ values.incorrectresponsetrial == 2]
</trial>

<expt Pretest>
/ blocks = [1= consentform; 2=MCCvid; 3= VideoQ;]
</expt>

<values incorrectresponsetrial>
/ incorrectresponsetrial = 0
</values>

We are also confused about what we should put in our experiment. Currently, we have these three blocks, however, even if the person types the correct answer in VideoQ it is not branching to our Pretest block like we want. When we added 4=pretest; 5=demographics; to our experiment, regardless if they answer the question in VideoQ incorrectly, they moved on to our Pretest block.

Please help, we have tried different ways of writing the branching and putting it in different elements and nothing is working. Thank you!


<openended characterresponse>
/ stimulusframes = [1=VidACinstruct] 
/ position = (50, 45)
/ linelength = 75
/ numlines = 2
/ charlimit = 10
/ buttonlabel = "Submit"
/ correctresponse = ("L")
/ validresponse = (anyresponse)
/ branch = [if (contains(openended.characterresponse.response, "L") == true) block.pretest;
if (contains(openended.characterresponse.response, "L") == false && values.incorrectresponsetrial == 0) trial.videoerror1;
if (contains(openended.characterresponse.response, "L") == false && values.incorrectresponsetrial != 0) trial.videoerror2]
</openended>

An <openended> element is a <trial>. A trial cannot branch to a block. It can only branch to a trial. Only a block can branch to a different block.

so should i put this intire branch within the block that this trial is in

Yes. Except at least in the code you posted, whatever block that is is not included and Icannot correct syntax that I do not have.
By Dave - 12/7/2020

Dave - 12/7/2020
xizhouxie - 12/7/2020
Dave - 12/7/2020
xizhouxie - 12/7/2020
We are working on a task where participants watch a video and answer a question about the video by typing in their response. If they type in the wrong response (anything but the letter L), we want them to be told of their mistake and then go back and watch the video again, and then take the little quiz where they provide an answer. If they provide the answer incorrectly for the second time, we want them to see a message telling them the program will quit, and then the study ends. If they type the correct answer initially or on their second attempt, we want them to be able to move on to the block called pretest. 

We have found that for whatever reason, our branching does not work. Below is our code where the branching takes place:

<openended characterresponse>
/ stimulusframes = [1=VidACinstruct]    
/ position = (50, 45)
/ linelength = 75
/ numlines = 2
/ charlimit = 10
/ buttonlabel = "Submit"
/ correctresponse = ("L")
/ validresponse = (anyresponse)
/ branch = [if (contains(openended.characterresponse.response, "L") == true) block.pretest;
if (contains(openended.characterresponse.response, "L") == false && values.incorrectresponsetrial == 0) trial.videoerror1;
if (contains(openended.characterresponse.response, "L") == false && values.incorrectresponsetrial != 0) trial.videoerror2]
</openended>

<trial videoerror1>
/ validkeys = ("k")
/ stimulusframes = [1=VidACerror1; 2= MCCinstructions; ]
/ ontrialend = [openended.characterresponse]
/ ontrialbegin = [values.incorrectresponsetrial = 1]
</trial>


<trial videoerror2>
/ validkeys = ("k")
/ stimulusframes = [1= ACerrormessage]
/ ontrialend = [values.incorrectresponsetrial = 2]
/ quit = [ values.incorrectresponsetrial == 2]
</trial>

<expt Pretest>
/ blocks = [1= consentform; 2=MCCvid; 3= VideoQ;]
</expt>

<values incorrectresponsetrial>
/ incorrectresponsetrial = 0
</values>

We are also confused about what we should put in our experiment. Currently, we have these three blocks, however, even if the person types the correct answer in VideoQ it is not branching to our Pretest block like we want. When we added 4=pretest; 5=demographics; to our experiment, regardless if they answer the question in VideoQ incorrectly, they moved on to our Pretest block.

Please help, we have tried different ways of writing the branching and putting it in different elements and nothing is working. Thank you!


<openended characterresponse>
/ stimulusframes = [1=VidACinstruct] 
/ position = (50, 45)
/ linelength = 75
/ numlines = 2
/ charlimit = 10
/ buttonlabel = "Submit"
/ correctresponse = ("L")
/ validresponse = (anyresponse)
/ branch = [if (contains(openended.characterresponse.response, "L") == true) block.pretest;
if (contains(openended.characterresponse.response, "L") == false && values.incorrectresponsetrial == 0) trial.videoerror1;
if (contains(openended.characterresponse.response, "L") == false && values.incorrectresponsetrial != 0) trial.videoerror2]
</openended>

An <openended> element is a <trial>. A trial cannot branch to a block. It can only branch to a trial. Only a block can branch to a different block.

so should i put this intire branch within the block that this trial is in

Yes. Except at least in the code you posted, whatever block that is is not included and Icannot correct syntax that I do not have.

https://www.millisecond.com/forums/FindPost30349.aspx might be useful as an example.