/// <summary> /// ダイアログで指定された条件に一致する問題を抽出し返却します。 /// </summary> /// <returns>抽出された問題の一覧 / 選択されなかった場合null</returns> public List<Quiz> QuizExtractWithTerm(IWin32Window f) { List<Quiz> lq; // Show Dialog if(ShowDialog(f) != DialogResult.OK) { return null; } // Load if(QuizBook != null) { // Open var mql = new MyQAList(); mql.XmlLoad("Books/" + QuizBook); lq = (from qa in QuizManage.Quizs where mql.mqa.Exists(p => p.q.QuizID == qa.QuizID) select qa).ToList(); } else { lq = QuizManage.Quizs; } QuizManage.LoadAnswerData(); // Extract var ls = from q in lq where _IsMatchQuiz(q) && q.IsEnabledSelections orderby Guid.NewGuid() select q; if(ShowCount != null) { ls = ls.Take(ShowCount.Value).OrderBy(a => true); } return ls.ToList(); }
public QuizResult(MyQAList mqa) { InitializeComponent(); Mqa = mqa; }
public QuizDetails(MyQAList mqa) { InitializeComponent(); Mqa = mqa; }
private void 問題帳から練習を開始BToolStripMenuItem_Click(object sender, EventArgs e) { // Open QuizFile OpenFileDialog ofd = new OpenFileDialog(); ofd.InitialDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\Books\\"; ofd.Filter = "quizfile(*.xml)|*.xml|all files(*.*)|*.*"; if(ofd.ShowDialog() == DialogResult.OK) { // Load var mql = new MyQAList(); mql.XmlLoad(ofd.FileName); ShowQuizs = (from qa in QuizManage.Quizs where mql.mqa.Exists(p => p.q.QuizID == qa.QuizID) select qa).ToList(); QuizManage.LoadAnswerData(); StartTraningMode(); } }
private void StartTraningMode() { // Menu/Item Enable Change 問題の取得更新ToolStripMenuItem.Enabled = false; 問題の読み込みOToolStripMenuItem.Enabled = false; 練習モードを開始SToolStripMenuItem.Enabled = false; 過去の出題問題から練習RToolStripMenuItem.Enabled = false; 表示問題の条件を指定して開始ToolStripMenuItem.Enabled = false; 問題帳から練習を開始BToolStripMenuItem.Enabled = false; 練習モードを終了EToolStripMenuItem.Enabled = true; tableLayoutPanel1.Enabled = true; // and etc Status_LoadQst.Text = "読み込んだ問題数: " + ShowQuizs.Count; selfDrawProgressBar1.Maximum = (int)Math.Max(WQPSetting.LimitTime * 100, 2000); Mqa = new MyQAList(); Qcount = -1; // Show QuizShow(); }