From d68f336143d344d14ec5217c54c4040229e02202 Mon Sep 17 00:00:00 2001 From: pet <default> Date: Mon, 3 Jul 2017 11:59:20 -0300 Subject: [PATCH 1/2] Configuracoes no script.js --- index.html | 2 +- js/professor.js | 4 +++- js/script.js | 31 +++++++++++-------------------- 3 files changed, 15 insertions(+), 22 deletions(-) diff --git a/index.html b/index.html index 1971cbb..cd0107d 100644 --- a/index.html +++ b/index.html @@ -82,7 +82,7 @@ <div id="countdown" style="display:none;"></div> - <script src="https://cdn.socket.io/socket.io-1.2.0.js"></script> + <!-- SCRIPT DAS CONFIGURACOES !--> <script type="text/javascript" src="js/configuracoes.js"></script> <!-- SCRIPT DO PRE-TESTE !--> <script type="text/javascript" src="js/script_pre_teste.js"></script> <!-- SCRIPT DO TESTE !--> <script type="text/javascript" src="js/script.js"></script> diff --git a/js/professor.js b/js/professor.js index 3023a90..cf1904d 100644 --- a/js/professor.js +++ b/js/professor.js @@ -51,7 +51,9 @@ loadPage(); //Obs: É assÃncrono function buscaTestes(){ dados = dataSet; - geraGraficos(); + + geraGraficos(); + geraDadosGerenciar(); loadPage(); diff --git a/js/script.js b/js/script.js index 63f7fbe..65a2f75 100644 --- a/js/script.js +++ b/js/script.js @@ -1,14 +1,12 @@ var dataSet = []; var localStoreLigado = false; -if (typeof(Storage) !== "undefined") { - - - localStoreLigado=true; - if(localStorage.getItem("dataSet") != null){ - dataSet = JSON.parse(localStorage.dataSet); - } +if (typeof(Storage) !== "undefined") { + localStoreLigado=true; + if(localStorage.getItem("dataSet") != null){ + dataSet = JSON.parse(localStorage.dataSet); + } } @@ -19,19 +17,12 @@ function enviarDados(dados){ } -//Numero de perguntas existentes (eliminar futuramente para haver testes dinamicos) +var configs = getConfiguracoes(); + -var NUM_DE_PERGUNTAS = 5; -if(localStorage.perguntas != undefined) - NUM_DE_PERGUNTAS = localStorage.perguntas; -else - localStorage.setItem("perguntas",NUM_DE_PERGUNTAS); +var NUM_DE_PERGUNTAS = configs.perguntas; +var ordemBateria = configs.ordemBateria; -var ordemBateria = ["pC","C","C", "pI", "I","I","F"]; //pC = pre Congruente, C = Congruente, pI = pre Incongruente, I = Incongruente, F = Fim -if(localStorage.ordemBateria != undefined) - ordemBateria = JSON.parse(localStorage.ordemBateria); -else - localStorage.setItem("ordemBateria",JSON.stringify(ordemBateria)); console.log(localStorage.ordemBateria); console.log(localStorage.perguntas); @@ -92,7 +83,7 @@ function repouso(){ } else{ mudaCor(ordemBateria[testeAtual]); - intervalTempo = setInterval("tempo();", NUM_DE_PERGUNTAS); + intervalTempo = setInterval("tempo();", 10); var string = ""; document.getElementById("botoes").style.display="block"; document.getElementById("countdown").style.display="none"; @@ -113,7 +104,7 @@ function iniciar(){ function tempo(){ - t+=0.02; + t+=0.01; } function clicou(cor){ -- GitLab From db3a6860ee513ab9b5f8af388379bb125e0c24e7 Mon Sep 17 00:00:00 2001 From: pet <default> Date: Thu, 6 Jul 2017 11:46:49 -0300 Subject: [PATCH 2/2] alterando configuracoes --- js/configuracoes.js | 8 ++++++-- professor.html | 4 ++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/js/configuracoes.js b/js/configuracoes.js index ad5251b..7ce933c 100644 --- a/js/configuracoes.js +++ b/js/configuracoes.js @@ -14,14 +14,16 @@ var __configsDefault = { "ordemBateria": ["pC","C","C", "pI", "I","I","F"], "perguntas": 6, "tipoTeste": 1, //1 para tempo, 0 para perguntas - "tempoTeste" : 5 //Segundos + "tempoTeste" : 5, //Segundos + "tempoEntreTeste": 5 }; var __configs = { "perguntas": null, "ordemBateria": null, "tipoTeste": null, - "tempoTeste" : null + "tempoTeste" : null, + "tempoEntreTeste": null, }; function __saveConfigs(){ @@ -133,6 +135,7 @@ function configuracoes(){ document.getElementById("logado_config_numero_perguntas").value = __configs.perguntas; + document.getElementById("logado_config_tempoEntreTeste").value = __configs.tempoEntreTeste; if(__configs.tipoTeste == 0){ config_selectPerguntas(); @@ -169,6 +172,7 @@ function logado_config_salvaConfig(){ if(confirm("Fazendo isso você deletará todos os testes!\nDeseja continuar?")){ __configs.perguntas = parseInt(document.getElementById("logado_config_numero_perguntas").value); __configs.tempoTeste = parseInt($("#logado_config_tempoDuracao").val()); + __configs.tempoEntreTeste = parseInt($("#logado_config_tempoEntreTeste").val()); newOrdemBateria = [] for(var i = 0; i < numeroTestes; i++){ var select = document.getElementById("config_select"+i); diff --git a/professor.html b/professor.html index c259f29..3b91e44 100644 --- a/professor.html +++ b/professor.html @@ -160,6 +160,10 @@ <br> <input type=number id="logado_config_tempoDuracao"> </div> + <br> + <br> + Tempo entre os testes<br> + <input type=number id="logado_config_tempoEntreTeste"> <br> <br> -- GitLab