示例#1
0
        private void btnZuJuan_Click(object sender, EventArgs e)
        {
            string existsResult = string.Empty;

            try
            {
                if (cboSubject.SelectedIndex == 0)
                {
                    PublicClass.ShowMessageOk("请选择一门考试科目,在进行后续操作。");
                    return;
                }
                PublicClass.SubjectName = cboSubject.SelectedValue.ToString();
                PublicClass.JobType     = JobType.TiKu;
                InitialStudentDir();
                InitialSubjectProp();
                InitialKaoShiFangShi();
                PublicClass.oSubjectProp.PresetPaperID = Convert.ToInt32(lbTaoJuan.SelectedValue);
                PublicClass.VideoFilePath = string.Format(@"{0}\SowerTestClient\Video\{1}_{2}\", Application.StartupPath, PublicClass.StudentCode, DirFileHelper.GetFileNameNoExtension(PublicClass.oSubjectProp.MediaPackageFileName));
                frmBusicWorkMain busicWorkMain = this.ParentForm as frmBusicWorkMain;
                existsResult = bService.ExistsTopicDB(PublicClass.oSubjectProp.TopicDBCode, PublicClass.oSubjectProp.TopicDBVersion);
                if (existsResult == "-1")
                {
                    Msg.ShowInformation("在作业中心->练习题库列表中没有添加该文件,请联系授课老师进行添加。");
                    return;
                }
                //模拟练习
                if (rdoExercise.Checked)
                {
                    PublicClass.oSubjectProp.ExamMode = "1";
                    PublicClass.SowerExamPlugn.SetParaValue(PublicClass.StudentDir, "题库信息", "考试模式", "1");

                    frmExamInfo examInfo = new frmExamInfo();
                    examInfo.Show();
                    busicWorkMain.Hide();
                }
                //正式考试
                if (rdoExam.Checked)
                {
                    PublicClass.oSubjectProp.ExamMode = "2";
                    PublicClass.SowerExamPlugn.SetParaValue(PublicClass.StudentDir, "题库信息", "考试模式", "2");

                    frmExamSubject examSubject = new frmExamSubject();
                    CommonUtil.subjectIndex = cboSubject.SelectedIndex;
                    examSubject.Show();
                    busicWorkMain.Hide();
                }
            }
            catch (Exception ex)
            {
                LogHelper.WriteLog(typeof(frmExercise), ex);
                CommonUtil.WriteLog(ex);
                PublicClass.ShowErrorMessageOk(ex.Message);
            }
        }
示例#2
0
        private void btnZuJuan_Click(object sender, EventArgs e)
        {
            string existsResult = string.Empty;

            try
            {
                if (cboSubject.SelectedIndex == 0)
                {
                    PublicClass.ShowMessageOk("请选择一门考试科目,在进行后续操作。");
                    return;
                }

                PublicClass.SubjectName = cboSubject.SelectedValue.ToString();
                PublicClass.JobType     = JobType.TiKu;

                InitialStudentDir();

                InitialSubjectProp();

                InitialKaoShiFangShi();

                PublicClass.oSubjectProp.PresetPaperID = Convert.ToInt32(lbTaoJuan.SelectedValue);
                frmBusicWorkMain busicWorkMain = this.ParentForm as frmBusicWorkMain;

                //模拟练习
                if (rdoExercise.Checked)
                {
                    PublicClass.oSubjectProp.ExamMode = "1";
                    PublicClass.SowerExamPlugn.SetParaValue(PublicClass.StudentDir, "题库信息", "考试模式", "1");

                    frmExamInfo examInfo = new frmExamInfo();
                    examInfo.Show();
                    busicWorkMain.Hide();
                }
                //正式考试
                if (rdoExam.Checked)
                {
                    PublicClass.oSubjectProp.ExamMode = "2";
                    PublicClass.SowerExamPlugn.SetParaValue(PublicClass.StudentDir, "题库信息", "考试模式", "2");
                    frmExamSubject examSubject = new frmExamSubject();
                    CommonUtil.subjectIndex = cboSubject.SelectedIndex;
                    examSubject.Show();
                    busicWorkMain.Hide();
                }
            }
            catch (Exception ex)
            {
                LogHelper.WriteLog(typeof(frmExercise), ex);
                PublicClass.ShowErrorMessageOk(ex.Message);
            }
        }