Last active
October 20, 2023 02:09
-
-
Save kishiyamat/c0263a634c4897266ff354bab4b71cf5 to your computer and use it in GitHub Desktop.
ラテンスクエアの差分 + randomized
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PennController.ResetPrefix(null); // Shorten command names (keep this line here)) | |
//DebugOff() // Uncomment this line only when you are 100% done designing your experiment | |
// NOTE: Empty project からではなく Self-Paced Reading を選択してから作業する | |
// これは PennController.js が機能しないため。もしEmptyから作成したい場合、以下をDLしてULする。 | |
// https://github.com/PennController/penncontroller/blob/master/releases/2.0/PennController.js | |
// First show instructions, then experiment trials, send results and show end screen | |
// https://doc.pcibex.net/advanced-tutorial/10_counterbalancing.html#randomizing-item-order | |
Sequence("instructions", randomize("experiment"), SendResults(), "end") | |
// This is run at the beginning of each trial | |
// Declare a global Var element "ID" in which we will store the participant's ID | |
Header(newVar("ID").global()) | |
.log("id", getVar("ID")) // Add the ID to all trials' results lines | |
// Instructions | |
newTrial("instructions", | |
// Automatically print all Text elements, centered (これは大事) | |
defaultText.center().print(), | |
// 表示させる内容 | |
newText("Welcome!"+"<br>"+ | |
"In this task, you will have to read few sentences."+"<br>"+ | |
"Are you ready?"+"<br>"+ | |
"Please type in your ID below and then click on the Start button "+ | |
"to start the experiment."), | |
// Save ID -> Validate -> Store | |
newTextInput("inputID", "").center().print(), | |
// Only validate a click on Start when inputID has been filled | |
newButton("Start").center().print().wait(getTextInput("inputID").testNot.text("")), | |
// Store the text from inputID into the Var element in global scope | |
getVar("ID").set(getTextInput("inputID")) | |
) | |
Template("items.csv", row => | |
newTrial("experiment", | |
newController( | |
"AcceptabilityJudgment", | |
{s : row.sentence, | |
as: ["1", "2", "3", "4", "5", "6", "7"], | |
presentAsScale: true, | |
leftComment: "Not Natural", | |
rightComment: "Natural"}) | |
.print().log().wait().remove() | |
) | |
.log("group", row.group) | |
.log("item", row.item) | |
.log("type", row.type) | |
.log("cond_a", row.cond_a) | |
.log("cond_b", row.cond_b) | |
) | |
// Final screen | |
newTrial("end", | |
newText("Thank you for your participation!").center().print(), | |
// This link a placeholder: replace it with a URL provided by your participant-pooling platform | |
// newText("<p><a href='https://www.pcibex.net/' target='_blank'>" + | |
// "Click here to validate your submission</a></p>").center().print(), | |
// Trick: stay on this trial forever (until tab is closed) | |
newButton().wait() | |
) | |
.setOption("countsForProgressBar",false) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment