Ejemplo n.º 1
0
        public GeradorRelatorio(
            string nomePesquisador,
            string nomeParticipante,
            int idadeParticipante,
            string sexoParticipante,
            int numeroParticipante,
            ConfigExperimento config
            )
        {
            var horaInicio = DateTime.Now;

            nomeArquivo = $"{horaInicio.ToString(FORMATO_DATE_TIME_ARQUIVO)}-{nomePesquisador}-{numeroParticipante}-{nomeParticipante}.txt";

            conteudoRelatorio.AppendLine($"Iniciando novo experimento. Data: {horaInicio.ToString(FORMATO_DATE_TIME)}\n")
            .AppendLine("Experimentador: " + nomePesquisador)
            .AppendLine("Participante: " + nomeParticipante)
            .AppendLine("Idade participante: " + idadeParticipante)
            .AppendLine("Sexo participante: " + sexoParticipante)
            .AppendLine("Número participante: " + numeroParticipante)
            .AppendLine("\nFrases/Instruções/Imagens usadas:\n");

            for (int i = 0; i < config.Estimulos.Count; i++)
            {
                var estimulo = config.Estimulos[i];

                conteudoRelatorio.AppendLine(i + 1 + ":")
                .Append("Frase modelo: ").AppendLine(estimulo.FraseModelo)
                .Append("Instrução: ").AppendLine(estimulo.Instrucao)
                .Append("Nome imagem: ").AppendLine(estimulo.NomeImagem)
                .AppendLine();
            }

            conteudoRelatorio.AppendLine("/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n")
            .AppendLine("Respostas do participante:\n");
        }
Ejemplo n.º 2
0
        public TelaFrase(ConfigExperimento configExperimento, GeradorRelatorio geradorRelatorio)
        {
            InitializeComponent();

            this.configExperimento = configExperimento;
            this.geradorRelatorio  = geradorRelatorio;

            Location = new Point(0, 0);
            Size     = new Size(width, height);

            ViewUtils.CorrigeEscalaTodosOsFilhos(this);

            MudarFrase();
        }
Ejemplo n.º 3
0
        private void btnIniciar_Click(object sender, EventArgs e)
        {
            var config = ConfigExperimento.CriaPorArquivo(tbArquivoFrases.Text);

            if (config == null)
            {
                MessageBox.Show("Nenhum arquivo de configuração selecionado!", "Erro", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return;
            }
            var nomePesquisador = tbNomePesquisador.Text;

            if (nomePesquisador == "")
            {
                MessageBox.Show("O nome do pesquisador é obrigatório!", "Erro", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return;
            }
            var nomeParticipante = tbNomeParticipante.Text;

            if (nomeParticipante == "")
            {
                MessageBox.Show("O nome do participante é obrigatório!", "Erro", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return;
            }
            var idadeParticipante = numIdadeParticipante.Value;

            if (idadeParticipante == 0)
            {
                MessageBox.Show("A idade do participante é obrigatório!", "Erro", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return;
            }
            var sexoParticipante = cbSexoParticipante.SelectedItem;

            if (sexoParticipante == null)
            {
                MessageBox.Show("O sexo do participante é obrigatório!", "Erro", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return;
            }
            var numeroParticipante = numNumeroParticipante.Value;

            if (numeroParticipante == 0)
            {
                MessageBox.Show("O número do participante é obrigatório!", "Erro", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return;
            }

            var backGround = new TelaMensagem("", false);

            backGround.Show();
            new TelaMensagem("Clique em qualquer lugar para iniciar o experimento", true).ShowDialog();

            var geradorRelatorio = new GeradorRelatorio(
                nomePesquisador,
                nomeParticipante,
                Convert.ToInt32(idadeParticipante),
                sexoParticipante.ToString(),
                Convert.ToInt32(numeroParticipante),
                config
                );

            new TelaFrase(config, geradorRelatorio).ShowDialog();
            geradorRelatorio.GerarRelatorio();

            new TelaMensagem("Fim do experimento, por favor chamar o experimentador", false).ShowDialog();
            backGround.Close();
        }