/
trial.html
executable file
·219 lines (195 loc) · 7.85 KB
/
trial.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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Visualization Insights</title>
<!-- Bootstrap Core CSS -->
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom CSS -->
<link href="css/custom.css" rel="stylesheet">
<!-- Custom Fonts -->
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<!-- Custom JavaScript -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src=//cdnjs.cloudflare.com/ajax/libs/seedrandom/2.3.10/seedrandom.min.js></script>
<script src="js/timeme.js"></script>
<!-- <script src="https://d3js.org/d3.v4.min.js"></script> -->
<script type="text/javascript">
var urlParams = new URLSearchParams(window.location.search);
var prolific_PID = urlParams.get('PROLIFIC_PID');
var session_ID = urlParams.get('SESSION_ID');
var mod = urlParams.get('modulo');
var prev_param = urlParams.get('ret');
var conditions = urlParams.get('vis').split(",");
var charts = urlParams.get('ch').split(",");
var n_regions;
if (prev_param == "null") {
prev_trial = JSON.parse("[" + window.atob("MCwgbnVsbCwgbnVsbCwgbnVsbCwgbnVsbCwgMA") + "]");
} else {
prev_trial = JSON.parse("[" + window.atob( prev_param ) + "]");
}
console.log(prev_trial);
zip = zip = (...rows) => [...rows[0]].map((_,c) => rows.map(row => row[c]));
var count = prev_trial[0];
var prev = zip(['tp', 'tn', 'fp', 'fn'], prev_trial.slice(1, 5)).reduce(function(map, obj) {
map[obj[0]] = obj[1];
return map;
}, {});
var cumulative_payout = prev_trial[5];
TimeMe.initialize({
currentPageName: "trial", // current page
idleTimeoutInSeconds: 120, // stop recording time due to inactivity
});
</script>
</head>
<body>
<div class="row">
<div class="container-fluid">
<div id="popup">
<div class="error-msg">
<p>Hmmm something went wrong.<br>Please click "Close" and try submitting again.<br>Do not go back or restart.</p>
<div id="close-popup">Close</div>
</div>
<div class="overlay"></div>
</div>
<div class="col-sm-10 col-sm-offset-1">
<div class="row">
<div class="col-sm-10 col-sm-offset-1">
<h3 class="margin-top-md">Visualization Insights study</h3>
<p>You are supervising the sales of a group of stores across <span id="nregion">TODO</span> regions. Each region has 200 stores. You want to find out if the stores are making a profit in each region. However, you only have the data for 20 randomly selected stores from the 200 stores in each region. Below, we show the profit for these 20 stores. Click on the regions you think are making a profit. You can select multiple regions.</p>
<h4 class="prev-trial-review margin-top-md">Previous trial review</h4>
<div class="row prev-trial-review prev-trial-container">
<div class="prev-trial prev-trial-label">
<p><i>Previous trial:</i></p>
</div>
<div class="prev-trial prev-trial-info">
<p>
<span class="result-prev prev-tp"></span>
<span class="result-prev prev-tn"></span>
<span class="result-prev prev-fp"></span>
<span class="result-prev prev-fn"></span>
</p>
</div>
</div>
<p class = "prev-trial-review">
<span id="payoff-prev"></span><br>
<span id="payoff">Total Payoff: 0</span>
</p>
<p id="payoff-note" class = "prev-trial-review">
<i>Note: we will provide you with feedback for only the first five trials.</i>
</p>
<h4 class="margin-top-md">Current trial: No. <span id="trial-num">1</span>/70</h4>
</div>
</div>
<div class="row">
<div class="col-lg-2 col-sm-3">
<div class = "question-container" id = "opt-1">
<p class="region-label">Region 1</p>
</div>
</div>
<div class="col-lg-2 col-sm-3">
<div class = "question-container" id = "opt-2">
<p class="region-label">Region 2</p>
</div>
</div>
<div class="col-lg-2 col-sm-3">
<div class = "question-container" id = "opt-3">
<p class="region-label">Region 3</p>
</div>
</div>
<div class="col-lg-2 col-sm-3">
<div class = "question-container" id = "opt-4">
<p class="region-label">Region 4</p>
</div>
</div>
<div class="col-lg-2 col-sm-3">
<div class = "question-container" id = "opt-5">
<p class="region-label">Region 5</p>
</div>
</div>
<div class="col-lg-2 col-sm-3">
<div class = "question-container" id = "opt-6">
<p class="region-label">Region 6</p>
</div>
</div>
<div class="col-lg-2 col-sm-3">
<div class = "question-container" id = "opt-7">
<p class="region-label">Region 7</p>
</div>
</div>
<div class="col-lg-2 col-sm-3">
<div class = "question-container" id = "opt-8">
<p class="region-label">Region 8</p>
</div>
</div>
<div class="col-lg-2 col-sm-3">
<div class = "question-container" id = "opt-9">
<p class="region-label">Region 9</p>
</div>
</div>
<div class="col-lg-2 col-sm-3">
<div class = "question-container" id = "opt-10">
<p class="region-label">Region 10</p>
</div>
</div>
<div class="col-lg-2 col-sm-3">
<div class = "question-container" id = "opt-11">
<p class="region-label">Region 11</p>
</div>
</div>
<div class="col-lg-2 col-sm-3">
<div class = "question-container" id = "opt-12">
<p class="region-label">Region 12</p>
</div>
</div>
</div>
<div class="row">
<div class="btn-container">
<div class="btn" id="submit-btn">Submit</div><br>
<div class="btn-inv" id="submit-none-btn">None of the regions are profitable</div>
</div>
</div>
<div class="row">
<div class="col-lg-10 col-lg-offset-1">
<div class="row">
<div class="col-md-6" style = "text-align: center;">
<h4>Description of visualization</h4>
<img class="vis-desc-2" src="images/dotplot_calc_plot.png"/>
</div>
<div class="col-md-6" style = "text-align: center;">
<h4>Reward structure</h4>
<img id="payoff-img-2" src="images/payoff_5.png"/>
<!-- <ul>
<li>✅ If you <b>click</b> on a region, and that region <b>does have</b> a profit greater than zero, on average, you will receive 20 points. </li>
<li>✅ If you <b>do not click</b> on a region, and that region <b>does not</b> have a profit greater than zero on average, you will receive 20 points. </li>
<li>❌ If you <b>click</b> on a region, and that region <b>does not</b> have a profit greater than zero, on average, you will lose <span class="highlight" id="fp-val">380 points.</span></li>
<li>❌ If you <b>do not click</b> on a region, and that region <b>does have</b> a profit greater than zero, on average, you will lose 20 points. </li>
</ul> -->
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
<script type="text/javascript" src="js/custom.js"></script>
<script type="text/javascript">
var conditions = urlParams.get('vis').split(",");
var vis = conditions[0];
if (vis != "hops-1" & vis!= "hops-2"){
$("img.vis-desc-2").attr("src", "images/"+ vis +"_calc_plot.png");
} else {
$("img.vis-desc-2").attr("src", "images/"+ vis +"_calc_plot.gif");
}
// Disabling the return to this page from the survey
$(document).ready(function() {
function disableBack() { window.history.forward() }
window.onload = disableBack();
window.onpageshow = function(evt) { if (evt.persisted) disableBack() }
});
</script>
</html>