-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
82 lines (75 loc) · 1.9 KB
/
app.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
var nickName = prompt('Ingrese su Nickname porfavor');
var challengeQuestion = prompt('Deseas participar? : \n 1: Sí \n 2: No');
if (challengeQuestion === '1') {
document.getElementById("nickName").innerHTML = nickName;
} else if (challengeQuestion === '2'){
alert('Oki ' + nickName + ' inténtalo luego :)');
}
function corregir(){
var p1
var p2
var p3
var aciertos = 0
var fallos = 0
var blancos = 0
var nota
var notaFinal
if (document.getElementById('p11').checked==true) {
p1 = 1;
aciertos++;
}else if (document.getElementById('p12').checked==true){
p1 = -0.5;
fallos++;
}else if (document.getElementById('p13').checked==true){
p1 = -0.5;
fallos++;
}else if (document.getElementById('p14').checked==true){
p1 = -0.5;
fallos++;
}else{
p1= -0.1;
blancos++;
}
if (document.getElementById('p21').checked==true) {
p2 = 1;
aciertos++;
}else if (document.getElementById('p22').checked==true){
p2 = -0.5;
fallos++;
}else if (document.getElementById('p23').checked==true){
p2 = -0.5;
fallos++;
}else if (document.getElementById('p24').checked==true){
p2 = -0.5;
fallos++;
}else{
p2= -0.1;
blancos++;
}
if (document.getElementById('p31').checked==true) {
p3 = 1;
aciertos++;
}else if (document.getElementById('p32').checked==true){
p3 = -0.5;
fallos++;
}else if (document.getElementById('p33').checked==true){
p3 = -0.5;
fallos++;
}else if (document.getElementById('p34').checked==true){
p3 = -0.5;
fallos++;
}else{
p3= -0.1;
blancos++;
}
nota = p1+p2+p3;
if(nota<0){
puntuacion = 0;
}else{
puntuacion = nota;
}
document.getElementById('aciertos').value = aciertos;
document.getElementById('fallos').value = fallos;
document.getElementById('blancos').value = blancos;
document.getElementById('puntuacion').value = puntuacion;
}