Group: Forum Members
Posts: 33,
Visits: 190
|
I will be providing participants with Subject ID and Group ID to input in Inquisit Web.
1. I want a script to run immediately after inputting Subject ID and Group ID to display that either: A) Yes, your Subject ID is correct, please continue. <Script goes onto Consent script> OR B) No, this is not a correct Subject ID. Please try again. <Script abort>
For this, I cannot seem to get the right branch script to call the SubjectID (or 'subject' as it appears in the data column) and compare it against a list of acceptable ID's that I have put into an item element. I may have other errors below as I am still a complete beginner and am still learning the logic/syntax of Inquisit :P
2. Also, do I need to add the long javascript code from the Inquisit help file, "Assigning subject numbers in Web Experiments", to allow participants accessing the Web experiment to enter their own SubjectID and GroupID? Or are these different from "Subject Number"?
Script so far:<instruct> /nextkey=(" ") </instruct>
<page valid> The Subject ID (<% script.subjectID %> ) you have input is correct! Please press Spacebar to continue with the survey. </page>
<page error> The Subject ID (<% script.subjectID %> ) you have input is incorrect. Please input carefully the Subject ID you were provided.^^ If you believe this is an error, please contact the coordinator, NAME HERE, at EMAIL HERE and provide your Group ID and Subject ID.^^ Press Spacebar to end the survey. </page>
<item ID> / 1="AAA" / 2="BBB" </item>
<expt > / blocks = [1 = Validation] </expt>
<trial Validation> /branch=[if (<% script.subjectid %> = item.ID) = true block.startsurvey] /branch=[if (<% script.subjectid %> = item.ID) = false block.error] /timeout = 100 /recorddata=false </trial>
<trial error> /ontrialbegin = [script.abort();] /timeout = 1 /ontrialend = [script.abort();] /recorddata=false </trial>
<block Validation> /trials = [1 = Validation] </block>
<block startsurvey> / preinstructions = (valid) /recorddata = false </block>
<block error> / preinstructions = (error) /trials = [1 = error] /recorddata = false </block>
|