Ejemplo n.º 1
0
        /// <summary>
        /// 开始答题-进入学习页面
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void StartStudy(object sender, RoutedEventArgs e)
        {
            if (!mPageData.IsPractice)
            {
                return;
            }
            btnPractice.Button("loading", "正在创建练习记录");
            this.UIAsync(win =>
            {
                //设置正在参与的学生
                var studentIds = this.mStudentViews.Where(m => m.IsOnline && m.IsSelected).Select(m => m.StudentId).ToList();

                var api    = new Api.ApiClient();
                var result = api.AcademicCurrent(APP.StudySession.GardenId);
                if (result.flag)
                {
                    var dbResult = CreatePracticeRecord(studentIds, result.data);
                    if (dbResult.flag)
                    {
                        APP.StudySession.StartStudy(studentIds, mPaperPractice.paper_id.Value, dbResult.data);
                        this.UICall(() =>
                        {
                            btnPractice.Button("reset");
                            StudyWindow window = new StudyWindow();
                            window.Show();
                        });
                    }
                    else
                    {
                        this.UICall(() => { this.ShowMessageError(dbResult.msg); btnPractice.Button("reset"); });
                    }
                }
                else
                {
                    this.UICall(() => { this.ShowMessageError("获取学年失败"); btnPractice.Button("reset"); });
                }
            });
        }
Ejemplo n.º 2
0
        private void StudyMaterialsClicked(object sender, RoutedEventArgs e)
        {
            StudyWindow studyWindow = new StudyWindow();

            studyWindow.ShowDialog();
        }