public BrowseQustions() { _mCExamQuestionsTemp = new CQuestionsParam(); _mListQuestionInfos = S3601App.GListQuestionInfos; InitializeComponent(); this.Loaded += UCCustomSetting_Loaded; ButButton.Content = "<"; }
private void InitParam(CQuestionsParam cExamQuestion) { lbQuestionNum.Text = cExamQuestion.LongNum.ToString(); lbCategoryNum.Text = cExamQuestion.LongCategoryNum.ToString(); lbCategoryName.Text = cExamQuestion.StrCategoryName; switch ((QuestionType)cExamQuestion.IntType) { case QuestionType.TrueOrFalse: lbType.Text = CurrentApp.GetLanguageInfo("3601T00098", "True Or False"); break; case QuestionType.SingleChoice: lbType.Text = CurrentApp.GetLanguageInfo("3601T00097", "Single Choice"); break; case QuestionType.MultipleChioce: lbType.Text = CurrentApp.GetLanguageInfo("3601T00099", "Multiple Chioce"); break; } lbFounderID.Text = cExamQuestion.LongFounderId.ToString(); lbFounderName.Text = cExamQuestion.StrFounderName; lbDateTime.Text = cExamQuestion.StrDateTime; lbUseNumber.Text = cExamQuestion.IntUseNumber.ToString(); lbAccessoryType.Text = cExamQuestion.StrAccessoryType; lbAccessoryName.Text = cExamQuestion.StrAccessoryName; lbAccessoryPath.Text = cExamQuestion.StrAccessoryPath; //DownloadFiles(cExamQuestion.StrAccessoryPath, cExamQuestion.StrAccessoryName); switch (cExamQuestion.IntType) { case (int)QuestionType.TrueOrFalse: InitRadioToF(cExamQuestion); break; case (int)QuestionType.SingleChoice: InitRadioSingle(cExamQuestion); break; case (int)QuestionType.MultipleChioce: InitRadioMultiple(cExamQuestion); break; } }
private void InitInterface() { if (_mListQuestionInfos.Count > 1) { InitBut1(); _mICountQuestionItem = 0; CQuestionsParam cExamQuestion = _mListQuestionInfos[0]; if (cExamQuestion != null) { _mCExamQuestionsTemp = cExamQuestion; InitParam(cExamQuestion); } } else if (_mListQuestionInfos.Count == 1) { InitBut(); CQuestionsParam cExamQuestion = _mListQuestionInfos[0]; if (cExamQuestion != null) { _mCExamQuestionsTemp = cExamQuestion; InitParam(cExamQuestion); } } else { try { var parent = Parent as PopupPanel; if (parent != null) { ShowException(string.Format("Failed initialization parameters")); parent.IsOpen = false; } } catch { } } }
private void InitRadioMultiple(CQuestionsParam cExamQuestion) { try { QuestionInfoGrid.Children.Clear(); Grid grid = new Grid(); MultipleChoicePage newPage = new MultipleChoicePage(); MCQuestionInfo tempParam = new MCQuestionInfo(); tempParam.IntNum = 0; tempParam.questionParam = cExamQuestion; newPage.SetQuestionInfo = tempParam; newPage.CurrentApp = this.CurrentApp; newPage.SetInformation(); grid.Children.Add(newPage); Grid.SetRow(newPage, 0); QuestionInfoGrid.Children.Add(grid); } catch (Exception ex) { ShowException(ex.Message); } }
private void NextQuestion_Click(object sender, RoutedEventArgs e) { var btn = e.Source as Button; if (btn != null) { _mICountQuestionItem++; CQuestionsParam cExamQuestion = _mListQuestionInfos[_mICountQuestionItem]; if (cExamQuestion != null) { _mCExamQuestionsTemp = cExamQuestion; InitParam(cExamQuestion); } if (_mICountQuestionItem >= (_mListQuestionInfos.Count - 1)) { InitBut2(); } else { InitBut3(); } } }
private void PreviousQuestion_Click(object sender, RoutedEventArgs e) { var btn = e.Source as Button; if (btn != null) { _mICountQuestionItem--; CQuestionsParam cExamQuestion = _mListQuestionInfos[_mICountQuestionItem]; if (cExamQuestion != null) { _mCExamQuestionsTemp = cExamQuestion; InitParam(cExamQuestion); } if (_mICountQuestionItem == 0) { InitBut1(); } else { InitBut3(); } } }