-
Notifications
You must be signed in to change notification settings - Fork 1
/
choose_task.html
93 lines (76 loc) · 2.8 KB
/
choose_task.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
<!DOCTYPE html>
<html>
<head>
<script src="javascript/jquery-3.1.1.min.js"></script>
<script src="/assets/javascripts/jatos.js"></script>
<link rel="stylesheet" href="bootstrap-3.3.7/css/bootstrap.min.css">
<link href="static/css/forms.css" rel="stylesheet" type="text/css" media="all">
<script src="utils/uuid.js"></script>
</head>
<body>
<div class= "TaskDescription">
<div id="CHOOSE"></div>
<div></div>
<button id="TEXTURE" type="button" class="btn btn-success"></button>
<button id="COLOR" type="button" class="btn btn-success"></button>
<button id="SHAPE" type="button" class="btn btn-success"></button>
</div>
</div>
</div>
</div>
<script>
function sessionSuccess(){
console.log("Succesfully sent session data");
console.log(jatos.studySessionData);
}
function sessionFailure(){
console.log("Failed to send session data");
}
jatos.onLoad(function () {
jatos.studySessionData.phaseComponentIndex = 6;
jatos.studySessionData.taskComponentIndex = 7;
jatos.studySessionData.questionnaireComponentIndex =8;
jatos.studySessionData.studyStartComponentIndex =10;
var lang = "default";
if (jatos.studySessionData.language){
lang = jatos.studySessionData.language
}
choose_strings = {
"default": "<h2>Choose your visualisation type</h2>",
"fr": "<h2>Choisissez la sorte de visualisation</h2>"
}
button_strings = {
"default": {
"COLOR":"Color",
"TEXTURE":"Texture",
"SHAPE":"Shape",
},
"fr": {
"COLOR":"Couleur",
"TEXTURE":"Texture",
"SHAPE":"Forme",
},
}
$('#CHOOSE').html( choose_strings[lang] );
$("#TEXTURE").html(button_strings[lang]["TEXTURE"])
$("#COLOR").html(button_strings[lang]["COLOR"])
$("#SHAPE").html(button_strings[lang]["SHAPE"])
$("#TEXTURE").click(function(){
jatos.studySessionData["task_type"] = "TEXTURE";
jatos.submitResultData(JSON.stringify(jatos.studySessionData));
jatos.startNextComponent()
});
$("#COLOR").click(function(){
jatos.studySessionData["task_type"] = "COLOR";
jatos.submitResultData(JSON.stringify(jatos.studySessionData));
jatos.startNextComponent()
});
$("#SHAPE").click(function(){
jatos.studySessionData["task_type"] = "SHAPE";
jatos.submitResultData(JSON.stringify(jatos.studySessionData));
jatos.startNextComponent()
});
});
</script>
</body>
</html>