Commit 2e6dbbd2 authored by pet's avatar pet

criando dicionario de pessoas

parent 4a99d31d
......@@ -201,7 +201,6 @@ function downloadCsv(){
for (var teste in dataSet){
tempos.push(buscaTempoResposta(dataSet[teste].stringResposta[0]));
}
console.log(dataSet);
var data = tempos;
var csvContent = "data:text/csv;charset=utf-8,";
......@@ -217,37 +216,72 @@ function downloadCsv(){
}
ordemFiltrada = filtraOrdemBateria(dataSet[0].ordemBateria);
lines = [];
for(var i = 0; i < ordemFiltrada.length+ordemFiltrada.length; i++){
for(var j in dataSet[0].stringResposta[0]){
lines.push("");
lines = {};
lines[0] = "''"
for(i in ordemFiltrada){
if(ordemFiltrada[i] == "C" || ordemFiltrada[i] == "I"){
lines[0]+=","+ordemFiltrada[i];
}
}
var dicionario = {}
for(var i in dataSet){
for(var j in dataSet[i].stringResposta){
j = parseInt(j);
if(ordemFiltrada[j]=="C"){
lineIndex = parseInt(j*dataSet[i].stringResposta[j].length)+j;
lines[lineIndex]+="Congruente,";
}
if(ordemFiltrada[j]=="I"){
lineIndex = parseInt(j*dataSet[i].stringResposta[j].length)+j;
lines[lineIndex]+="Incongruente,";
}
for(var k in dataSet[i].stringResposta[j]){
lineIndex = parseInt(j*dataSet[i].stringResposta[j].length) + parseInt(k);
lineIndex=parseInt(lineIndex)+1+parseInt(j);
if(dataSet[i].stringResposta[j][k].acertou)
lines[lineIndex]+="Acerto - ";
else
lines[lineIndex]+="Erro - ";
lines[lineIndex] +=(dataSet[i].stringResposta[j][k].tempo+",");
if(dataSet[i].nome in dicionario){
dicionario[dataSet[i].nome].push(dataSet[i]);
}
else{
dicionario[dataSet[i].nome] = [dataSet[i]];
}
}
for(p in dicionario){
pessoa = dicionario[p];
for(b in pessoa){
bateria = pessoa[b];
if(grupo == 0){
}
}
}
console.log(dicionario);
return;
//~ for(var i = 0; i < ordemFiltrada.length+ordemFiltrada.length; i++){
//~ for(var j in dataSet[0].stringResposta[0]){
//~ lines.push("");
//~ }
//~ }
//~ for(var i in dataSet){
//~ for(var j in dataSet[i].stringResposta){
//~ j = parseInt(j);
//~
//~ if(ordemFiltrada[j]=="C"){
//~ lineIndex = parseInt(j*dataSet[i].stringResposta[j].length)+j;
//~ lines[lineIndex]+="Congruente,";
//~ }
//~ if(ordemFiltrada[j]=="I"){
//~ lineIndex = parseInt(j*dataSet[i].stringResposta[j].length)+j;
//~ lines[lineIndex]+="Incongruente,";
//~ }
//~ for(var k in dataSet[i].stringResposta[j]){
//~ lineIndex = parseInt(j*dataSet[i].stringResposta[j].length) + parseInt(k);
//~ lineIndex=parseInt(lineIndex)+1+parseInt(j);
//~ if(dataSet[i].stringResposta[j][k].acertou)
//~ lines[lineIndex]+="Acerto - ";
//~ else
//~ lines[lineIndex]+="Erro - ";
//~ lines[lineIndex] +=(dataSet[i].stringResposta[j][k].tempo+",");
//~ }
//~
//~ }
//~ }
csvContent += lines.join("\n");
var encodedUri = encodeURI(csvContent);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment