private void btnStart_Click_1(object sender, EventArgs e) { if (cbxNameExams.selectedIndex == -1) { MessBox.Warning("Not selected Name Exams !! Please Select "); return; } ; if (stringToInt(cbxSelectNumExams.Text) <= 0) { MessBox.Warning("Invalid Number Question !! "); return; } if (stringToInt(cbxTimes.Text) <= 0 && !cbxTimes.Text.Equals("None")) { MessBox.Warning("Invalid Times/Number Question !! "); return; } if (!QA.getInstance().setQuestions(stringToInt(cbxSelectNumExams.Text), examsCode[cbxNameExams.selectedIndex], stringToInt(cbxTimes.Text))) { return; } //Hide and show form beginner this.Hide(); using (var form = new StartForm()) { form.ShowDialog(); } this.Show(); }
public static QA getInstance() { if (qa == null) { qa = new QA(); } return(qa); }
public void LoadData() { resultData.setResultForm(this); resultData.setPanelRoot(pnContent); resultData.setPanelOptionRoot(pnContainOptions); questions = QA.getInstance().getQuestions(); double score = resultData.InitQuestion(questions); lblScore.Text = score.ToString(); percent.Value = (int)score * 10; }
public double InitQuestion(List <Questions> questions) { double isCorrect = 0; QA qa = QA.getInstance(); for (int index = 0; index < questions.Count; ++index) { bool isTrue = CheckCorrectQuestion(questions[index].getOption(), qa.check[index]); addPanelQs(questions[index], isTrue); if (isTrue) { ++isCorrect; } } return((isCorrect / questions.Count) * 10); }
private void setContentTilte() { bool isImage = DataReader.getBooleanInStringBit(QA.getInstance().GetQuestions().isImage); string Content = QA.getInstance().GetQuestions().q_title; fileName = Content; lblTitle.Visible = !isImage; ptcQs.Visible = isImage; if (ptcQs.Visible) { ptcQs.Image = Image.FromFile(Content); } else { lblTitle.Text = Content; } }
public void setContentQuestion(int index) { QA qa = QA.getInstance(); Questions qs = qa.getQuestion(index); ptcQs.Visible = false; lblQs.Visible = false; if (DataReader.getBooleanInStringBit(qs.isImage)) { ptcQs.Image = Image.FromFile(qs.q_title); ptcQs.Visible = true; } else { lblQs.Text = qs.q_title; lblQs.Visible = true; } animation.HideSync(pnContent); }
private void lblDetail_Click(object sender, EventArgs e) { OffVisibleOp(); BunifuImageButton button = sender as BunifuImageButton; int index = imageButtons.FindIndex(x => x.Equals(button)); if (index == -1) { return; } DisplayOption(QA.getInstance().getQuestion(index), QA.getInstance().check[index], QA.getInstance().optionMix[index]); resultForm.setContentQuestion(index); //pnRoot.Controls.Remove(pnQss[index]); //this.PanelQsClick = pnQss[index]; //SetContentOption(question[index], check[index]); }
private void StartForm_Load(object sender, EventArgs e) { resultQs = new ResultQs(this); this.KeyPreview = true; ApplyEclipse(); this.Eclipse.ApplyElipse(this, 40); QA.getInstance().setPanel(panelRootOption, zoomImg1); ResultDataQs.getInstance().setZoomImg(zoomImg1); SetResultData(); pnRoot.Controls.SetChildIndex(zoomImg1, 0); time = QA.getInstance().getTime(); if (time != 0) { timer1_Tick(null, null); timer1.Start(); } Init(); }
private void btnBack_Click(object sender, EventArgs e) { lblIndex.Text = QA.getInstance().backStep(); setContentTilte(); }
public static void Clear() { qa = null; }