Random selection of image without replacement across surveypages (NOT trials)


Random selection of image without replacement across surveypages (NOT...
Author
Message
wmfang
wmfang
Associate Member (133 reputation)Associate Member (133 reputation)Associate Member (133 reputation)Associate Member (133 reputation)Associate Member (133 reputation)Associate Member (133 reputation)Associate Member (133 reputation)Associate Member (133 reputation)Associate Member (133 reputation)
Group: Forum Members
Posts: 22, Visits: 68
I have four surveypages that each have each have a background image (backgroundImage_ID). I am trying to set it so that the backgroundImage_ID is randomly selected (no replace no repeat) from these four image files: "boise_id_cropped_1.png", "boise_id_cropped_2.png" "boise_id_cropped_3.png",  "boise_id_cropped_4.png". 

How would I do that? I tried using <picture> and <list> but that did not work for <surveypage>.

Thanks in advance for any help!

<surveypage high_econ_high_social_ID>
/ onTrialBegin = [{
  values.nFollowers = round(rand(100000, 500000));
    values.currentBG = values.currentBG_ID1;
}]
/ questions = [
1=profileImage;
2=companyImage_givens;
3=schoolImage_columbia;
4=slider_bar_high_econ_high_social_ID_1]
/ stimulustimes = [
0 = backgroundImage;
0 = background_outer;
0 = background;
0 = nameImage;
0 = schoolText_high_columbia;
0 = companyText_high_givens;
0 = followersText;
0 = connectionsText_high;
0 = locationText_ID;
0 = occupationText_high_JD;
0 = dot_high]
/ nextlabel = "Next"
/ showpagenumbers = false
/ recorddata = true
/ navigationbuttonfontstyle = ("Arial", 12pt, false)
</surveypage>

<surveypage high_econ_high_social_SC>
/ onTrialBegin = [{
  values.nFollowers = round(rand(100000, 500000));
    values.currentBG = values.currentBG_SC1;
}]
/ questions = [
1=profileImage;
2=companyImage_lockheed;
3=schoolImage_harvard;
4=slider_bar_high_econ_high_social_SC_2]
/ stimulusTimes = [
0 = backgroundImage;
0=background_outer;
0=background;
0=nameImage;
0=schoolText_high_harvard;
0=companyText_high_lockheed;
0=followersText;
0=connectionsText_high;
0=locationText_SC;
0=occupationText_high_PhD;
0=dot_high]
/ nextlabel = "Next"
/ showpagenumbers = false
/ recorddata = true
/ navigationbuttonfontstyle = ("Arial", 12pt, false)
</surveypage>

<surveypage high_econ_high_social_AR>
/ onTrialBegin = [{
  values.nFollowers = round(rand(100000, 500000));
    values.currentBG = values.currentBG_AR1;
}]
/ questions = [
1=profileImage;
2=companyImage_washington;
3=schoolImage_stanford;
4=slider_bar_high_econ_high_social_AR_3]
/ stimulusframes = [
0 = backgroundImage;
0=background_outer;
0=background;
0=nameImage;
0=schoolText_high_stanford;
0=companyText_high_washington;
0=followersText;
0=connectionsText_high;
0=locationText_AR;
=occupationText_high_MD;
0=dot_high]
/ nextlabel = "Next"
/ showpagenumbers = false
/ recorddata = true
/ navigationbuttonfontstyle = ("Arial", 12pt, false)
</surveypage>

<surveypage high_econ_high_social_TN>
/ onTrialBegin = [{
  values.nFollowers = round(rand(100000, 500000));
    values.currentBG = values.currentBG_TN1;
}]
/ questions = [
1=profileImage;
2=companyImage_humana;
3=schoolImage_mit;
4=slider_bar_high_econ_high_social_TN_4]
/ stimulusTimes = [
0 = backgroundImage;
0=background_outer;
0=background;
0=nameImage;
0=schoolText_high_mit;
0=companyText_high_humana;
0=followersText;
0=connectionsText_high;
0=locationText_TN;
0=occupationText_high_Eng;
0=dot_high]
/ nextlabel = "Next"
/ showpagenumbers = false
/ recorddata = true
/ navigationbuttonfontstyle = ("Arial", 12pt, false)
</surveypage>


###### HIGH ECON x LOW SOCIAL ######

<surveypage high_econ_low_social_ID>
/ onTrialBegin = [{
  values.nFollowers = round(rand(100000, 500000));
    values.currentBG = values.currentBG_ID2;
}]
/ questions = [
1=profileImage;
2=companyImage_givens;
3=schoolImage_columbia;
4=slider_bar_high_econ_low_social_ID_5]
/ stimulusTimes= [
0=backgroundImage;
0=background_outer;
0=background;
0=nameImage;
0=schoolText_high_columbia;
0=companyText_high_givens;
0=connectionsText_low;
0=locationText_ID;
0=occupationText_high_JD]
/ nextlabel = "Next"
/ showpagenumbers = false
/ recorddata = true
/ navigationbuttonfontstyle = ("Arial", 12pt, false)
</surveypage>


<surveypage high_econ_low_social_SC>
/ onTrialBegin = [{
  values.nFollowers = round(rand(100000, 500000));
    values.currentBG = values.currentBG_SC2;
}]
/ questions = [
1=profileImage;
2=companyImage_lockheed;
3=schoolImage_harvard;
4=slider_bar_high_econ_low_social_SC_6]
/ stimulusTimes = [
0 = backgroundImage;
0=background_outer;
0=background;
0=nameImage;
0=schoolText_high_harvard;
0=companyText_high_lockheed;
0=connectionsText_low;
0=locationText_SC;
0=occupationText_high_PhD]
/ nextlabel = "Next"
/ showpagenumbers = false
/ recorddata = true
/ navigationbuttonfontstyle = ("Arial", 12pt, false)
</surveypage>



<surveypage high_econ_low_social_AR>
/ onTrialBegin = [{
  values.nFollowers = round(rand(100000, 500000));
    values.currentBG = values.currentBG_AR2;
}]
/ questions = [
1=profileImage;
2=companyImage_washington;
3=schoolImage_stanford;
4=slider_bar_high_econ_low_social_AR_7]
/ stimulusTimes = [
0 = backgroundImage;
0=background_outer;
0=background;
0=nameImage;
0=schoolText_high_stanford;
0=companyText_high_washington;
0=connectionsText_low;
0=locationText_AR;
0=occupationText_high_MD]
/ nextlabel = "Next"
/ showpagenumbers = false
/ recorddata = true
/ navigationbuttonfontstyle = ("Arial", 12pt, false)
</surveypage>


<surveypage high_econ_low_social_TN>
/ onTrialBegin = [{
  values.nFollowers = round(rand(100000, 500000));
    values.currentBG = values.currentBG_TN2;
}]
/ questions = [
1=profileImage;
2=companyImage_humana;
3=schoolImage_mit;
4=slider_bar_high_econ_low_social_TN_8]
/ stimulusTimes = [
0 = backgroundImage;
0=background_outer;
0=background;
0=nameImage;
0=schoolText_high_mit;
0=companyText_high_humana;
0=connectionsText_low;
0=locationText_TN;
0=occupationText_high_Eng]
/ nextlabel = "Next"
/ showpagenumbers = false
/ recorddata = true
/ navigationbuttonfontstyle = ("Arial", 12pt, false)
</surveypage>



###### LOW ECON X HIGH SOCIAL ######

<surveypage low_econ_high_social_ID>
/ onTrialBegin = [{
  values.nFollowers = round(rand(100000, 500000));
    values.currentBG = values.currentBG_ID3;
}]
/ questions = [
1=profileImage;
2=companyImage_overhead;
3=schoolImage_boisehs;
4=slider_bar_low_econ_high_social_ID_9]
/ stimulusFrames = [
0=backgroundImage;
0=background_outer;
0=background;
0=nameImage;
0=schoolText_low_boisehs;
0=companyText_low_overhead;
0=followersText;
0=connectionsText_high;
0=locationText_ID;
0=occupationText_low_warehouse;
0 = dot_high]
/ nextlabel = "Next"
/ showpagenumbers = false
/ recorddata = true
/ navigationbuttonfontstyle = ("Arial", 12pt, false)
</surveypage>

<surveypage low_econ_high_social_SC>
/ onTrialBegin = [{
  values.nFollowers = round(rand(100000, 500000));
    values.currentBG = values.currentBG_SC3;
}]
/ questions = [
1=profileImage;
2=companyImage_greenvillecity;
3=schoolImage_SC_college;
4=slider_bar_low_econ_high_social_SC_10]
/ stimulusTimes = [
0 = backgroundImage;
0=background_outer;
0=background;
0=nameImage;
0=schoolText_low_SC_college;
0=companyText_low_greenvillecity;
0=followersText;
0=connectionsText_high;
0=locationText_SC;
0=occupationText_low_bus;
0 = dot_high]
/ nextlabel = "Next"
/ showpagenumbers = false
/ recorddata = true
/ navigationbuttonfontstyle = ("Arial", 12pt, false)
</surveypage>

<surveypage low_econ_high_social_AR>
/ onTrialBegin = [{
  values.nFollowers = round(rand(100000, 500000));
    values.currentBG = values.currentBG_AR3;
}]
/ questions = [
1 =profileImage;
2=companyImage_fayettevilleps;
3=schoolImage_fayettevillehs;
4=slider_bar_low_econ_high_social_AR_11]
/ stimulusTimes = [
0 = backgroundImage;
0=background_outer;
0=background;
0=nameImage;
0=schoolText_low_fayettevillehs;
0=companyText_low_fayettevilleps;
0=followersText;
0=connectionsText_high;
0=locationText_AR;
0=occupationText_low_custodian;
0 = dot_high]
/ nextlabel = "Next"
/ showpagenumbers = false
/ recorddata = true
/ navigationbuttonfontstyle = ("Arial", 12pt, false)
</surveypage>


<surveypage low_econ_high_social_TN>
/ onTrialBegin = [{
  values.nFollowers = round(rand(100000, 500000));
    values.currentBG = values.currentBG_TN3;
}]
/ questions = [
1=profileImage;
2=companyImage_mcdonalds;
3=schoolImage_TN_college;
4=slider_bar_low_econ_high_social_TN_12]
/ stimulusframes = [
0 = backgroundImage;
0=background_outer;
0=background;
0=nameImage;
0=schoolText_low_TN_college;
0=companyText_low_mcdonalds;
0=followersText;
0=connectionsText_high;
0=locationText_TN;
0=occupationText_low_cashier;
0 = dot_high]
/ nextlabel = "Next"
/ showpagenumbers = false
/ recorddata = true
/ navigationbuttonfontstyle = ("Arial", 12pt, false)
</surveypage>


###### LOW ECON X LOW SOCIAL ######

<surveypage low_econ_low_social_ID>
/ onTrialBegin = [{
  values.nFollowers = round(rand(100000, 500000));
    values.currentBG = values.currentBG_ID4;
}]
/ questions = [
1=profileImage;
2=companyImage_overhead;
3=schoolImage_boisehs;
4=slider_bar_low_econ_low_social_ID_13]
/ stimulusTimes = [
0=backgroundImage;
0=background_outer;
0=background;
0=nameImage;
0=schoolText_low_boisehs;
0=companyText_low_overhead;
0=connectionsText_low;
0=locationText_ID;
0=occupationText_low_warehouse]
/ recorddata = true
/ nextlabel = "Next"
/ showpagenumbers = false
/ navigationbuttonfontstyle = ("Arial", 12pt, false)
</surveypage>


<surveypage low_econ_low_social_SC>
/ onTrialBegin = [{
  values.nFollowers = round(rand(100000, 500000));
    values.currentBG = values.currentBG_SC4;
}]
/ questions = [
1=profileImage;
2=companyImage_greenvillecity;
3=schoolImage_SC_college;
4=slider_bar_low_econ_low_social_SC_14]
/ stimulusframes = [
1=background_outer;
2=background;
3=nameImage;
4=schoolText_low_SC_college;
5=companyText_low_greenvillecity;
6=connectionsText_low;
7=locationText_SC;
8=occupationText_low_bus]
/ recorddata = true
/ nextlabel = "Next"
/ showpagenumbers = false
/ navigationbuttonfontstyle = ("Arial", 12pt, false)
</surveypage>


<surveypage low_econ_low_social_AR>
/ onTrialBegin = [{
  values.nFollowers = round(rand(100000, 500000));
    values.currentBG = values.currentBG_AR4;
}]
/ questions = [
2=profileImage;
3=companyImage_fayettevilleps;
4=schoolImage_fayettevillehs;
5=slider_bar_low_econ_low_social_AR_15]
/ stimulusframes = [
1=background_outer;
2=background;
3=nameImage;
4=schoolText_low_fayettevillehs;
5=companyText_low_fayettevilleps;
6=connectionsText_low;
7=locationText_AR;
8=occupationText_low_custodian]
/ recorddata = true
/ nextlabel = "Next"
/ showpagenumbers = false
/ navigationbuttonfontstyle = ("Arial", 12pt, false)
</surveypage>


<surveypage low_econ_low_social_TN>
/ onTrialBegin = [{
  values.nFollowers = round(rand(100000, 500000));
    values.currentBG = values.currentBG_TN4;
}]
/ questions = [
1=profileImage;
2=companyImage_mcdonalds;
3=schoolImage_TN_college;
4=slider_bar_low_econ_low_social_TN_16]
/ stimulusTimes = [
0 = backgroundImage;
0=background_outer;
0=background;
0=nameImage;
0=schoolText_low_TN_college;
0=companyText_low_mcdonalds;
0=connectionsText_low;
0=locationText_AR;
0=occupationText_low_cashier]
/ recorddata = true
/ nextlabel = "Next"
/ showpagenumbers = false
/ navigationbuttonfontstyle = ("Arial", 12pt, false)
</surveypage>


##### BACKGROUND IMAGES ####

<list bg_ID>
/ items = ("boise_id_1.png", "boise_id_2.png", "boise_id_3.png", "boise_id_4.png")
/ selectionmode = noreplacenorepeat
</list>

<list bg_SC>
/ items = ("greenville_sc_1.png", "greenville_sc_2.png", "greenville_sc_3.png", "greenville_sc_4.png")
/ selectionmode = noreplacenorepeat
</list>

<list bg_AR>
/ items = ("fayetteville_ar_1.png", "fayetteville_ar_2.png", "fayetteville_ar_3.png", "fayetteville_ar_4.png")
/ selectionmode = noreplacenorepeat
</list>

<list bg_TN>
/ items = ("chattanooga_tn_1.png", "chattanooga_tn_2.png", "chattanooga_tn_3.png", "chattanooga_tn_4.png")
/ selectionmode = noreplacenorepeat
</list>

#########################################################
# 2️⃣ Assignment Trials (per state)
#########################################################

<trial assignBG_ID>
/ ontrialbegin = [
  values.currentBG_ID1 = list.bg_ID.next();
  values.currentBG_ID2 = list.bg_ID.next();
  values.currentBG_ID3 = list.bg_ID.next();
  values.currentBG_ID4 = list.bg_ID.next();
]
/ timeout = 0
/ validresponse = ()
</trial>

<trial assignBG_SC>
/ ontrialbegin = [
  values.currentBG_SC1 = list.bg_SC.next();
  values.currentBG_SC2 = list.bg_SC.next();
  values.currentBG_SC3 = list.bg_SC.next();
  values.currentBG_SC4 = list.bg_SC.next();
]
/ timeout = 0
/ validresponse = ()
</trial>

<trial assignBG_AR>
/ ontrialbegin = [
  values.currentBG_AR1 = list.bg_AR.next();
  values.currentBG_AR2 = list.bg_AR.next();
  values.currentBG_AR3 = list.bg_AR.next();
  values.currentBG_AR4 = list.bg_AR.next();
]
/ timeout = 0
/ validresponse = ()
</trial>

<trial assignBG_TN>
/ ontrialbegin = [
  values.currentBG_TN1 = list.bg_TN.next();
  values.currentBG_TN2 = list.bg_TN.next();
  values.currentBG_TN3 = list.bg_TN.next();
  values.currentBG_TN4 = list.bg_TN.next();
]
/ timeout = 0
/ validresponse = ()
</trial>


<picture backgroundImage>
/ items = ("<% values.currentBG %>")
/ size = (60, 60)
/ position = (20%, 10%)
</picture>
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Reading This Topic

Explore
Messages
Mentions
Search