diff --git a/css/main.css b/css/main.css index 6355c827..db891de1 100644 --- a/css/main.css +++ b/css/main.css @@ -1,3 +1,119 @@ -/* - * Estilos de tu proyecto - */ +*{ + font-family: 'Armata', sans-serif; +} +header{ + width: 100%; + text-align: center; + height: 15%; +} +header img { + width: 20%; + height: 100%; +} +h3{ +font-family: 'Source Code Pro', monospace; +font-size: 25px; +display: inline-block; +padding-left: 5%; +} +h3 a{ +font-family: 'Source Code Pro'; +text-decoration: none; +color: black; +} +h3 a:hover{ +color: #FFA500; +font-weight: bolder; +} +.optionsheader h3:hover{ + color: #FFA500; + font-weight: bolder; +} +a{ + text-decoration: none; + text-align: center; + display: block; + border-radius: 5px; + margin-bottom: 2px; +} +#sede_generation{ + cursor: pointer; + margin-left: 5%; + display: block; + background-color: #FFA500; + padding: 10px 10px; + color: #fff; + border-radius: 5px; + border: 0; + font-weight: 600; + margin-bottom: 7px; +} +.sede{ + padding: 5px; + width: 90px; + font-size: 18px; + background-color: #727171; + color: #000000; + margin-top: 10px; + margin-bottom: 10px; +} +.sede:hover{ + background-color: #FFA500; +} +a .sede{ + background-color:#FFA500 ; +} +.hiden { + display: none; +} +.show { + display: block; +} +.generation{ + width: 100px; + background-color: #D0D0D0; + font-size: 16px; +} +.container_students{ + outline: 1px solid green; + margin: 1%; + display: block; +} +.perfil img{ + padding: 1.5%; + outline: 1px solid yellow; + display: inline; +} +.perfil .basic_data_perfil{ + position: relative; + padding: 1%; + padding-left: 2%; + outline: 1px solid blue; + display: inline-block; +} +.basic_data_perfil div{ + width: 15%; + outline: 1px solid orange; + display: block; +} +.basic_data_perfil div span{ + outline: 1px solid red; + display: inline-block; +} +.basic_data_perfil div h2{ + font-size: 15px; + outline: 1px solid purple; + display: inline-block; +} +#skills{ + text-align: center; + padding: 1%; + outline: 1px solid black; + display: inline-block; +} +.container_students table{ + margin-left: 1%; + padding: 2%; + outline: 1px solid blue; + display: inline-block; +} diff --git a/estadistics.html b/estadistics.html new file mode 100644 index 00000000..0b9fefed --- /dev/null +++ b/estadistics.html @@ -0,0 +1,30 @@ + + + + + + +
+ + + + + diff --git a/index.html b/index.html index 8930fa03..27ba40ad 100644 --- a/index.html +++ b/index.html @@ -3,8 +3,43 @@ Data Dashboard + + +
+ logo +
+ +
+

OVERVIEW

+

STUDENTS

+
+ +
+ Arequipa +
+ 2016-2 + 2017-1 +
+ Mexico +
+ 2017-1 + 2017-2 +
+ Lima +
+ 2016-2 + 2017-1 + 2017-2 +
+ Chile +
+ 2016-2 + 2017-1 + 2017-2 +
+
diff --git a/js/app.js b/js/app.js index 895ae2dd..dd565fb1 100644 --- a/js/app.js +++ b/js/app.js @@ -1,6 +1,275 @@ +window.addEventListener('load', function() { + // variable que almacena el texto junto de sede y generacion, el cual se muestra en la pantalla + var sedeGeneration = document.getElementById('sede_generation'); + // console.log(sedeGeneration); // NUESTRAS SEDES + + // variable que almacena la lista de sedes + var listSedes = document.getElementById('listSedes'); + // console.log(listSedes); //
+ + var listGenerations = document.querySelectorAll('.listGenerations'); + // console.log(listGenerations); // todos los div con las generaciones + // console.log(listGenerations.children); + + var generations = document.querySelectorAll('.generation'); + // console.log(generations); // (10) [a.generation, a.generation, a.generation, a.generation, a.generation, a.generation, a.generation, a.generation, a.generation, a.generation] + + var sedes = document.querySelectorAll('.sede'); + // console.log(sedes); // [a.sede =arequipa, a.sede =mexico, a.sede = lima, a.sede = chile] // lista de nodos + + sedeGeneration.addEventListener('click', showListSedes); + function showListSedes(event) { + listSedes.classList.toggle('show'); + }; + + for (var i = 0; i < sedes.length; i++) { + sedes[i].addEventListener('click', function(event) { + // console.log(event.target); // Arequipa + var sede = event.target.dataset.sede; + console.log('la sede es : ' + sede); // AQP + // console.log(typeof sede); // string + + for (var j = 0; j < listGenerations.length; j++) { + listGenerations[j].addEventListener('click', function(event) { + // sconsole.log(event.target); + + var generation = event.target.dataset.generation; + console.log('la generación es: ' + generation);// 2016-2 + // console.log(typeof generation); //string + var students = data[sede][generation]['students']; // array de toda la data de students + var totalstudents = data[sede][generation].students.length ; // numero de estudiantes de la sede y generación escogida + // console.log(data[sede][generation].ratings.length); + console.log('la cantidad de estudiantes en esta sede y generación es: ' + totalstudents); + + // puntuacion promedio de los profes + var promTeacher = 0; + for (i = 0; i < data[sede][generation]['ratings'].length; i++) { + var promTeacher = promTeacher + data[sede][generation]['ratings'][i].teacher; + }; + console.log('promedio de teachers: ' + promTeacher); + + // puntuacion promedio de los jedis + var promJedi = 0; + for (i = 0; i < data[sede][generation]['ratings'].length; i++) { + var promJedi = promJedi + data[sede][generation]['ratings'][i].jedi; + }; + console.log('promedios de jedis: ' + promJedi); + + // porcentaje de estudiantes satisfechas + var satisfiedStudents = 0; + for (i = 0; i < data[sede][generation]['ratings'].length; i++) { + var satisfiedStudents = satisfiedStudents + data[sede][generation]['ratings'][i].student.cumple; + }; + console.log('estudiantes satisfechas : ' + satisfiedStudents); + + // total promoters + var promoters = 0; + for (i = 0; i < data[sede][generation]['ratings'].length; i++) { + var promoters = promoters + data[sede][generation]['ratings'][i]['nps']['promoters']; + }; + + // total detractors + var detractors = 0; + for (i = 0; i < data[sede][generation]['ratings'].length; i++) { + var detractors = detractors + data[sede][generation]['ratings'][i]['nps']['detractors']; + }; + + // total nps + var nps = promoters - detractors; + console.log('nps: ' + nps); + + // cantidad y el porcentaje que representa el total de estudiantes que superan la meta de puntos tecnicos 70% en promedio por todos los sprints sprint + /*var studentsSuperan = 0; + for (j = 0; j < data[sede][generation]['students'][i]['sprints'].length; j++) { + if (data[sede][generation]['students'][i]['sprints'][j]['score']['tech'] > 1260) { + studentsSuperan ++; + } else { + studentsSuperan = studentsSuperan; + } + };// for que recorre cada srpint de todas las esrudianyes de la sede y generacion escogida + console.log('cantidad de estudiantes que superan la meta puntos tecnicos de todos los sprint: ' + studentsSuperan);*/ + + + // creando for que recorra los datos de las estudiantes + for (m = 0; m < totalstudents; m++) { + var arrStudents = students[m] ; + activeStudents = 0 ; + // condicion que solo recorre estuidnates activas + if (arrStudents.active === true) { + var activeStudents = (activeStudents + 1); + + console.log('las estudiantes activas son: ' + activeStudents); + + // cantidad y el porcentaje que representa el total de estudiantes que superan la meta de puntos tecnicos 70% en promedio por todos los sprints sprint + var superantech = 0; + for (k = 0; k < students[m]['sprints'].length; k++) { + var score = students[m]['sprints'][k]['score'] ; + if (score['tech'] > 1260) { + superantech ++; + } else { + superantech = superantech; + } + };// for que recorre cada srpint de todas las esrudianyes de la sede y generacion escogida + console.log('cantidad de estudiantes que superan la meta puntos tecnicos de todos los sprint: ' + superantech); + //}// condicion que solo recorre estudiantes activas + /* + for (var j = 0; j < data[sede][generation]['students'][i]['sprints'].length; j++) { + + var score = data[sede][generation]['students'][i]['sprints'][j]['score'] ; + // console.log(data[sede][generation]['students'][i]['sprints'][j]['score']); + // console.log(data[sede][generation]['students'][i]['sprints'][j]['score']['tech']); + if (score['tech'] > 1260) { + var HighScoreTech = score['tech']; + console.log(HighScoreTech); + }; + } + + // # de estudiantes que pasaron el 70% en Tech y Hse0 + /* var scoreHse = ''; + for (var i2 = 0; i2 < data[sede][generation]['students'][i]['sprints'].length; i2++) { + if (score[i2].hse > 840 && score[i2].tech > 1260) { + var studentsHighScore = score[i2].hse.length; + console.log(studentsHighScore); + }; + }; */ + } ;// condicion que toma en cuenta solo etudinates activas + }; // for que recorre la data de todad las estudinates de la sede y genración escogida + + + // espacio puesto a proposito para separar. + }); // evento que sucede al dar click en cualquier generación; + };// for que recorre las generaciones para hacer eventos click en cualquier generacipon + });// función o evento general click en cualquier sede multiples eventos + };// for que recorre sedes para hacer ventos click en cualquier sede +});// general + + + // ingresando a cada sprint + /*var score = students[i1].sprints; + // # de estudiantes que pasaron el 70% en Tech y Hse0 + var scoreHse = ''; + for (var i2 = 0; i2 < score.length; i1++) { + if (score[i2].hse > 840 && score[i2].tech > 1260) { + var studentsHighScore = score[i2].hse.length; + console.log(studentsHighScore); + }; + }; + };*/ + + /*var studentsSuperanTech = 0; + for (i = 0; i < data[sede][generation]['students'].length; i++) { + console.log(data[sede][generation]['students'][i]['sprints']); + for (j = 0; j < data[sede][generation]['students'][i]['sprints'].length; j++){ + if(data[sede][generation]['students'][i]['sprints'][j]['score']['tech'].length !== 0 && data[sede][generation]['students'][i]['sprints'][j]['score']['tech'].length > 1260) { + studentsSuperanTech ++; + } + } + };*/ + + // cantidad y el porcentaje que representa el total de estudiantes que superan la meta de puntos tecnicos en promedio y por sprint de tech + + //if (data[sede][generation]['students'][i]['sprints'][0]['score']['tech'] > 1260 && ) { + // studentsSuperanTech ++; + //} else { + // studentsSuperanTech = studentsSuperanTech; + //} + + //console.log('cantidad de estudiantes que superan la meta de puntos tecnicos en promedio y en el primer sprint : ' + studentsSuperanTech); + + + + /*console.log('cantidad de estudiantes que superan la meta de puntos tecnicos en promedio y e el segundo sprint: ' + studentsSuperanTech); + + var studentsSuperanTech = 0; + for (i = 0; i < data[sede][generation]['students'].length; i++) { + if (data[sede][generation]['students'][i]['sprints'][2]['score']['tech'] > 1260) { + studentsSuperanTech ++; + } else { + studentsSuperanTech = studentsSuperanTech; + } + }; + console.log('cantidad de estudiantes que superan la meta de puntos tecnicos en promedio y en el tercer sprint: ' + studentsSuperanTech); + + var studentsSuperanTech = 0; + for (i = 0; i < data[sede][generation]['students'].length; i++) { + if (data[sede][generation]['students'][i]['sprints'][3]['score']['tech'] > 1260) { + studentsSuperanTech ++; + } else { + studentsSuperanTech = studentsSuperanTech; + } + }; + console.log('cantidad de estudiantes que superan la meta de puntos tecnicos en promedio y en el cuarto sprint: ' + studentsSuperanTech); + */ + + // cantidad y el porcentaje que representa el total de estudiantes que superan la meta de puntos tecnicos en promedio y por sprint de hse + /*var studentsSuperanHse = 0; + for (i = 0; i < data[sede][generation]['students'].length; i++) { + if (data[sede][generation]['students'][i]['sprints'][0]['score']['hse'] > 840) { + studentsSuperanHse ++; + } else { + studentsSuperanHse = studentsSuperanHse; + } + }; + console.log('cantidad de estudiantes que superan la meta de puntos HSE en promedio y en el primer sprint: ' + studentsSuperanHse); + + + // hallando la cantidad todal de estudiantes ACTIVAS por generación + console.log(students[0]['active']); + /* console.log(totalstudents[1]);*/ + /* + var activeStudents = 0; + for (var i1 = 0; i1 < students.length; i1++) { + if (students[i1]['active']) { + activeStudents++; + };*/ + //console.log(activeStudents); + + // hallando la cantidad todal de estudiantes INACTIVAS por generacion + /*var inactiveStudents = totalstudents - activeStudents; + console.log('activas: ' + activeStudents); + console.log('inactivas: ' + inactiveStudents); + //var scoreHse = students[i1].sprints; + };*/ + + + + + + + // creando div que almacenará el # de estudiates + /*var studentsDiv = document.createElement('div'); + studentsDiv.textContent = totalstudents; + console.log(studentsDiv); + + // creando div que almacenará el # de estudiates INACTIVAS + var inactiveStudentsDiv = document.createElement('div'); + inactiveStudents.textContent = inactiveStudents; + console.log(inactiveStudentsDiv); + */ + + /* - * Funcionalidad de tu producto - */ +var students = data[sede][generation].students ; + var studentAcount = students.length; + + // hallando la cantidad todal de estudiantes ACTIVAS por generación + var activeStudents = 0; + for (var i1 = 0; i1 < totalstudents; i1++) { + if (students[i1].active === true) { + var activeStudents = (activeStudents + 1); + }; + // hallando la cantidad todal de estudiantes INACTIVAS por generacion + var inactiveStudents = totalstudents - activeStudents; + console.log(inactiveStudents); + var scoreHse = students[i1].sprints; -// Puedes hacer uso de la base de datos a través de la variable `data` -console.log(data); + }; + // creando div que almacenará el # de estudiates + var studentsDiv = document.createElement('div'); + studentsDiv.textContent = totalstudents; + console.log(studentsDiv); + // creando div que almacenará el # de estudiates INACTIVAS + var inactiveStudentsDiv = document.createElement('div'); + inactiveStudents.textContent = inactiveStudents; + console.log(inactiveStudentsDiv); +*/ diff --git a/students.html b/students.html new file mode 100644 index 00000000..a881fd35 --- /dev/null +++ b/students.html @@ -0,0 +1,67 @@ + + + + + Data Dashboard + + + + +
+ logo +
+ +
+

OVERVIEW

+

STUDENTS

+
+ +
+
+ photo + +
+
NAME:

Donna Sloper

+
Active:

true

+
+ +
+
+ Tech Skills:

70%

+
+
+ Life Skills:

68%

+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Sprints1er2do3er4to
Tech50%80%50%50%
HSE50%80%50%50%
+
+
+ + + + + +