-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
167 lines (158 loc) · 4.26 KB
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
// Type code below this line.
// Remove command prefix
PennController.ResetPrefix(null)
var showProgressBar = false;
// Turn off debugger
DebugOff()
Sequence ("welcome", "info", "instructions1", "instructions2", rshuffle("experimental-trial", "filler-trial"))
// Instructions
newTrial("welcome",
defaultText
.center()
.print()
,
newText("instructions-1", "Welcome!")
,
newText("instructions-2", "<p>Thank you very much for your participation! \
This experiment is part of a Cornell University scientific research project. \
Your decision to complete participant is voluntary. There is no way for us to identify you. \
The only information we will have, in addition to your responses, is the time at which \
you completed the survey. The results of the research may be presented at scientific meetings \
or published in scientific journals. Clicking on the link below indicates that you are at \
least 18 years of age and agree to complete this experiment voluntarily.</p>")
,
newButton("wait", "Click to start the experiment")
.center()
.print()
.wait()
)
newTrial("info",
defaultText
.center()
.print()
,
newText("instructions-1", "Please fill out some background information about yourself.")
,
newText("instructions-2", "<p>Please enter your age: </p>")
,
newTextInput("age", "")
.log()
.lines(1)
.length(2)
.size(50, 25)
.center()
.print()
,
newText("instructions-3", "<p>Are you a native speaker of English? [y/n] </p>")
,
newTextInput("native_speaker", "")
.log()
.lines(1)
.length(1)
.lines(0)
.size(50, 25)
.center()
.print()
,
newText("newline", "\n")
,
newButton("wait", "Continue")
.center()
.print()
.wait()
)
newTrial("instructions1",
defaultText
.center()
.print()
,
newText("instructions-1", "Please rate each item in terms of its acceptability on a scale from 1–7, \
with a 7 rating meaning that “the sentence is perfectly acceptable in English and that you can imagine \
yourself or other native speakers saying it.")
.center()
,
newText("instructions-2", "<p>For example, please rate the acceptability of the following sentence: \n \
The cat is black. <p>")
,
newScale("acceptability", 7)
.center()
.before(newText("Unacceptable"))
.after(newText( "Perfectly Acceptable"))
.print()
.wait()
,
newButton("wait", "Continue")
.center()
.print()
.wait()
)
newTrial("instructions2",
defaultText
.center()
.print()
,
newText("instructions-1", "<p>Please rate the acceptability of the following sentence: \n \
Cat walk orange kick themselves. <p>")
,
newScale("acceptability", 7)
.center()
.before(newText("Unacceptable"))
.after(newText( "Perfectly Acceptable"))
.print()
.wait()
,
newButton("wait", "Continue")
.center()
.print()
.wait()
)
// Experimental trial
Template("items.csv", row =>
newTrial("experimental-trial",
newText("sentence", row.Sentence)
.center()
.print()
,
newScale("response", 7)
.log()
.center()
.before(newText("Unacceptable"))
.after(newText( "Perfectly Acceptable"))
.print()
.wait()
,
newButton("wait", "Continue")
.center()
.print()
.wait()
)
.log("itemType", "experimental")
.log("itemNo", row.Item)
.log("constructionType", row.Construction)
.log("gapType", row.Gap)
)
// filler trial
Template("fillers.csv", row =>
newTrial("filler-trial",
newText("sentence", row.Sentence)
.center()
.print()
,
newScale("response", 7)
.log()
.center()
.before(newText("Unacceptable"))
.after(newText( "Perfectly Acceptable"))
.print()
.wait()
,
newButton("wait", "Continue")
.center()
.print()
.wait()
)
.log("itemType", "filler")
.log("itemNo", "NA")
.log("constructionType", "NA")
.log("gapType", "NA")
)