-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathselectParticipant.html
More file actions
52 lines (43 loc) · 1.72 KB
/
selectParticipant.html
File metadata and controls
52 lines (43 loc) · 1.72 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Admissions AI Experiment</title>
<script type="text/javascript" src="//code.jquery.com/jquery-1.9.1.js"></script>
<script type="text/javascript" src="js/d3.v5.min.js"></script>
<script type="text/javascript" src="js/experiment.js"></script>
<script src="pretask1.html"></script>
<link rel="stylesheet" type="text/css" href="instructionsstyle.css">
</head>
<body>
<div>
<span class="formLb">Participant:</span>
<select class="select" id="participantSel" onchange="onchangeParticipant()">
</select>
<!-- <a href="/preques.html">go to the first questionnair</a> -->
<script type="text/javascript">
// loads participants from the csv file to the select element
function loadData() {
d3.csv("ExpMixed5Blocks.csv").then(function(data) {
ctx.trials = data;
var participant = "";
var options = [];
for(var i = 0; i < ctx.trials.length; i++) {
if(!(ctx.trials[i][ctx.participantIndex] === participant)) {
participant = ctx.trials[i][ctx.participantIndex];
$("select#participantSel").append('<option value="' + participant + '">Participant '+ participant +'</option>');
}
}
});
}
loadData();
$('select#participantSel').change(function(){
// selectValue = d3.select('#participantSel').property('value');
localStorage.setItem('participant', $(this).val());
location.href = '/Instructions1.html';
/*
var par = localStorage.getItem('participant');
console.log(par);*/
});
</script>
</body>