-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
165 lines (140 loc) · 5.89 KB
/
index.html
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
<!DOCTYPE html>
<html>
<head>
<title>My experiment</title>
<div id="experiment_link">You must accept the HIT to begin the experiment</div>.
<script src="https://unpkg.com/jspsych@7.3.1"></script>
<script src="https://unpkg.com/@jspsych/plugin-survey-likert@1.1.2"></script>
<script src="https://unpkg.com/@jspsych/plugin-call-function@1.1.2"></script>
<script src="https://unpkg.com/@jspsych/plugin-video-keyboard-response@1.1.2"></script>
<link href="https://unpkg.com/jspsych@7.3.1/css/jspsych.css" rel="stylesheet" type="text/css" />
<!-- jsPsychSheet library -->
<script src="jspsychsheet.js"></script>
<link rel="stylesheet" href="jspsychsheet.css">
<!-- jQuery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
</head>
<body></body>
<script>
const jsPsych = initJsPsych();
// jsPsych has a method turkInfo() which can determine whether or not the
// HIT has been accepted.
var turkInfo = jsPsych.turk.turkInfo();
// turkInfo.previewMode is true in two cases: when the HIT has not been
// accepted yet OR when the page is viewed outside of mechanical turk.
// The second property, outsideTurk, is true when the page is viewed
// outside of mechanical turk, so together, the statement will be true
// only when in Turk and when the HIT is not accepted yet.
if(!turkInfo.previewMode && !turkInfo.outsideTurk) {
document.querySelector('#experiment_link').innerHMTL = '<a href="link_to_experiment.html" target="_blank">Click Here to Start Experiment</a>';
}
var timeline = [];
// var preload = {
// type: 'preload',
// auto_preload: true
// }
var trial_video = {
type: jsPsychVideoKeyboardResponse,
prompt: "Please watch the following video in full",
stimulus: [
'https://psychexp.s3.amazonaws.com/file_example_MP4_640_3MG.mp4'
],
choices: "NO_KEYS",
controls: true,
trial_ends_after_video: true
};
timeline.push(trial_video);
var trial_seen = {
type: jsPsychSurveyLikert,
preamble: "On a scale of “1”to “7”, please rate how likely you’ve seen the video before?",
questions: [{
prompt: "", name: 'Q1', required: true,
labels: [["1","Definitely Not Seen"], ["2"], ["3"], ["4","Neutral"], ["5"], ["6"], ["7","Definitely Seen"]]
}],
};
timeline.push(trial_seen);
var trial_adj = {
type: jsPsychSurveyLikert,
preamble: "Please rate the video content on each set of adjectives",
questions: [{
prompt: "", name: 'Q2',
labels: ["1 (Dull)", "2", "3", "4", "5", "6", "7 (Exiting)"]
}, {
prompt: "", name: '',
labels: ["1 (Fresh)", "2", "3", "4", "5", "6", "7 (Routine)"]
}, {
prompt: "", name: '',
labels: ["1 (Novel)", "2", "3", "4", "5", "6", "7 (Predictable)"]
}, {
prompt: "", name: '',
labels: ["1 (Usual)", "2", "3", "4", "5", "6", "7 (Unusual)"]
}, {
prompt: "", name: '',
labels: ["1 (Unique)", "2", "3", "4", "5", "6", "7 (Ordinary)"]
}, {
prompt: "", name: '',
labels: ["1 (Commonplace)", "2", "3", "4", "5", "6", "7 (Original)"]
}, {
prompt: "", name: '',
labels: ["1 (Trendsetting)", "2", "3", "4", "5", "6", "7 (Warmed Over)"]
}, {
prompt: "", name: '',
labels: ["1 (Average)", "2", "3", "4", "5", "6", "7 (Revolutionary)"]
}, {
prompt: "", name: '',
labels: ["1 (Nothing Special)", "2", "3", "4", "5", "6", "7 (An Industry Model)"]
}
],
randomize_question_order: false
};
timeline.push(trial_adj);
scale_7 = ["1 (Disagree Strongly)", "2 (Disagree Somewhat)", "3 (Neutral)", "4 (Agree Somewhat)", "5 (Agree Strongly)", "6 (Fully Agree)", "7 (Completely Agree)"]
var trial_presenter = {
type: jsPsychSurveyLikert,
preamble: "On a scale of “1”to “7”, please rate the extend of the following sentences that describes how you think the presenter in the video is.",
questions: [{
prompt: "The presenter(s) had energetic body movements.", name: '',
labels: scale_7
},{
prompt: "The presenter(s) had rich body language.", name: '',
labels: scale_7
},{
prompt: "The presenter(s) showed animated facial expression.", name: '',
labels: scale_7
},{
prompt: "The presenter(s) used a lot of gestures.", name: '',
labels: scale_7
},{
prompt: "The presenter’s face lit up when he/she or he talked.", name: '',
labels: scale_7
},{
prompt: "The presenter(s) talked with varied tone and pitch.", name: '',
labels: scale_7
},{
prompt: "The presentation content had substance.", name: '',
labels: scale_7
},{
prompt: "The presentation was thoughtful and in-depth.", name: '',
labels: scale_7
},{
prompt: "The presenter(s) articulated the relationship between the business plan and the broader context.", name: '',
labels: scale_7
},{
prompt: "The presenter(s) cited facts to support his/her arguments.", name: '',
labels: scale_7
}],
randomize_question_order: false
};
timeline.push(trial_presenter);
var trial_send = {
type: jsPsychCallFunction,
async: true,
func: function(done){
console.log(jsPsych.data.get().json())
url = "https://script.google.com/macros/s/AKfycbyBpM5XMJOK73mfgnJ16bb8nx41HOAEfUtVqJYsSXFZ_qlqtLGmmvoObuM0R80pyVMj/exec"
jsPsychSheet.uploadData(url, jsPsych.data.get().csv())
}}
timeline.push(trial_send);
jsPsych.run(timeline);
</script>
</html>