﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Millisecond Forums » Millisecond Forums » Inquisit 5  » Conditional use of a list</title><generator>InstantForum 2017-1 Final</generator><description>Millisecond Forums</description><link>https://forums.millisecond.com/</link><webMaster>Millisecond Forums</webMaster><lastBuildDate>Thu, 28 May 2026 01:18:58 GMT</lastBuildDate><ttl>20</ttl><item><title>Conditional use of a list</title><link>https://forums.millisecond.com/Topic26431.aspx</link><description>Dear all,&lt;br/&gt;&lt;br/&gt;For an adjusted version of the cyberball game I am trying to use a list element within an if statement.&lt;br/&gt;&lt;br/&gt;The idea is that when participants click on a certain player to throw the ball, the ball sometimes is thrown to a different player. Therefore, I created lists.&amp;nbsp;When the participants' response is, for example, "player1label", I want to tell Inquisit to use the list.recipient1. Based on the value of this list I want values to change and the next trial also depends on the value of that list. Right now the script just quits, so obviously something is wrong. I am just not sure how to do this correctly.&lt;br/&gt;&lt;br/&gt;I hope my question is clear, I included my code below.&lt;br/&gt;&lt;br/&gt;&amp;lt;trial 1to2_unpred_motiv&amp;gt;&lt;br/&gt;/ontrialbegin = [values.player = 2]&lt;br/&gt;/ ontrialbegin = [shape.progressbar.width=100%*(values.count_throws/25)]&lt;br/&gt;/ stimulusframes = [1 = 1to2, player1label, player2label, player3label, player4label, durgameinstr, progressbar, text.score]&lt;br/&gt;/ validresponse = (text.player1label, text.player3label, text.player4label)&lt;br/&gt;/ inputdevice = mouse&lt;br/&gt;/ontrialend = [if (trial.1to2_unpred_motiv.response == "player1label") {values.recipient = list.recipient1}]&lt;br/&gt;/ontrialend = [if (trial.1to2_unpred_motiv.response == "player3label") {values.recipient = list.recipient3}]&lt;br/&gt;/ontrialend = [if (trial.1to2_unpred_motiv.response == "player4label") {values.recipient = list.recipient4}]&lt;br/&gt;/ ontrialend = [if (values.recipient == 1){values.count_player2throws += 1; values.count_throws +=1; values.count_21 += 1; values.score -=2}]&lt;br/&gt;/ ontrialend = [if (values.recipient == 3){values.count_player2throws += 1; values.count_throws +=1; values.count_23 += 1; values.score +=2}]&lt;br/&gt;/ ontrialend = [if (values.recipient == 4){values.count_player2throws += 1; values.count_throws +=1; values.count_24 += 1; values.score +=2}]&lt;br/&gt;/ branch = [if (list.recipient1.currentvalue == 1) trial.2to1_unpred_motiv]&lt;br/&gt;/ branch = [if (list.recipient3.currentvalue == 3) trial.2to3_unpred_motiv]&lt;br/&gt;/ branch = [if (list.recipient4.currentvalue == 4) trial.2to4_unpred_motiv]&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Thank you in advance for you answer.&lt;br/&gt;&lt;br/&gt;Kind regards,&lt;br/&gt;&lt;br/&gt;Esther&lt;br/&gt;&lt;br/&gt;</description><pubDate>Thu, 14 Feb 2019 07:16:59 GMT</pubDate><dc:creator>EstherKlinkenberg</dc:creator></item><item><title>RE: Conditional use of a list</title><link>https://forums.millisecond.com/Topic26432.aspx</link><description>&lt;div data-id="26431" class="if-quote-wrapper" unselectable="on" data-guid="1550157084484"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="26431" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="26431" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="26431" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;EstherKlinkenberg - Thursday, February 14, 2019&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-26431"&gt;&lt;div class="if-quote-message-margin"&gt;Dear all,&lt;br/&gt;&lt;br/&gt;For an adjusted version of the cyberball game I am trying to use a list element within an if statement.&lt;br/&gt;&lt;br/&gt;The idea is that when participants click on a certain player to throw the ball, the ball sometimes is thrown to a different player. Therefore, I created lists.&amp;nbsp;When the participants' response is, for example, "player1label", I want to tell Inquisit to use the list.recipient1. Based on the value of this list I want values to change and the next trial also depends on the value of that list. Right now the script just quits, so obviously something is wrong. I am just not sure how to do this correctly.&lt;br/&gt;&lt;br/&gt;I hope my question is clear, I included my code below.&lt;br/&gt;&lt;br/&gt;&amp;lt;trial 1to2_unpred_motiv&amp;gt;&lt;br/&gt;/ontrialbegin = [values.player = 2]&lt;br/&gt;/ ontrialbegin = [shape.progressbar.width=100%*(values.count_throws/25)]&lt;br/&gt;/ stimulusframes = [1 = 1to2, player1label, player2label, player3label, player4label, durgameinstr, progressbar, text.score]&lt;br/&gt;/ validresponse = (text.player1label, text.player3label, text.player4label)&lt;br/&gt;/ inputdevice = mouse&lt;br/&gt;/ontrialend = [if (trial.1to2_unpred_motiv.response == "player1label") {values.recipient = list.recipient1}]&lt;br/&gt;/ontrialend = [if (trial.1to2_unpred_motiv.response == "player3label") {values.recipient = list.recipient3}]&lt;br/&gt;/ontrialend = [if (trial.1to2_unpred_motiv.response == "player4label") {values.recipient = list.recipient4}]&lt;br/&gt;/ ontrialend = [if (values.recipient == 1){values.count_player2throws += 1; values.count_throws +=1; values.count_21 += 1; values.score -=2}]&lt;br/&gt;/ ontrialend = [if (values.recipient == 3){values.count_player2throws += 1; values.count_throws +=1; values.count_23 += 1; values.score +=2}]&lt;br/&gt;/ ontrialend = [if (values.recipient == 4){values.count_player2throws += 1; values.count_throws +=1; values.count_24 += 1; values.score +=2}]&lt;br/&gt;/ branch = [if (list.recipient1.currentvalue == 1) trial.2to1_unpred_motiv]&lt;br/&gt;/ branch = [if (list.recipient3.currentvalue == 3) trial.2to3_unpred_motiv]&lt;br/&gt;/ branch = [if (list.recipient4.currentvalue == 4) trial.2to4_unpred_motiv]&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Thank you in advance for you answer.&lt;br/&gt;&lt;br/&gt;Kind regards,&lt;br/&gt;&lt;br/&gt;Esther&lt;br/&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="26431"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;The code is too incomplete to say anything about it. At a minimum, the actual &amp;lt;list&amp;gt; would be needed. Note that list.recipentX.&lt;strong&gt;currentvalue &lt;/strong&gt;will &lt;strong&gt;not &lt;/strong&gt;sample any value from the list. The way to sample a value from a list would be list.recipientX.&lt;strong&gt;nextvalue&lt;/strong&gt;.&lt;br/&gt;&lt;br/&gt;Also, these sections do not make sense:&lt;br/&gt;&lt;br/&gt;/ontrialend = [if (trial.1to2_unpred_motiv.response == "player1label") {&lt;strong&gt;values.recipient = list.recipient1&lt;/strong&gt;}]&lt;br/&gt;/ontrialend = [if (trial.1to2_unpred_motiv.response == "player3label") {&lt;strong&gt;values.recipient = list.recipient3&lt;/strong&gt;}]&lt;br/&gt;/ontrialend = [if (trial.1to2_unpred_motiv.response == "player4label") {&lt;strong&gt;values.recipient = list.recipient4&lt;/strong&gt;}]&lt;br/&gt;&lt;br/&gt;You're not setting values.recipient to anything here. list.recipientX does not return anything. Again, to sample an item / value from the respective list, use the nextvalue property.&lt;br/&gt;</description><pubDate>Thu, 14 Feb 2019 07:16:59 GMT</pubDate><dc:creator>Dave</dc:creator></item></channel></rss>