User Manual: Inquisit Zoo Task


___________________________________________________________________________________________________________________	

											Zoo Task
___________________________________________________________________________________________________________________	


Script Author: Katja Borchert, Ph.D. (katjab@millisecond.com) for Millisecond Software, LLC
Date: 11-04-2022
last updated:  03-18-2024 by K. Borchert (katjab@millisecond.com) for Millisecond Software, LLC

Script Copyright © 03-18-2024 Millisecond Software

___________________________________________________________________________________________________________________
BACKGROUND INFO 	
___________________________________________________________________________________________________________________
This script implements Millisecond Software's computerized version of the 'Zoo Task' by Patel et al (2021).
The Zoo Task is a paper and pencil meta-cognitive problem-solving task -using an animal feeding game
at the zoo- designed for children.

This script allows researchers to run the original paper and pencil task on the computer (with mouse use)
or touchscreens. The default version of this script is sized for ipads IF the screen is large enough. 
If the screen is not large enough,  the script attempts to find the biggest 4:3 area of the screen 
to present the 'zoo page' and notes in the data file the dimensions of the presented 'zoo page'.  
Check section Editable Parameters for more info on this topic. 

A computerized version of the Zoo Task has the advantage that pathlength and path Accuracy are
calculated automatically using the published guidelines by Patel et al (2021).
This script also takes a screenshot of the final zoo pathways that can be used for further 
(manual) analyses. However, this computerized approach limits certain analyses such as 'strategy used'.

Reference:											
Patel, J., Aldercotte, A., Tsapali, M., Serpell, Z. N., Parr, T., & Ellefson, M. R. (2021). The Zoo
Task: A novel metacognitive problem-solving task developed with a sample of African American
children from schools in high poverty communities. Psychological Assessment, 33(8), 795–802.
https://doi.org/10.1037/pas0001033
(when using the Zoo Task, please use this citation)

Additional information as well as original materials can be downloaded here:
source: https://osf.io/c6aq7/
https://osf.io/gkac3/

ZooTask_Booklet.pdf: document that contains the actual task materials
ZooAccuracyCoding_moreDetails.pdf: document that describes how to calculate Trial Accuracy Scores

