예제 #1
0
        private void TeacherFunctionForm_Load(object sender, EventArgs e)
        {
            ViewHelper.MdiChildrenAutoSize(this);
            this.Dock = DockStyle.Fill;
            CommonPanel.Show();
            autoSetQuestionPanel.Hide();
            setQuestionConfirmPanel.Hide();
            setQuestionPanel.Hide();
            paperInfoPanel.Hide();
            scoreInfoPanel.Hide();
            //给tlpMark中的button的tag赋值,必须在 ViewHelper.MdiChildrenAutoSize(this)之后
            btnSelect1.Tag      = "1,1";
            btnSelect2.Tag      = "1,2";
            btnSelect3.Tag      = "1,3";
            btnSelect4.Tag      = "1,4";
            btnSelect5.Tag      = "1,5";
            btnBlank1.Tag       = "2,1";
            btnBlank2.Tag       = "2,2";
            btnBlank3.Tag       = "2,3";
            btnBlank4.Tag       = "2,4";
            btnBlank5.Tag       = "2,5";
            btnJudge1.Tag       = "4,1";
            btnJudge2.Tag       = "4,2";
            btnJudge3.Tag       = "4,3";
            btnJudge4.Tag       = "4,4";
            btnJudge5.Tag       = "4,5";
            btnShortAnswer1.Tag = "3,3";
            btnShortAnswer2.Tag = "3,5";
            btnShortAnswer3.Tag = "3,7";
            btnShortAnswer4.Tag = "3,10";
            btnShortAnswer5.Tag = "3,15";
            //给自动出题题目个数选择框的tag赋值,必须在 ViewHelper.MdiChildrenAutoSize(this)之后
            nudSelectNum.Tag      = "1";
            nudBlankNum.Tag       = "2";
            nudJudgeNum.Tag       = "4";
            nudShortAnswerNum.Tag = "3";
            nudSelectMark.Tag     = nudBlankMark.Tag = nudJudgeMark.Tag = nudShortAnswerMark.Tag = null;
            //按下NumericUpDown控件的上或下箭头2s后,数值变化将以10为单位
            NumericUpDownAcceleration acceleration = new NumericUpDownAcceleration(2, 10);

            nudMark.Accelerations.Add(acceleration);
            nudSelectNum.Accelerations.Add(acceleration);
            nudSelectMark.Accelerations.Add(acceleration);
            nudBlankNum.Accelerations.Add(acceleration);
            nudBlankMark.Accelerations.Add(acceleration);
            nudJudgeNum.Accelerations.Add(acceleration);
            nudJudgeMark.Accelerations.Add(acceleration);
            nudShortAnswerNum.Accelerations.Add(acceleration);
            nudShortAnswerMark.Accelerations.Add(acceleration);
            //创建一个试卷名称对话框的实例
            pNameDialog       = new PaperNameDialog();
            pNameDialog.Owner = this;
            ////创建一个评分对话框的实例
            //dialog = new PaperDialog();
            //dialog.Owner = this;
        }
예제 #2
0
 private void InitializeNumUDs()
 {
     NumericUpDownAcceleration[] numericUpDownAccelerations = new NumericUpDownAcceleration[4]
     {
         new NumericUpDownAcceleration(1, 10),
         new NumericUpDownAcceleration(1, 20),
         new NumericUpDownAcceleration(1, 40),
         new NumericUpDownAcceleration(1, 80)
     };
     numUD_height.Accelerations.AddRange(numericUpDownAccelerations);
     numUD_width.Accelerations.AddRange(numericUpDownAccelerations);
     numUD_X.Accelerations.AddRange(numericUpDownAccelerations);
     numUD_Y.Accelerations.AddRange(numericUpDownAccelerations);
 }
