___________________________________________________________________________________________________________________
*SOLVING ANAGRAMS*
___________________________________________________________________________________________________________________
Script Author: Katja Borchert, Ph.D. (katjab@millisecond.com) for Millisecond Software, LLC
Date: 02-07-2017
last updated: 12-20-2019 by K.Borchert (katjab@millisecond.com) for Millisecond Software LLC
Script Copyright © 12-20-2019 Millisecond Software
___________________________________________________________________________________________________________________
BACKGROUND INFO
___________________________________________________________________________________________________________________
This script implements an Anagram Solving Paradigm based in part on:
Novick, L., & Sherman, S. (2003). On the nature of insight solutions: Evidence from skill differences in anagram solution.
The Quarterly Journal of Experimental Psychology Section A, 56(2), 351-382.
Tresselt, M. E., & Mayzner, M. S. (1966). Normative solution times for a sample of 134 solution words and 378 associated anagrams.
Psychonomic Monograph Supplements, 1, 293-298.
Note: due to the nature of the trial set-up in this script, this script cannot be run on devices lacking an external
keyboard.
Script solvinganagrams_textboxes.iqx runs a similar task with textbox input that also runs on keyboardless
devices.
___________________________________________________________________________________________________________________
TASK DESCRIPTION
___________________________________________________________________________________________________________________
By default, participants work on 30 5-letter anagrams in increasing difficulty*. They have 10s (default) to come up
with a solution, specifically they have to enter the first letter of
the word within that timeframe.
Participants receive solution feedback.
*increasing difficulty: based on the median response times needed to solve the anagrams as
reported in Tresselt & Mayzner (1966)
___________________________________________________________________________________________________________________
DURATION
___________________________________________________________________________________________________________________
the default set-up of the script takes appr. 5 minutes to complete
___________________________________________________________________________________________________________________
DATA FILE INFORMATION
___________________________________________________________________________________________________________________
The default data stored in the data files are:
(1) Raw data file: 'solvinganagrams_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, group, with the current subject/groupnumber
script.sessionid: with the current session id
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 such as feedback trials. Thus, trialnum
may not reflect the number of main trials run per block.
values.form: A vs. B (different lists of anagrams that are matched in difficulty)
values.phase: 0 = demo
1: anagrams 1-10;
2: anagrams 11-20;
3: anagrams 21-30;
values.anagramCount: counts the number of anagrams run
values.anagram: stores the current anagram
values.anagramSolution: stores the solution of the current anagram
response: the participant's response (scancode of last response input)
values.keyResponse: scancode translation into a key response:
"submit", "correction", letter associated with last entered scancode, !(for invalid response)
latency: the response latency (in ms)
values.anagramRT: stores the latency (in ms) of the first key entered
values.firstLetter: stores the first letter entered
values.proposedSolution: stores the proposed anagram solution
values.proposedSolutionRT: time (in ms) it took to type solution; measured from time the first letter was entered to
entering 'submit'
correct: 1 = proposed solution is correct;
0 = otherwise
values.countCorrections: number of corrections (=number of time backspace was used) for the currently proposed solution
values.solutionFlag: 1 = solution is flagged (proposedSolutionRT > parameters.flagSolutionRT)
=> it took participant more than 10s (default) to enter the solution into the textbox
0 = solution is not flagged
(2) Summary data file: 'solvinganagrams_summary*.iqdat' (a separate file for each participant)*
computer.platform: the platform the script was run on (win/mac/ios/android)
script.startdate: date script was run
script.starttime: time script was started
script.subjectid: assigned subject id number
script.groupid: assigned group id number
script.sessionid: assigned session id number
script.elapsedtime: time it took to run script (in ms); measured from onset to offset of script
script.completed: 0 = script was not completed (prematurely aborted);
1 = script was completed (all conditions run)
values.form: form run (A vs. B)
values.nr_anagrams: the number of anagrams presented (based on the provided item lists)
expressions.ACC: proportion correctly solved anagrams
expressions.medianRT: median solution time (in ms); measured from onset of anagram until first letter (of correct solutions) is hit
expressions.meanRT: mean solution time (in ms); measured from onset of anagram until first letter (of correct solutions) is hit
expressions.medianProposedSolutionRT: median proposed solution time (in ms); measured from entering first letter until solution is submitted
expressions.meanProposedSolutionRT: mean proposed solution time (in ms); measured from entering first letter until solution is submitted
expressions.meanCorrections: mean number of corrections made to proposed solution across all anagrams
correction = backspace is used for letter deletion
values.countSolutionFlags: number of times a solution was flagged because values.proposedSolutionRT > parameters.flagSolutionRT (default: 10s)
for 30 anagrams:
values.ACC_10: proportion correct solution for anagram 1-10
values.medianRT_10: median correct latency (in ms) for anagram 1-10 (latency measured from onset of anagram until first key is hit)
values.meanRT_10: mean correct latency (in ms) for anagram 1-10 (latency measured from onset of anagram until first key is hit)
values.ACC_20: proportion correct solution for anagram 11-20
values.medianRT_20: median correct latency (in ms) for anagram 11-20 (latency measured from onset of anagram until first key is hit)
values.meanRT_20: mean correct latency (in ms) for anagram 11-20 (latency measured from onset of anagram until first key is hit)
values.ACC_30: proportion correct solution for anagram 21-30
values.medianRT_30: median correct latency (in ms) for anagram 21-30 (latency measured from onset of anagram until first key is hit)
values.meanRT_30: mean correct latency (in ms) for anagram 21-30 (latency measured from onset of anagram until first key is hit)
* separate data files: to change to one data file for all participants (on Inquisit Lab only), go to section
"DATA" and follow further instructions
___________________________________________________________________________________________________________________
EXPERIMENTAL SET-UP
___________________________________________________________________________________________________________________
Script counterbalances the use of 2 anagram forms A vs. B by groupnumber:
odd groupnumbers run version A
even groupnumbers run version B
1. Demo Block: runs 1 demo trial (by default: additional demo anagrams can be added under section Editable Stimuli and the script will automatically adapt)
- demo trial: only accepts the correct first letter
=> if the first letter entered is incorrect, a solution hint is provided
=> if the time limit is up without a response, a solution hint is provided
- provides feedback
2. Test Block: runs 30 trials (by default: additional test anagrams can be added/removed under section Editable Stimuli and the script will automatically adapt)
- each anagram is presented for 10s (default, can be edited under section Editable Parameters)
- the first letter/key entered is taken as a response to terminate the anagram presentation
- once the participant has entered the Spacebar to submit the final solution, feedback is provided
- corrections of the provided solutions are possible (a count of all corrections is kept)
Trial Sequence:
Anagram Presentation (for max. 10s), waits for first letter input -> Solution Trial: takes in the remaining letters until Spacebar is pressed to submit the solution -> Feedback
___________________________________________________________________________________________________________________
STIMULI
___________________________________________________________________________________________________________________
Anagram selection for FormA/FormB:
Tresselt & Mayzner (1966), Table1 lists anagrams of 5-letter words in increasing median solution times.
An increase in median solution time was taken as an indicator of increasing anagram difficulty in this script.
Attempts were made to match the 30 anagrams chosen for formA and formB as closely as possible
in increasing median solution times:
Mean(A) = 45.03s, SD(A) = 62.63s, Median(A) = 20.75s
Mean(B) = 45.08s, SD(B) = 62.38s, Median(B) = 20.75s
(see anagrampool.xlsx for individual solution times)
Anagrams and their solution can be easily replaced under section Editable Stimuli.
The task automatically adjusts if the number of anagrams changes.
___________________________________________________________________________________________________________________
INSTRUCTIONS
___________________________________________________________________________________________________________________
provided by Millisecond Software under section Editable Instructions
___________________________________________________________________________________________________________________
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:
/anagramFontSize: the size of the anagrams in percentage of canvas height (default: 5%)
/maxAnagramPresentationTime: the maximum presentation time (in ms) of the anagram (default: 10000ms)
/flagSolutionRT: if participant needs more than 10s (default) to enter the solution after hitting the first key,
the solution is flagged
(Note: there is no timelimit on typing in the solution to the anagram after entering the first letter.
Thus, participants could potentially press any key without knowing the solution and then
use extra time to think about the solution before finally submitting it)
**************************************************************************************************************
**************************************************************************************************************
EDITABLE PARAMETERS: change editable parameters here
**************************************************************************************************************
**************************************************************************************************************
/anagramFontSize = 5%
/maxAnagramPresentationTime = 10000
/flagSolutionRT = 10000
**************************************************************************************************************
**************************************************************************************************************
EDITABLE STIMULI: change editable stimuli here
**************************************************************************************************************
**************************************************************************************************************
Anagram selection for FormA/FormB:
Tresselt & Mayzner (1966), Table1 lists anagrams of 5-letter words in increasing median solution times.
An increase in median solution time was taken as an indicator of increasing anagram difficulty in this script.
Attempts were made to match the 30 anagrams chosen for formA and formB as closely as possible
in increasing median solution times:
Mean(A) = 45.03s, SD(A) = 62.63s, Median(A) = 20.75s
Mean(B) = 45.08s, SD(B) = 62.38s, Median(B) = 20.75s
****************************
Form A
****************************
-
/1 = "egujd"
/2 = "odelm"
/3 = "ntrai"
/4 = "iuegd"
/5 = "milbc"
/6 = "ihrca"
/7 = "hroac"
/8 = "ugars"
/9 = "rmcap"
/10 = "iptna"
/11 = "nrtde"
/12 = "mhnua"
/13 = "cahtb"
/14 = "ohytu"
/15 = "ltvia"
/16 = "patoi"
/17 = "lrufo"
/18 = "taibh"
/19 = "gawno"
/20 = "sjtuo"
/21 = "ciotn"
/22 = "hecab"
/23 = "dpaot"
/24 = "obrac"
/25 = "pncia"
/26 = "eucnl"
/27 = "speua"
/28 = "dtuai"
/29 = "rdcei"
/30 = "nrcui"
-
/1 = "judge"
/2 = "model"
/3 = "train"
/4 = "guide"
/5 = "climb"
/6 = "chair"
/7 = "roach"
/8 = "sugar"
/9 = "cramp"
/10 = "paint"
/11 = "trend"
/12 = "human"
/13 = "batch"
/14 = "youth"
/15 = "vital"
/16 = "patio"
/17 = "flour"
/18 = "habit"
/19 = "wagon"
/20 = "joust"
/21 = "tonic"
/22 = "beach"
/23 = "adopt"
/24 = "cobra"
/25 = "panic"
/26 = "uncle"
/27 = "pause"
/28 = "audit"
/29 = "cider"
/30 = "incur"
****************************
Form B
****************************
-
/1 = "aewtr"
/2 = "eocvi"
/3 = "adtri"
/4 = "nrdki"
/5 = "ntgia"
/6 = "lcoht"
/7 = "tonba"
/8 = "awrlb"
/9 = "ypeon"
/10 = "ohtnm"
/11 = "rtypa"
/12 = "iuftr"
/13 = "aotlg"
/14 = "kcler"
/15 = "oulgh"
/16 = "oewrp"
/17 = "huocg"
/18 = "eokrp"
/19 = "iumcs"
/20 = "rhtib"
/21 = "roing"
/22 = "ntjau"
/23 = "tanog"
/24 = "augdr"
/25 = "elcsa"
/26 = "acohv"
/27 = "oapnr"
/28 = "rbloa"
/29 = "aebrl"
/30 = "glaei"
-
/1 = "water"
/2 = "voice"
/3 = "triad"
/4 = "drink"
/5 = "giant"
/6 = "cloth"
/7 = "baton"
/8 = "brawl"
/9 = "peony"
/10 = "month"
/11 = "party"
/12 = "fruit"
/13 = "gloat"
/14 = "clerk"
/15 = "ghoul"
/16 = "power"
/17 = "cough"
/18 = "poker"
/19 = "music"
/20 = "birth"
/21 = "groin"
/22 = "jaunt"
/23 = "tango"
/24 = "guard"
/25 = "scale"
/26 = "havoc"
/27 = "apron"
/28 = "labor"
/29 = "blare"
/30 = "agile"
*******************************
Demo
*******************************
-
/1 = "muose"
-
/1 = "mouse"
**************************************************************************************************************
**************************************************************************************************************
EDITABLE INSTRUCTIONS: change instructions here
**************************************************************************************************************
**************************************************************************************************************
/ fontstyle = ("Arial", 2.8%, false, false, false, false, 5, 1)
-
/1 = "In the following task you will be asked to solve <%item.anagrams.itemcount%> <%length(item.anagrams.item(1))%>-letter anagrams such as 'tilup'.
The anagrams get more difficult as you proceed.
On each trial, you will see a new anagram, and you have <%parameters.maxAnagramPresentationTime/1000%>s to solve it. Once you know the solution (here: tulip), start typing it into your keyboard. Mistakes CANNOT be corrected. Once you've typed and entered the solution, the trial is over and you will be given feedback.
If you cannot think of the solution in time, the correct solution will be presented, and a new trial will start.
Let's work through a demonstration trial."
/2 = "The demonstration is over.
Remember:
you have <%parameters.maxAnagramPresentationTime/1000%>s to solve each of the <%item.anagrams.itemcount%> <%length(item.anagrams.item(1))%>-letter anagrams.
Start entering your solution as soon as you know it.
Begin the task when you are ready!"
-
/1 = "Demo Hint:
the solution is '<%values.anagramSolution%>'"
/2 = "as soon as you know the solution, start typing its first letter."
/3 = "Proposed Solution:
<%values.proposedSolution%>"
/4 = "The correct solution to '<%values.anagram%>' was:
<%values.anagramSolution%>"
/5 = "Correct!"
/6 = ""
/7 = "Press to submit your solution"
/8 = "Press to correct"
/ items = ("Thank you!")
/ fontstyle = ("Arial", 8%, true, false, false, false, 5, 1)
/ position = (50%, 50%)
/ size = (80%, 10%)
/ vjustify = center
/ valign = center
/ halign = center
/ items = ("")
/ fontstyle = ("Arial", 3%, false, false, false, false, 5, 1)
/ position = (50%, 90%)
/ size = (80%, 5%)
/ vjustify = center
/ valign = center
/ halign = center
/ items = ("This task requires an external keyboard")
/ fontstyle = ("Arial", 5%, true, false, false, false, 5, 1)
/ position = (50%, 50%)
/ size = (80%, 10%)
/ vjustify = center
/ valign = center
/ halign = center
****************************************************************************************************
general instruction expressions: adjust the instruction text depending on device used to run script
****************************************************************************************************
/buttoninstruct1 = if (computer.touch && !computer.haskeyboard) {"response buttons located on the bottom of your screen";} else {"keys on your keyboard";}
**************************************************************************************************************
!!!REMAINING CODE: Customize after careful consideration only!!!
**************************************************************************************************************
**************************************************************************************************************
**************************************************************************************************************
DEFAULTS
**************************************************************************************************************
**************************************************************************************************************
script requires Inquisit 6.1.0.0 or higher
/canvasaspectratio = (4,3)
/minimumversion = "6.1.0.0"
/ fontstyle = ("Arial", 3%, false, false, false, false, 5, 1)
/txbgcolor = white
/ txcolor = (0, 0, 0)
**************************************************************************************************************
**************************************************************************************************************
DATA
**************************************************************************************************************
**************************************************************************************************************
Note: data file explanations under User Manual Information at the top
To change from one data file per participant to one data file for all participants, set
/separatefiles = false
***********************
raw data file
***********************
/ columns = (build, computer.platform, date, time, subject, group, script.sessionid,
blockcode, blocknum, trialcode, trialnum,
values.form,
values.phase, values.anagramCount, values.anagram, values.anagramSolution,
response, values.keyResponse, latency,
values.anagramRT, values.firstLetter, values.proposedSolution, values.proposedSolutionRT, values.ACC,
values.countCorrections, values.solutionFlag)
***********************
summary data file
***********************
/ columns = (computer.platform, script.startdate, script.starttime, script.subjectid, script.groupid, script.sessionid,
script.elapsedtime, script.completed,
values.form, values.nr_anagrams,
expressions.ACC, expressions.medianRT, expressions.meanRT,
expressions.medianProposedSolutionRT, expressions.meanProposedSolutionRT,
expressions.meanCorrections, values.countSolutionFlags,
values.ACC_10, values.medianRT_10, values.meanRT_10,
values.ACC_20, values.medianRT_20, values.meanRT_20,
values.ACC_30, values.medianRT_30, values.meanRT_30)
**************************************************************************************************************
**************************************************************************************************************
VALUES: automatically updated
**************************************************************************************************************
**************************************************************************************************************
/completed: 0 = script was not completed; 1 = script was completed (all conditions run)
/phase: 0 = demo
1: anagrams 1-10;
2: anagrams 11-20;
3: anagrams 21-30;
/form: A vs. B (different lists of anagrams that are matched in difficulty)
/nr_anagrams: the number of anagrams presented (based on the provided item lists)
/index: helper variable to fill dynamic anagram lists
/demoTrials: counts the number of demo trials run
/anagramCount: counts the number of anagrams run
/anagram: stores the current anagram
/anagramSolution: stores the solution of the current anagram
/anagramRT: stores the latency (in ms) of the first key entered
/proposedSolution: stores the proposed anagram solution
/correct: 1 = proposed solution is correct; 0 = otherwise
/keyResponse: stores the letter entered (Note: any key pressed other than a letter key is recorded as a scancode)
/firstLetter: stores the first letter entered
/response: stores the initial scancode entered (before it's converted to the letter)
/feedback: stores the itemnumber (item.trialInstructions )of the feedback stimulus to be presented:
4 = 'incorrect' feedback; 5 = 'correct' feedback
/countLetters: counts the number of letters/keys entered for the proposed solution
Summary Variables (for 30 anagrams )
/ACC_10: proportion correct solution for anagram 1-10
/meanRT_10: mean correct latency (in ms) for anagram 1-10 (latency measured from onset of anagram until first key is hit)
/medianRT_10: median correct latency (in ms) for anagram 1-10 (latency measured from onset of anagram until first key is hit)
/ACC_20: proportion correct solution for anagram 11-20
/meanRT_20: mean correct latency (in ms) for anagram 11-20 (latency measured from onset of anagram until first key is hit)
/medianRT_20: median correct latency (in ms) for anagram 11-20 (latency measured from onset of anagram until first key is hit)
/ACC_30: proportion correct solution for anagram 21-30
/meanRT_30: mean correct latency (in ms) for anagram 21-30 (latency measured from onset of anagram until first key is hit)
/medianRT_30: median correct latency (in ms) for anagram 21-30 (latency measured from onset of anagram until first key is hit)
/phase = 0
/form = ""
/nr_anagrams = 0
/index = 0
/demoTrials = 0
/anagramCount = 0
/anagram = 0
/anagramSolution = ""
/anagramRT = 0
/proposedSolution = ""
/proposedSolutionRT = ""
/solutionStart = ""
/ACC = 0
/keyResponse = ""
/firstLetter = ""
/response = ""
/feedback = 0
/countLetters = 0
/countCorrections = 0
/totalCorrections = 0
/solutionFlag = 0
/countSolutionFlags = 0
/ACC_10 = ""
/meanRT_10 = ""
/medianRT_10 = ""
/ACC_20 = ""
/meanRT_20 = ""
/medianRT_20 = ""
/ACC_30 = ""
/meanRT_30 = ""
/medianRT_30 = ""
**************************************************************************************************************
**************************************************************************************************************
EXPRESSIONS
**************************************************************************************************************
**************************************************************************************************************
/selectAnagrams_FormA: function that stores anagrams and their solutions from Form A in the respective
dynamic item lists (odd groupnumbers)
/selectAnagrams_FormA: function that stores anagrams and their solutions from Form B in the respective
dynamic item lists (even groupnumbers)
/convertScancodeToLabel: converts letter-scancodes to the actual letters entered
/propCorrect: proportion correctly solved anagrams
/medianRT: median solution time (in ms); measured from onset of anagram until first letter is hit
/meanRT: mean solution time (in ms); measured from onset of anagram until first letter is hit
/medianProposedSolutionRT: median proposed solution time (in ms); measured from entering first letter until solution is submitted
/meanProposedSolutionRT: mean proposed solution time (in ms); measured from entering first letter until solution is submitted
/meanCorrections: mean number of corrections made to proposed solution across all anagrams
/selectAnagrams_FormA = {
values.index += 1;
if (values.index <= item.anagramSolutions_formA.itemcount){
item.anagrams.insertitem(item.anagrams_formA.item(values.index), values.index);
item.anagramSolutions.insertitem(item.anagramSolutions_formA.item(values.index), values.index);
expressions.selectAnagrams_FormA;
};
}
/selectAnagrams_FormB = {
values.index += 1;
if (values.index <= item.anagramSolutions_formB.itemcount){
item.anagrams.insertitem(item.anagrams_formB.item(values.index), values.index);
item.anagramSolutions.insertitem(item.anagramSolutions_formB.item(values.index), values.index);
expressions.selectAnagrams_FormB;
};
}
/convertScancodeToLabel = {
if (values.response == 14){
values.keyResponse = "correction";
} else if (values.response == 16){
values.keyResponse = "q";
} else if (values.response == 17){
values.keyResponse = "w";
} else if (values.response == 18){
values.keyResponse = "e";
} else if (values.response == 19){
values.keyResponse = "r";
} else if (values.response == 20){
values.keyResponse = "t";
} else if (values.response == 21){
values.keyResponse = "y";
} else if (values.response == 22){
values.keyResponse = "u";
} else if (values.response == 23){
values.keyResponse = "i";
} else if (values.response == 24){
values.keyResponse = "o";
} else if (values.response == 25){
values.keyResponse = "p";
} else if (values.response == 30){
values.keyResponse = "a";
} else if (values.response == 31){
values.keyResponse = "s";
} else if (values.response == 32){
values.keyResponse = "d";
} else if (values.response == 33){
values.keyResponse = "f";
} else if (values.response == 34){
values.keyResponse = "g";
} else if (values.response == 35){
values.keyResponse = "h";
} else if (values.response == 36){
values.keyResponse = "j";
} else if (values.response == 37){
values.keyResponse = "k";
} else if (values.response == 38){
values.keyResponse = "l";
} else if (values.response == 44){
values.keyResponse = "z";
} else if (values.response == 45){
values.keyResponse = "x";
} else if (values.response == 46){
values.keyResponse = "c";
} else if (values.response == 47){
values.keyResponse = "v";
} else if (values.response == 48){
values.keyResponse = "b";
} else if (values.response == 49){
values.keyResponse = "n";
} else if (values.response == 50){
values.keyResponse = "m";
} else if (values.response == 28){
values.keyResponse = "submit";
} else {
values.keyResponse = "X";
}
}
/ACC = list.accuracy.mean
/medianRT = list.latencies.median
/meanRT = list.latencies.mean
/medianProposedSolutionRT = list.proposedSolutionRTs.median
/meanProposedSolutionRT = list.proposedSolutionRTs.mean
/meanCorrections = values.totalCorrections/values.anagramCount
**************************************************************************************************************
**************************************************************************************************************
INSTRUCTIONS
**************************************************************************************************************
**************************************************************************************************************
/ items = Instructions
/ select = sequence
/ fontstyle = ("Arial", 3%, true, false, false, false, 5, 1)
/ position = (50%, 50%)
/ size = (80%, 80%)
/ hjustify = left
/ items = trialInstructions
/ select = 1
/ fontstyle = ("Arial", 5%, true, false, false, false, 5, 1)
/ position = (50%, 20%)
/ size = (80%, 20%)
/ txcolor = red
/ items = trialInstructions
/ select = 2
/ fontstyle = ("Arial", 3%, false, false, false, false, 5, 1)
/ position = (50%, 90%)
/ size = (80%, 20%)
/ txcolor = gray
/ items = trialInstructions
/ select = 7
/ fontstyle = ("Arial", 3%, true, false, false, false, 5, 1)
/ position = (50%, 90%)
/ size = (80%, 5%)
/ txcolor = red
/ erase = false
/ items = trialInstructions
/ select = 8
/ fontstyle = ("Arial", 2%, true, false, false, false, 5, 1)
/ position = (50%, 95%)
/ size = (80%, 5%)
/ txcolor = gray
/ erase = false
/ items = trialInstructions
/ select = 3
/ fontstyle = ("Arial", 3%, false, false, false, false, 5, 1)
/ position = (50%, 30%)
/ size = (80%, 20%)
/ items = trialInstructions
/ select = values.feedback
/ fontstyle = ("Arial", 4%, true, false, false, false, 5, 1)
/ position = (50%, 70%)
/ size = (80%, 20%)
/ txcolor = black
/ items = trialInstructions
/ select = 6
/ fontstyle = ("Courier New", 2.5%, false, false, false, false, 5, 1)
/ position = (50%, 95%)
/ size = (80%, 20%)
/ txcolor = blue
/ stimulusframes = [1 = instructions, continue]
/ validresponse = (" ")
/ recorddata = false
/ inputdevice = keyboard
/ stimulusframes = [1 = finish, exit]
/ validresponse = (" ")
/ recorddata = false
/ skip = [
computer.haskeyboard
]
/ inputdevice = keyboard
/ stimulusframes = [1 = keyboardCheck, exit]
/ validresponse = (" ")
/ recorddata = true
/ ontrialend = [
script.abort();
]
**************************************************************************************************************
**************************************************************************************************************
STIMULI
**************************************************************************************************************
**************************************************************************************************************
Note: fill dynamically with the anagrams for the selected form
-
Note: fill dynamically with the anagram Solutions for the selected form
-
/ items = demoAnagrams
/ select = sequence
/ fontstyle = ("Arial", parameters.anagramFontSize, false, false, false, false, 5, 1)
/ position = (50%, 50%)
/ items = anagrams
/ select = values.anagramCount
/ fontstyle = ("Arial", parameters.anagramFontSize, false, false, false, false, 5, 1)
/ position = (50%, 50%)
/ items = ("<%values.proposedSolution%>")
/ fontstyle = ("Arial", parameters.anagramFontSize, false, false, false, false, 5, 1)
/ position = (50%, 50%)
/ size = (80%, parameters.anagramFontSize)
/ erase = false
**************************************************************************************************************
**************************************************************************************************************
LISTS
**************************************************************************************************************
**************************************************************************************************************
/ items = (0, 1)
/ replace = true
*************************************************
Data Lists: used for descriptive statistics
store correct latencies/accuracy data
fill up during runtime
*************************************************
Note: list stores 1 = correct response; 0 = incorrect response for each relevant trial
Note: list stores the latency of correct responses for each relevant trial
Note: list stores 1 = correct response; 0 = incorrect response for each relevant trial
for 10 consecutive trials
Note: list stores the latency of correct responses for each relevant trial
for 10 consecutive trials
Note: list stores all values.proposedSolutionRTs
**************************************************************************************************************
**************************************************************************************************************
DEMO TRIALS
**************************************************************************************************************
**************************************************************************************************************
Note: trial.demoAnagram
- retrieves the demo anagram (as well as solution) and presents it
- waits for response (aka first letter entered)
=> if the wrong key is pressed, a hint is given during the demo trial
=> if no key is pressed during the allotted time (10s), a hint is given during the demo trial
=> only the correct key is accepted and terminates this trial
- calls trial.demoProposedAnagramSolution
/ ontrialbegin = [
values.demoTrials += 1;
values.anagram = item.demoAnagrams.item(values.demoTrials);
values.anagramSolution = item.demoAnagramSolutions.item(values.demoTrials);
values.ACC = "";
values.proposedSolution = "";
trial.demoAnagram.insertstimulustime(text.demoHint, parameters.maxAnagramPresentationTime);
values.countLetters = 0;
values.proposedSolutionRT = "";
]
/ stimulusframes = [1 = clearscreen, anagramInstructions, demoAnagram]
/ validresponse = (anyresponse)
/ monkeyresponse = (50)
/ iscorrectresponse = [
values.response = trial.demoAnagram.response;
expressions.convertScancodeToLabel;
values.proposedSolution = values.keyResponse;
values.firstLetter = values.keyResponse;
values.firstLetter == substring(values.anagramSolution, 0, 1);
]
/ ontrialend = [
trial.demoAnagram.resetstimulusframes();
]
/ beginresponsetime = 0
/ responseinterrupt = immediate
/ response = correct
/ errormessage = true(text.demoHint, 0)
/ branch = [
values.solutionStart = script.elapsedtime;
return trial.demoProposedAnagramSolution;
]
Note: trial.demoAnagramProposedSolution
- takes in as many key presses until 'Enter' is pressed
- evaluates response in terms of accuracy by comparing the final input to the anagram solution
and sets feedback accordingly
- calls trial.demoAnagramSolutionEnd once all letters have been entered
/ stimulusframes = [1 = proposedSolution, submit, correction]
/ validresponse = (anyresponse)
/ monkeyresponse = (18)
/ ontrialend = [
values.response = trial.demoProposedAnagramSolution.response;
expressions.convertScancodeToLabel;
values.ACC = 0;
values.feedback = 4;
text.feedback.textcolor = red;
if (values.keyResponse == "correction"){
values.proposedSolution = substring(values.proposedSolution, 0, length(values.proposedSolution) - 1);
values.countCorrections += 1;
} else if (values.keyResponse == "submit"){
if (tolower(values.proposedSolution) == values.anagramSolution){
values.ACC = 1;
values.feedback = 5;
text.feedback.textcolor = green;
};
} else {
values.proposedSolution = concat(values.proposedSolution, values.keyResponse);
};
if (monkey.monkeymode){
values.keyResponse = "submit";
if (list.chance.nextvalue == 1){
values.ACC = 1;
text.feedback.textcolor = green;
values.feedback = 5;
values.proposedSolution = values.anagramSolution;
} else {
values.ACC = 0;
text.feedback.textcolor = red;
values.feedback = 4;
};
};
values.countLetters = length(values.proposedSolution);
]
/ branch = [
if (values.keyResponse == "submit"){
values.proposedSolutionRT = script.elapsedtime - values.solutionStart;
return trial.demoProposedAnagramSolutionEnd;
} else {
return trial.demoProposedAnagramSolution;
};
]
/ recorddata = false
Note: trial.demoProposedAnagramSolutionEnd
- simply presents the complete proposed solution for 200ms before
calling trial.demoAnagramFeedback
/ stimulusframes = [1 = proposedSolution]
/ trialduration = 200
/ recorddata = false
/ branch = [
return trial.demoAnagramFeedback;
]
Note: trial.demoAnagramFeedback
- presents the correct solution if an incorrect solution was proposed
otherwise says 'correct'
- calls another demo trial IF the number of presented demo trials is
smaller than the number of demo anagrams listed in item.demoAnagrams
/ stimulusframes = [1 = proposedSolution, feedback, continue]
/ validresponse = (" ")
/ recorddata = true
/ branch = [
if (values.demoTrials < item.demoAnagrams.itemcount){
return trial.demoAnagram;
};
]
**************************************************************************************************************
**************************************************************************************************************
TRIALS
**************************************************************************************************************
**************************************************************************************************************
Note: trial.Anagram
- retrieves the next anagram (as well as solution) and presents it
- waits for response (aka first letter entered)
- if no response is given within the allotted timeframe (10s), the trial terminates and trial.anagramFeedback is called
- if a response key is hit,
=> latency is stored under values.anagramRT
=> trial.proposedAnagramSolution is called
/ ontrialbegin = [
values.anagramCount += 1;
if (values.anagramCount <= 10){
values.phase = 1;
} else if (values.anagramCount <= 20){
values.phase = 2;
} else if (values.anagramCount <= 30){
values.phase = 3;
} else {
values.phase = "NA";
};
values.anagram = item.anagrams.item(values.anagramCount);
values.anagramSolution = item.anagramSolutions.item(values.anagramCount);
values.ACC = "";
values.countLetters = 0;
values.proposedSolutionRT = "";
values.proposedSolution = "";
values.countCorrections = 0;
values.solutionFlag = 0;
]
/ stimulusframes = [1 = clearscreen, anagramInstructions, Anagram]
/ validresponse = (anyresponse)
/ monkeyresponse = (18)
/ beginresponsetime = 0
/ timeout = parameters.maxAnagramPresentationTime
/ ontrialend = [
values.anagramRT = trial.anagram.latency;
values.response = trial.anagram.response;
expressions.convertScancodeToLabel;
values.proposedSolution = values.keyResponse;
values.firstLetter = values.keyResponse;
]
/ branch = [
if (trial.anagram.response != 0){
values.solutionStart = script.elapsedtime;
return trial.proposedAnagramSolution;
} else {
values.ACC = 0;
values.feedback = 4;
text.feedback.textcolor = red;
return trial.anagramFeedback;
}
]
Note: trial.proposedAnagramSolution
- takes in as many key presses until 'Enter' is pressed
- evaluates response in terms of accuracy by comparing the final input to the anagram solution
and sets feedback accordingly
- calls trial.proposedAnagramSolutionEnd once solution is submitted (via Enter key)
/ stimulusframes = [1 = clearscreen, proposedSolution, submit, correction]
/ validresponse = (anyresponse)
/ monkeyresponse = (18)
/ ontrialend = [
values.response = trial.proposedAnagramSolution.response;
expressions.convertScancodeToLabel;
values.ACC = 0;
values.feedback = 4;
text.feedback.textcolor = red;
if (values.keyResponse == "correction"){
values.proposedSolution = substring(values.proposedSolution, 0, length(values.proposedSolution) - 1);
values.countCorrections += 1;
} else if (values.keyResponse == "submit"){
if (tolower(values.proposedSolution) == values.anagramSolution){
values.ACC = 1;
values.feedback = 5;
text.feedback.textcolor = green;
};
} else {
values.proposedSolution = concat(values.proposedSolution, values.keyResponse);
};
if (monkey.monkeymode){
values.keyResponse = "submit";
if (list.chance.nextvalue == 1){
values.ACC = 1;
text.feedback.textcolor = green;
values.feedback = 5;
values.proposedSolution = values.anagramSolution;
} else {
values.ACC = 0;
text.feedback.textcolor = red;
values.feedback = 4;
};
};
values.countLetters = length(values.proposedSolution);
]
/ branch = [
if (values.keyResponse == "submit"){
values.proposedSolutionRT = script.elapsedtime - values.solutionStart;
list.proposedSolutionRTs.appenditem(values.proposedSolutionRT);
if (values.proposedSolutionRT > parameters.flagSolutionRT){
values.solutionFlag = 1;
values.countSolutionFlags += 1;
};
return trial.proposedAnagramSolutionEnd;
} else {
return trial.proposedAnagramSolution;
};
]
/ recorddata = false
Note: trial.proposedAnagramSolutionEnd
- simply presents the complete proposed solution for 200ms before
calling trial.anagramFeedback
/ stimulusframes = [1 = proposedSolution]
/ trialduration = 200
/ recorddata = false
/ branch = [
return trial.anagramFeedback;
]
Note: trial.anagramFeedback
- presents the correct solution if an incorrect solution was proposed
otherwise says 'correct'
- updates summary lists
- calls another anagram trial IF the number of presented anagram trials is
smaller than the number of anagrams stored in item.anagrams
/ ontrialbegin = [
list.accuracy.insertitem(values.ACC, 1);
if (values.ACC == 1){
list.latencies.insertitem(values.anagramRT, 1);
};
values.totalCorrections += values.countCorrections;
]
/ stimulusframes = [1 = proposedSolution, feedback, continue]
/ validresponse = (" ")
/ recorddata = true
/ ontrialend = [
if (values.anagramCount <= 10){
list.accuracy10.insertitem(values.ACC, 1);
if (values.ACC == 1){
list.latencies10.insertitem(values.anagramRT, 1);
};
if (values.anagramCount == 10){
values.ACC_10 = list.accuracy10.mean;
values.meanRT_10 = list.latencies10.mean;
values.medianRT_10 = list.latencies10.median;
list.accuracy10.reset();
list.latencies10.reset();
};
} else if (values.anagramCount <= 20){
list.accuracy10.insertitem(values.ACC, 1);
if (values.ACC == 1){
list.latencies10.insertitem(values.anagramRT, 1);
};
if (values.anagramCount == 20){
values.ACC_20 = list.accuracy10.mean;
values.meanRT_20 = list.latencies10.mean;
values.medianRT_20 = list.latencies10.median;
list.accuracy10.reset();
list.latencies10.reset();
};
} else if (values.anagramCount <= 30){
list.accuracy10.insertitem(values.ACC, 1);
if (values.ACC == 1){
list.latencies10.insertitem(values.anagramRT, 1);
};
if (values.anagramCount == 30){
values.ACC_30 = list.accuracy10.mean;
values.meanRT_30 = list.latencies10.mean;
values.medianRT_30 = list.latencies10.median;
list.accuracy10.reset();
list.latencies10.reset();
};
};
]
/ branch = [
if (values.anagramCount < values.nr_anagrams){
return trial.anagram;
};
]
**************************************************************************************************************
**************************************************************************************************************
BLOCKS
**************************************************************************************************************
**************************************************************************************************************
Note:
* runs as many demo trials as there demo anagrams (default: 1)
/ trials = [
1 = keyboardCheck;
2 = instructions;
3 = demoAnagram;
4 = instructions;
]
Note:
* runs as many anagram trials as there anagrams (default: 30)
/ trials = [1 = Anagram]
/ trials = [
1 = finish;
]
**************************************************************************************************************
**************************************************************************************************************
EXPERIMENT
**************************************************************************************************************
**************************************************************************************************************
Note: odd groupnumbers run version A
=> all items from version A are stored in the dynamic lists list.anagrams and list.anagramSolutions
/ groups = (1 of 2)
/ onexptbegin = [
values.form = "A";
expressions.selectAnagrams_FormA;
values.nr_anagrams = item.anagrams.itemcount;
]
/ blocks = [
1 = demo;
2 = Anagram;
3 = finish;
]
Note: even groupnumbers run version B
=> all items from version B are stored in the dynamic lists list.anagrams and list.anagramSolutions
/ groups = (2 of 2)
/ onexptbegin = [
values.form = "B";
expressions.selectAnagrams_FormB;
values.nr_anagrams = item.anagrams.itemcount;
]
/ blocks = [
1 = demo;
2 = Anagram;
3 = finish;
]
**************************************************************************************************************
End of File
**************************************************************************************************************