The Zoo Task is licensed under a Creative Commons Attribution 4.0 International License.
(https://creativecommons.org/licenses/by/4.0/)
___________________________________________________________________________________________________________________
TASK DESCRIPTION	
___________________________________________________________________________________________________________________

Participants are given a map of a zoo with 21 animal enclosures as well as a START and FINISH button.
Their task is to find the shortest path to a provided list of animals (3 rounds with 4,6,8 animals).
Before (after) they can start tracing their path through the zoo, they are asked about their 
confidence that they will find (found) the best path on a 5-point Likert scale using a set of five smiley faces.

In this script: Participants see the zoo map as well as the list of animals when making the prospective 
confidence judgment. However, The Start button of the zoo map is inactived until a prosepective
judgment is made. Once the zoo map is activated, the prospective judgment cannot be changed anymore.
When tracing the path through the zoo, participants are asked to keep to the zoo's pathways and not
take shortcuts through the animal enclosures. This scripts will alert participants if a perimeter breach
is detected and participants are asked to return to a red circle (back on the zoo's pathway).

///////////////////////////////////////////////////////
!Important Note on Finger/Stylus Use for Task
///////////////////////////////////////////////////////
This script runs best if the mouse is used to trace the path throughout the zoo.
The script can be run via finger touch as well, however, the script does not track if a
finger/stylus leaves the screen and touches down somewhere else (circumventing making a path).
In these instances the resulting maps (screenshots) might show a 'jumping' pattern from 
enclosure to enclosure right through other animal enclosures indicating that participants
didn't actually trace the path as requested but instead hopped around.


___________________________________________________________________________________________________________________	
DURATION 
___________________________________________________________________________________________________________________	
the default set-up of the script takes appr. 8 minutes to complete

___________________________________________________________________________________________________________________	
DATA FILE INFORMATION 
___________________________________________________________________________________________________________________
The default data stored in the data files are:

(1) Raw data file: 'zootask_raw*.iqdat' (a separate file for each participant)

build:						The specific Inquisit version used (the 'build') that was run
computer.platform:			the platform the script was run on (win/mac/ios/android)
date, time: 				date and time script was run 
subject:					with the current subject id
group: 						with the current group id
session:					with the current session id

//Screen Setup:
(parameter) runAbsoluteSizes:		true (1) = should run absolutely sized canvas (see parameters- canvasHeight_inmm)
									false (0) = should use proportionally sized canvas (uses width = 4/3*screenHeight)
								
canvasAdjustments:					NA: not applicable => parameters- runAbsoluteSize was set to 'false'
									0: parameters- runAbsoluteSize was set to 'true' and screen size was large enough
									1: parameters- runAbsoluteSize was set to 'true' BUT screen size was too small and 
									adjustments had to be made

activeCanvasHeight_inmm:			the width of the active canvas in mm 
activeCanvasWidth_inmm:				the height of the active canvas in mm 
display.canvasHeight:				the height of the active canvas in pixels
display.canvasWidth:				the width of the active canvas in pixels

zooPic_width_inmm:					the width of the zoo picture in mm
zooPic_height_inmm:					the height of the zoo picture in mm


blockcode, blocknum:		the name and number of the current block (built-in Inquisit variable)
trialcode, trialnum: 		the name and number of the currently recorded trial (built-in Inquisit variable)
								Note: trialnum is a built-in Inquisit variable; it counts all trials run; even those
								that do not store data to the data file. 

//Inquisit built-in DV variables
response:					the response of participant for the recorded trial
correct:					correctness of response (1 = correct, 0 = error)
latency:					response latency (in ms); measured from: onset of trial



////////custom variables:

roundCounter: 				tracks the number of rounds run
	
//Ratings DVs:
prospectiveJudgment: 		stores the final prospective judgment rating (1= definitely no to 5 = definitely yes) 
retrospectiveJudgment: 		stores the final retrospective judgment rating (1= definitely no to 5 = definitely yes) 

////Animal Feeding Task:
numberOfTargets:			stores the number of target animals to feed in the current round
remainingTargets: 			a string variable that stores all the target animals that still need to be feed
animal:						if an animal feeding circle is hit, this variable stores the animal name

visitedLocations: 			a string variable that stores all visited locations (including start and finish) in the order they were visited
visitedTargets: 			a string variable that stores all the visited target animals in the order they were visited
visitedNontargets:			a string variable that stores all the visited nontarget animals in the order they were visited
							Note: visited animal = feeding circle of that animal was reached
							
targetCounter: 				tracks the number of target animals visited

targetRepeatCounter: 		tracks how often participant revisited a target animal
							Note: this script only counts revisits as repeated visits if a different location was
							registered in the meantime.
							
nontargetCounter: 			tracks how often participant visited (including revisits) a nontarget animal

pathCorrectionCounter:		tracks how often participant receive a 'perimeter breach' warning
							This could be because they tried to shortcut through the enclosure
							or simply because they reached the computer-enforced enclosure boundaries by accident
							
pathCorrection: 			1 = this trial resulted in a path correction; 0 = otherwise

rsp: 						stores the current response made (e.g. feedingstation reached)
rsp_timestamp: 				the timestamp (in ms) of the response (relative to script onset)
rsp_RT:						the response time (in ms) of the current response (relative to round onset)					


//Accuracy Calculations:
//source: Source: see file 'ZooAccuracyCoding_MoreDetails.pdf' downloaded from https://osf.io/c6aq7/

start_percentweightage:		the %weightage assigned to reaching the start and finish buttons
							"Start and Finish have both been given an average weightage for any given trial and is equal to
							weightage of 1/(total number of points to visit) (p.4, also see table2)"
							
							Example: Round1; 
							points to visit = 4 animals + Start + Finish = 6
							 %weightage = 1/(number of target animals + start + Finish) = 1/6
							

unitweight:					the %weightage assigned to a horizontal distance of 1 in the current round
							This number is used to calculate the %weightage of all TARGET animals (as well as start button
							and finish button) in a given round. The further an animal is too the start-finishline,
							the higher the %weightage for this particular animal.
							
							Example: round1 has 4 target animals (see table2 for H-Distances) 
							Penguins: H-Dist = 6
							Polar bears: H-Dist = 5
							Birds: H-Dist= 1
							Snakes: H-Dist = 3
							Sum of all H-Dist = 6 + 5 + 1 + 3 = 15; 
							Mean=15/4 = 3.75 = start_hdist; assigned to Start and Finish for round1	
							unitweight = start_percentweightage/start_hdist = 0.167/3.75 = 0.044
							=> this unitweight can now by multiplied by the H-Dist for each animal
							Penguins: H-Dist = 6      => %weightage = 6*0.044 = 0.26
							Polar bears: H-Dist = 5   => %weightage = 5*0.044 = 0.22
							Birds: H-Dist= 1		  => %weightage = 1*0.044 = 0.044
							Snakes: H-Dist = 3        => %weightage = 3*0.044 = 0.13
							
net_weightage: 				the sum of all %weightages of the actually visited TARGET animals for the given round
							See table 2 for all theoretical %weightages assigned to each target animal in the default trials.
							Note: The net_weightage is 1 if all target animals (as well as start and finish button) are 
							visited
						
pathlength: 				the calculated pathlength
							Note: the calculation of pathlength takes advantage of the horizontal/vertical locations
							of the animals' feeding stations posted in table1 (and based on figure 3).
							
							For each round, the script calculates the lengths of each path segment from one visited LOCATION
							(!not just the target animals plus start and finish!) to the next
							by adding the horizontal and vertical differences  '(horizontal differences) + (vertical differences)'
							of the two locations and then sums up all path segment lengths to calculate the final pathlength.
							
							Example: participants visits Start->Penguins->Polar Bears->Birds->Snakes->Finish (round1)
							
							Start: V7, H2
							Penguins: V2, H4 => Segment1 = abs(7-2) + abs(2-4) = 5 + 2 = 7
							Polar bears: V3,H6 => Segment2 = abs(2-3) + abs(4-6) = 1 + 2 = 3
							Birds: V7,H6 => Segment2 = abs(3-7) + abs(6-6) = 4 + 0 = 4
							Snakes: V5,H9 => Segment3 = abs(7-5) + abs(6-9) = 2 + 3 = 5
							Finish: V7,H11 => Segment2 = abs(5-7) + abs(9-11) = 2 + 2 = 4
							Total Length = 7 + 3 + 4 + 5 + 4 = 23
							
							IMPORTANT NOTE: The pathlength in this script is based on all locations visited. 
							If participants visit more than just the target animals, the probability
							is higher that the chosen pathlength will be longer than the shortest possible one 
							(BUT: this is NOT the case if the extra nontarget locations are on the direct path 
							to the next target location!). A longer path length will penalize the Accuracy Score.
							
minPathLength: 				the shortest path length for the current round
							Note: the shortest path lengths for the three default trials are provided in document
							'ZooAccuracyCoding_MoreDetails.pdf' (p.6)
							/minPathLength_round1 = 23      //one possible shortest path: penguins, polarbears, birds, snakes
							/minPathLength_round2 = 23		//one possible shortest path: seals, zebras, horses, cheetahs, lions, monkeys
							/minPathLength_round3 = 25		//one possible shortest path: jellyfish, walrus, fish, llamas, goats, pandas, cows, elephants
							
pathACC:					path Accuracy
							Source: see file 'ZooAccuracyCoding_MoreDetails.pdf' downloaded from https://osf.io/c6aq7/
							"The accuracy score is based on the path-length chosen, the number of required animals visited 
							and their relative distance from the start point. (p.1)"
							=> the accuracy score depends on 'pathlength' adjusted by 'net_weightage'
							pathACC = 1 IF: the shortest path was chosen AND all the target animals were visited
							

////Timing Variables
A = time (in ms) it took participant to make last/final prospective judgment
B = time (in ms) it took for participant to press the Start button (after making final prospective judgment)
C = time (in ms) it took for participant to reach the Finish Button (after starting the zoo visit)
D = time (in ms) it took for participant to make final retrospective judgment (after finishing the zoo visit)
E = time (in ms) it took for participant to submit retrospective judgment (after making final retrospective judgment)


(2) Summary data file: 'zootask_summary*.iqdat' (a separate file for each participant)

inquisit.version:			Inquisit version run
computer.platform:			the platform the script was run on (win/mac/ios/android)
startDate:					date script was run
startTime:					time script was started
subjectid:					assigned subject id number
groupid:					assigned group id number
sessionid:					assigned session id number
elapsedTime:				time it took to run script (in ms); measured from onset to offset of script
completed:					0 = script was not completed (prematurely aborted); 
							1 = script was completed (all conditions run)

//Screen Setup:
(parameter) runAbsoluteSizes:		true (1) = should run absolutely sized canvas (see parameters- canvasHeight_inmm)
									false (0) = should use proportionally sized canvas (uses width = 4/3*screenHeight)
								
canvasAdjustments:					NA: not applicable => parameters- runAbsoluteSize was set to 'false'
									0: parameters- runAbsoluteSize was set to 'true' and screen size was large enough
									1: parameters- runAbsoluteSize was set to 'true' BUT screen size was too small and 
									adjustments had to be made

activeCanvasHeight_inmm:			the width of the active canvas in mm 
activeCanvasWidth_inmm:				the height of the active canvas in mm 
display.canvasHeight:				the height of the active canvas in pixels
display.canvasWidth:				the width of the active canvas in pixels


/////TRIAL 1 DATA:

prospectiveJudgment_round1: 		stores the final prospective judgment rating for round1 (1= definitely no to 5 = definitely yes) 
retrospectiveJudgment_round1: 		stores the final retrospective judgment rating for round1 (1= definitely no to 5 = definitely yes)

numberOfTargets_round1:				stores the number of target animals to feed in round1
targets_round1: 					a string variable that stores all the target animals to visit in round1 

visitedLocations_round1: 			a string variable that stores all visited locations (including start and finish) in the order they were visited in round1
visitedTargets_round1: 				a string variable that stores all the visited target animals in the order they were visited in round1
visitedNontargets_round1:			a string variable that stores all the visited nontarget animals in the order they were visited in round1
									Note: visited animal = feeding circle of that animal was reached
							
targetCounter_round1: 				tracks the number of target animals visited in round1
targetRepeatCounter_round1: 		tracks how often participant revisited a target animal in round1
nontargetCounter_round1: 			tracks how often participant visited (including revisits) a nontarget animal in round1

pathCorrectionCounter_round1:		tracks how often participant came too close to an animal in round1
									This could be because they tried to shortcut through the enclosure
									or simply because they reached the computer-enforced enclosure boundaries by accident


//Accuracy Calculations:
//source: see file 'ZooAccuracyCoding_MoreDetails.pdf' downloaded from https://osf.io/c6aq7/

start_percentweightage_round1:		the %weightage assigned to reaching the start and finish buttons in round1
									"Start and Finish have both been given an average weightage for any given trial and is equal to
									weightage of 1/(total number of points to visit) (p.4, also see table2)"
									see raw data for more info

unitweight_round1:					the %weightage assigned to a horizontal distance of 1 in trial 1
									see raw data for more info
							
net_weightage_round1: 				the sum of all %weightages of the actually visited target animals for trial 1
									see raw data for more info
						
pathlength_round1: 					the calculated pathlength taken for round1, based on the length of the path segments
									from one visited target animal to the next.
									see raw data for more info
							
minPathLength_round1: 				the shortest path length for trial 1
									see raw data for more info
							
pathACC_round1:						path Accuracy for round1
									Source: see file 'ZooAccuracyCoding_MoreDetails.pdf' downloaded from https://osf.io/c6aq7/
									"The accuracy score is based on the path-length chosen, the number of required animals visited 
									and their relative distance from the start point. (p.1)"
									=> the accuracy score depends on 'pathlength' adjusted by 'net_weightage'
									pathACC = 1 IF: the shortest path was chosen AND all the target animals were visited

////Timing Variables
A_round1 = time (in ms) it took participant to make last/final prospective judgment in round1
B_round1 = time (in ms) it took for participant to press the Start button (after making final prospective judgment) in round1
C_round1 = time (in ms) it took for participant to reach the Finish Button (after starting the zoo visit) in round1
D_round1 = time (in ms) it took for participant to make final retrospective judgment (after finishing the zoo visit) in round1
E_round1 = time (in ms) it took for participant to submit retrospective judgment (after making final retrospective judgment) in round1

(same for round2 and round3)						
___________________________________________________________________________________________________________________	
EXPERIMENTAL SET-UP 
___________________________________________________________________________________________________________________	

(1) Intro

(2) Practice: 2 rounds
During practice, participants are given 2 animals each and are asked to find the best pathway to these 2 animals
No prospective/retrospective judgments are collected and path accuracy is not calculated.
Practice feedback is optional (see editable parameters.)

(3) Test: 3 rounds (increasing in difficulty, all participants receive the same list of animals)
Round1: 4 animals
Round2: 6 animals
Round3: 8 animals

Participants are asked to make a
- PROSPECTIVE JUDGMENT about their confidence to find the shortest path  at the start of each round and
- RETROSSPECTIVE JUDGEMENT about their confidence at the end of each round
The judgments are made on a 5-point Likert scale with visual anchors.

(4) Finish

//////////////////////////////
Path Accuracy Calculations
//////////////////////////////
source: see file 'ZooAccuracyCoding_MoreDetails.pdf' downloaded from https://osf.io/c6aq7/
"The accuracy score is based on the path-length chosen, the number of required animals visited 
and their relative distance from the start point. (p.1)"
=> The accuracy score depends on 'pathlength' adjusted by 'net_weightage'
pathACC = 1 IF: the shortest path was chosen AND all the target animals were visited

This script bases path accuracy calculations on the above documents.
The script
- calculates the net-weightage for each target location visited 
- calculates the path length based on all locations (FEEDING stations of animal enclosures as well as
Start and Finish buttons) visited (including non-target feeding stations)

Note: the script only clocks visits to feeding stations (the black dots) and start and finish button

- calculates the final pathACC by adjusting the path length by the net-weightage of visited target locations
=> if the path chosen is the shortest possible (see editable parameters) AND all target locations
are visited, path ACC will be 1.
NOTE: This script bases the pathlength taken on all visited locations (not just the target locations).
In many cases, this will lengthen the path taken and thus 'punish' the pathACC. However, in some cases
(e.g. when the non-target locations are on the way to the next target location) the pathlength does not
actually increase. In these cases, pathACC is not 'punished' by the extra animals.
Researcher can decide how to adjust pathACC in these cases individually.

________________________________________________________________________________________________________________	
STIMULI
___________________________________________________________________________________________________________________

The stimuli used in this script are based on the original provided materials: https://osf.io/c6aq7/
(ZooTask_Booklet.pdf: document that contains the actual task materials)

To be able to present clear animal images, Millisecond Software attempted to find
the original used animal images. This was possible in many instances, however,
giraffes, pandas and jellyfish are presented by different images in this script
(other animals may be presented in slightly different colors).
All animal images used in this script were downloaded from: https://pixabay.com/
Pixabay license: Free for commercial use, No attribution required
___________________________________________________________________________________________________________________	
INSTRUCTIONS 
___________________________________________________________________________________________________________________

The instructions used in this script are based on the original provided materials: https://osf.io/c6aq7/
(ZooTask_Booklet.pdf: document that contains the actual task materials)

In some cases, Millisecond Software added some additional information and/or added some verbal (English)
instructions. 
All images presented for instruction purposes are either based on the original provided material or downloaded
from https://pixabay.com/ (Pixabay license: Free for commercial use, No attribution required).

Millisecond Software used Audacity to create the verbal soundfiles used in this script.
___________________________________________________________________________________________________________________	
EDITABLE CODE 
___________________________________________________________________________________________________________________	
check below for (relatively) easily editable parameters, stimuli, instructions etc. 
Keep in mind that you can use this script as a template and therefore always "mess" with the entire code 
to further customize your experiment.

The parameters you can change are: