void initFirstPanel(ElicitationMethod emethod) { if (emethod == ElicitationMethod.Firmino || emethod == ElicitationMethod.Bissecao) { this.LB_partes.Visible = false; this.TB_Intervals.Visible = false; } }
public FirstElicitationPanel(ElicitationMethod elicitationMethod, IFormPrincipal ifPrincipal) { InitializeComponent(); this.ifPrincipal = ifPrincipal; this.elicitationMethod = elicitationMethod; firstPanelList.Add(this.PN_startElicitationFirmDirecBisec); initFirstPanel(elicitationMethod); question = ifPrincipal.getQuestion(); this.displayChartSeries(question); List <double> lines = new List <double>(); this.ifPrincipal.markChoosableAreaChartSeries(lines); }
public ArrayList listaPerguntas(Boolean training, ElicitationMethod method) { MySqlDataReader reader; CtrlConexao conexao = CtrlConexao.Instancia; ArrayList variableList = new ArrayList(); string filter = null; StringBuilder strIndexAlternativas = new StringBuilder(); Hashtable hashIndiceDB = new Hashtable(); try { conexao.AbreConexaoMysql(); String prefixo = "aplica"; if (training) { prefixo = "calibra"; } if (method == ElicitationMethod.Firmino) { filter = prefixo + "Firmino"; } else if (method == ElicitationMethod.Bissecao) { filter = prefixo + "Bissecao"; } else { filter = prefixo + "Direto"; } reader = conexao.ExecutaSelecaoMysql("SELECT * FROM elicitation.perguntas where " + filter + " = 1 and serahUsada = 1 order by id_pergunta asc"); int i = 1; while (reader.Read()) { int id = (int)reader["id_pergunta"]; strIndexAlternativas.Append(id.ToString() + " ,"); hashIndiceDB[reader.GetInt32("id_pergunta")] = i - 1; Variable variable = new Variable(); variable.metodo = method;// (ElicitationMethod)reader["idmetodo"]; variable.number = i; i++; variable.id = id; variable.statament = reader["enunciado"].ToString(); variable.respostaCerta = reader["respostaCerta"].ToString(); variable.status = false; variable.imagePath = reader["caminhoImagens"].ToString(); variableList.Add(variable); variable.distribuicao = reader["distribuicao"].ToString(); variable.isNominal = false; if (int.Parse(reader["ehVariavelNominal"].ToString()) > 0) { variable.isNominal = true; } } strIndexAlternativas.Remove(strIndexAlternativas.Length - 2, 2); conexao.FecharConexaoMysql(); conexao.AbreConexaoMysql(); reader = conexao.ExecutaSelecaoMysql("SELECT * FROM elicitation.alternativa_resposta where id_pergunta in (" + strIndexAlternativas + ")"); while (reader.Read()) { i = (int)hashIndiceDB[reader["id_pergunta"]]; Variable tmpVariable = (Variable)variableList[i]; tmpVariable.alternativas.Add(new Alternativa(reader["alternativa"].ToString(), reader.GetInt32("id_pergunta"))); } } catch (Exception) { } finally { conexao.FecharConexaoMysql(); } return(variableList); }
public ElicitationManager(ElicitationMethod elicitationMethod, IFormPrincipal ifPrincipal) { this.ifPrincipal = ifPrincipal; this.elicitationMethod = elicitationMethod; firstPanelList.Add(new FirstElicitationPanel()); }
public Variable(int number, string enunciado, ElicitationMethod metodo, string respostaCerta, String imagePath) : this(number, enunciado, metodo) { this.respostaCerta = respostaCerta; this.imagePath = imagePath; }
public Variable(int number, string enunciado, ElicitationMethod metodo) : this() { this.number = number; this.statament = enunciado; this.metodo = metodo; }