-
Notifications
You must be signed in to change notification settings - Fork 0
/
myscript.js
98 lines (78 loc) · 1.95 KB
/
myscript.js
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
window.onload = function () {
console.log(2);
};
//FRAME A1
var lastClick = 0;
var mt11 = 0;
//clicking 1st circle
function A1_start(){
var d = new Date();
lastClick = d.getTime();
}
//clicking 2nd circle
function A1_done(){
var d = new Date();
var newclick = d.getTime();
mt11 = newclick- lastClick;
lastClick = 0;
document.getElementById('Mtime11').innerHTML = "The Movement Time 1 (MT1): "+ mt11 +" milliseconds";
}
//FRAME A2
var lastClick2 = 0;
var mt12 = 0;
//clicking 1st circle
function A2_start(){
var d = new Date();
lastClick2 = d.getTime();
}
//clicking 2nd circle
function A2_done(){
var d = new Date();
var newclick = d.getTime();
mt12 = newclick- lastClick2;
lastClick2 = 0;
document.getElementById('Mtime12').innerHTML = "The Movement Time 2 (MT2): "+ mt12 +" milliseconds";
}
//RATIO 1
function ratio1(){
var ratio = mt11/mt12;
document.getElementById('Ratio1').innerHTML = "___"+ratio.toFixed(2)+"___";
}
//FRAME B1
var lastClick3 = 0;
var mt21 = 0;
//clicking 1st circle
function B1_start(){
var d = new Date();
lastClick3 = d.getTime();
}
//clicking 2nd circle
function B1_done(){
var d = new Date();
var newclick = d.getTime();
mt21 = newclick- lastClick3;
lastClick3 = 0;
document.getElementById('Mtime21').innerHTML = "The Movement Time 1 (MT1): "+ mt21 +" milliseconds";
}
//FRAME B2
var lastClick4 = 0;
var mt22 = 0;
//clicking 1st circle
function B2_start(){
var d = new Date();
lastClick4 = d.getTime();
}
//clicking 2nd circle
function B2_done(){
var d = new Date();
var newclick = d.getTime();
mt22 = newclick- lastClick4;
lastClick4 = 0;
document.getElementById('Mtime22').innerHTML = "The Movement Time 2 (MT2): "+ mt22 +" milliseconds";
}
//RATIO 2
function ratio2(){
var ratio = mt21/mt22;
document.getElementById('Ratio2').innerHTML = "___"+ratio.toFixed(2)+"___";
}
// END