예제 #3
0
        private void layoutAllQuestions(List <Question> blist, List <Question> salist)
        {
            lblPaperName.Location = new Point((this.Width - lblPaperName.Width) / 2, 9);
            mark = lblPaperName.Location.Y + lblPaperName.Height;
            //按下NumericUpDown控件的上或下箭头1s后,数值变化将以5为单位
            NumericUpDownAcceleration acceleration = new NumericUpDownAcceleration(1, 5);
            int i;

            if (blist.Count != 0)
            {
                //填空题
                i = 0;
                Label blbl = new Label();
                blbl.Text     = "填空题部分";
                blbl.AutoSize = true;
                this.Controls.Add(blbl);
                blbl.Location = new Point(SPACE, mark + 2 * SPACE);
                int hit = blbl.Location.Y + 2 * SPACE;
                foreach (Question question in blist)
                {
                    Label lbl = new Label();
                    lbl.Text = (i + 1) + "." + question.question + "(" + question.mark + "分)";
                    i++;
                    lbl.Width  = 50 * SPACE;
                    lbl.Height = AnswerDialog.getLineNum(lbl.Text) * SPACE;
                    this.Controls.Add(lbl);
                    lbl.Location = new Point(SPACE, hit);
                    hit         += (lbl.Height + 7 * SPACE);
                    Label answerlbl = new Label();
                    answerlbl.Text   = "参考答案:" + question.answer;
                    answerlbl.Width  = 50 * SPACE;
                    answerlbl.Height = AnswerDialog.getLineNum(answerlbl.Text) * SPACE;
                    this.Controls.Add(answerlbl);
                    answerlbl.Location = new Point(SPACE, lbl.Location.Y + lbl.Height + 6);
                    Label stuAnswerlbl = new Label();
                    stuAnswerlbl.Text   = "学员答案:" + question.stuAnswer;
                    stuAnswerlbl.Width  = 50 * SPACE;
                    stuAnswerlbl.Height = AnswerDialog.getLineNum(stuAnswerlbl.Text) * SPACE;
                    this.Controls.Add(stuAnswerlbl);
                    stuAnswerlbl.Location = new Point(SPACE, answerlbl.Location.Y + answerlbl.Height + 6);
                    MyNumericUpDown nud = new MyNumericUpDown();
                    nud.Width     = 6 * SPACE;
                    nud.Maximum   = question.mark;
                    nud.Minimum   = 0;
                    nud.Increment = 1;
                    nud.Accelerations.Add(acceleration);
                    this.Controls.Add(nud);
                    nud.Location = new Point(SPACE, stuAnswerlbl.Location.Y + stuAnswerlbl.Height + 6);
                    mark         = nud.Location.Y + nud.Height;
                }
            }
            if (salist.Count != 0)
            {
                //简答题
                i = 0;
                Label salbl = new Label();
                salbl.Text     = "简答题部分";
                salbl.AutoSize = true;
                this.Controls.Add(salbl);
                salbl.Location = new Point(SPACE, mark + 2 * SPACE);
                int hit = salbl.Location.Y + 2 * SPACE;
                foreach (Question question in salist)
                {
                    Label lbl = new Label();
                    lbl.Text = (i + 1) + "." + question.question + "(" + question.mark + "分)";
                    i++;
                    lbl.Width  = 50 * SPACE;
                    lbl.Height = AnswerDialog.getLineNum(lbl.Text) * SPACE;
                    this.Controls.Add(lbl);
                    lbl.Location = new Point(SPACE, hit);
                    hit         += (lbl.Height + 7 * SPACE);
                    Label answerlbl = new Label();
                    answerlbl.Text   = "参考答案:" + question.answer;
                    answerlbl.Width  = 50 * SPACE;
                    answerlbl.Height = AnswerDialog.getLineNum(answerlbl.Text) * SPACE;
                    this.Controls.Add(answerlbl);
                    answerlbl.Location = new Point(SPACE, lbl.Location.Y + lbl.Height + 6);
                    Label stuAnswerlbl = new Label();
                    stuAnswerlbl.Text   = "学员答案:" + question.stuAnswer;
                    stuAnswerlbl.Width  = 50 * SPACE;
                    stuAnswerlbl.Height = AnswerDialog.getLineNum(stuAnswerlbl.Text) * SPACE;
                    this.Controls.Add(stuAnswerlbl);
                    stuAnswerlbl.Location = new Point(SPACE, answerlbl.Location.Y + answerlbl.Height + 6);
                    MyNumericUpDown nud = new MyNumericUpDown();
                    nud.Width     = 6 * SPACE;
                    nud.Maximum   = question.mark;
                    nud.Minimum   = 0;
                    nud.Increment = 1;
                    nud.Accelerations.Add(acceleration);
                    this.Controls.Add(nud);
                    nud.Location = new Point(SPACE, stuAnswerlbl.Location.Y + stuAnswerlbl.Height + 6);
                    mark         = nud.Location.Y + nud.Height;
                }
            }
            Button btnOk = new Button();

            btnOk.Click += new EventHandler(btnOk_Click);
            btnOk.Text   = "提交";
            btnOk.Width  = 6 * SPACE;
            btnOk.Height = 2 * SPACE;
            this.Controls.Add(btnOk);
            Button btnCancel = new Button();

            btnCancel.Click += new EventHandler(btnCancel_Click);
            btnCancel.Text   = "取消";
            btnCancel.Width  = 6 * SPACE;
            btnCancel.Height = 2 * SPACE;
            this.Controls.Add(btnCancel);
            btnOk.Location     = new Point((this.Width - btnOk.Width - btnCancel.Width) / 3, mark + 3 * SPACE);
            btnCancel.Location = new Point(btnOk.Location.X + btnOk.Width + (this.Width - btnOk.Width - btnCancel.Width) / 3, mark + 3 * SPACE);
        }
 // Methods
 public virtual void Add(NumericUpDownAcceleration acceleration)
 {
 }
 public virtual bool Remove(NumericUpDownAcceleration acceleration)
 {
 }
 public virtual bool Contains(NumericUpDownAcceleration acceleration)
 {
 }