-
Notifications
You must be signed in to change notification settings - Fork 0
/
test-1.html
executable file
·227 lines (198 loc) · 10.1 KB
/
test-1.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
220
221
222
223
224
225
226
227
<!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="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 conditions = urlParams.get('vis').split(",");
var charts = urlParams.get('ch').split(",");
if (charts == "m") {n_regions = 12} else {n_regions = 8};
// var incentives = urlParams.get('alpha').split(",");
TimeMe.initialize({
currentPageName: "test-1", // current page
idleTimeoutInSeconds: 120, // stop recording time due to inactivity
});
</script>
</head>
<body>
<div class="row">
<div class="container-fluid">
<div class="col-md-10 col-md-offset-1">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<h2 class="margin-top-md">Visualization Insights study</h2><br>
<h2>Tutorial</h2>
<p>You will get to know your task on this tutorial page. Please read carefully and try out the task on this page before proceeding to the actual study.</p><br>
<!-- In each trial, we will show you 10 graphs. Your goal is to identify the regions where your company is making a profit on average, from these graphs. Each region has 200 stores, but we only have the data for a randomly selected sample of 20 stores from each region. -->
<h3>Background story of your task</h3>
<div class="row">
<div class="col-sm-12">
<p><img class="vis-desc" src="images/ci_calc_plot.png" align="right"/>You are a manager supervising the sales of a group of stores across <span id = "nregions">TODO</span> regions. Each region has 200 stores. <span class="highlight2">Your job is to make judgment calls now and pick out the promising regions where the average store is making a profit</span> (profit > 0). So far, however, you've only received sales data for 20 random stores (out of 200) in each region. To help you evaluate the regional profits with incomplete data, your business analyst used statistics and created plots, like the ones shown on the right.
</p><br>
<p>Keep in mind that each graph only show sales data from the 20 random stores, out of the 200 stores in each region. So even if the average store is making profit in the graph, the other stores in the region might be loosing a lot of money. It is up to you to assess if the <b>all</b> the stores in the region are making profits on average.
</p>
<p>
Once you have tried picking out the profitable regions below, you can compare your judgment to the actual data on the next screen.</p><br>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<h3>How your job performance is evaluated</h3>
<p><img id="payoff-img" src="images/payoff_5.png" align="right">
Your job of picking out profitable regions without full sets of data is risky. You will win or lose corporate brownie points based on the rules below, and of course <span class="highlight2">your goal is to maximize your points for the next promotion (and bonus pay).</span>
<!-- By clicking on a region, you indicate that you think the region has a profit greater than zero. Your goal is to maximise your points. -->
<ul>
<li>✅ If you think a region is profitable on average and <b>select</b> it now based on the 20 stores, and that region <b>does have</b> an average profit greater than zero based on all 200 stores, you will receive 20 points. <!-- This is a <i>True Positive</i>.--></li>
<li>✅ If you <b>do not select</b> a region, and that region <b>does not</b> have a profit greater than zero on average, you will receive 20 points. <!-- This is a <i>True Negative</i>. --></li>
<li>❌ If you <b>select</b> a region, and that region <b>does not</b> have a profit greater than zero, on average, you will lose <span class="highlight">380 points.</span><!-- This is a <i>False Positive</i>. --></li>
<li>❌ If you <b>do not select</b> a region, and that region <b>does have</b> a profit greater than zero, on average, you will lose 20 points. <!-- This is a <i>False Negative</i>. --></li>
</ul>
</p>
</div>
</div>
<h3 class="margin-top-sm">Try out your task</h3>
<p><i>Click on the regions</i> you think are making a profit.
Keep in mind that each graph only show sales data from the 20 random stores, out of the 200 stores in each region. You can click on multiple stores.</p>
</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>
</div>
</div>
<div class = "row">
<div class="container">
<div class="btn-container">
<div class="btn" id="submit-btn">Submit</div>
</div>
</div>
</div>
</body>
<script type="text/javascript">
var selected = [];
var img_order = [...Array(12).keys()].map( i => ++i );
var n_regions = 12;
$("span#nregions").text(n_regions);
// var i_level = Math.floor(Math.random() * levels.length);
url = "https://raw.githubusercontent.com/MUCollective/vis-insight-reliability/stimuli/plots/example/profits-t0-p0.5-";
$("div#opt-1").append('<img class = "question-graphic">').children().attr("src", url + img_order[0] + ".png");
$("div#opt-2").append('<img class = "question-graphic">').children().attr("src", url + img_order[1] + ".png");
$("div#opt-3").append('<img class = "question-graphic">').children().attr("src", url + img_order[2] + ".png");
$("div#opt-4").append('<img class = "question-graphic">').children().attr("src", url + img_order[3] + ".png");
$("div#opt-5").append('<img class = "question-graphic">').children().attr("src", url + img_order[4] + ".png");
$("div#opt-6").append('<img class = "question-graphic">').children().attr("src", url + img_order[5] + ".png");
$("div#opt-7").append('<img class = "question-graphic">').children().attr("src", url + img_order[6] + ".png");
$("div#opt-8").append('<img class = "question-graphic">').children().attr("src", url + img_order[7] + ".png");
$("div#opt-9").append('<img class = "question-graphic">').children().attr("src", url + img_order[8] + ".png");
$("div#opt-10").append('<img class = "question-graphic">').children().attr("src", url + img_order[9] + ".png");
$("div#opt-11").append('<img class = "question-graphic">').children().attr("src", url + img_order[10] + ".png");
$("div#opt-12").append('<img class = "question-graphic">').children().attr("src", url + img_order[11] + ".png");
$(function() {
$('.question-container').hover(function() {
$(this).css('background', '#3CA8FF');
$(this).css('color', '#fff');
}, function() {
// on mouseout, reset the background colour
$(this).css('background', '');
$(this).css('color', '#333333');
});
});
$(".question-container").click(function () {
$(this).toggleClass("selected");
var id_str = $(this).children().attr("src").split("-");
var id = id_str[id_str.length - 1].split(".")[0];
if (!selected.includes(id)) {
selected.push(id);
} else {
var index = selected.indexOf(id);
if (index !== -1) selected.splice(index, 1);
}
});
$("div#submit-btn").on('click', submitResponse);
console.log(mod);
// send response to DB
function submitResponse() {
// uses global value for 'selected'
// Time spent on page
var t = Math.round(TimeMe.getTimeOnCurrentPageInSeconds() * 1000) / 1000;
window.location.href = 'test-2.html?PROLIFIC_PID='+prolific_PID+'&SESSION_ID='+session_ID+'&modulo='+mod+'&vis='+conditions+'&ch='+charts+'&selected='+selected+'';
}
</script>
</html>