⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 question.cs

📁 本在线考试系统采用了面向对象的分析和设计
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.Text;

namespace ExaminationSystem.BLL.Domain
{
    public class Question:DomainObject<long>
    {
        private int scoreValue;

        public virtual int ScoreValue
        {
            get { return scoreValue; }
            set { scoreValue = value; }
        }

        private int score;

        public virtual int Score
        {
            get { return score; }
            set {
                if (value > ScoreValue)
                    throw new Exception("得分不能超过分值!");
                score = value;
            }
        }

        private string studentAnswer;

        public virtual string StudentAnswer
        {
            get { return studentAnswer; }
            set { studentAnswer = value; }
        }

        private QuestionContent content;

        public virtual QuestionContent Content
        {
            get { return content; }
            set { content = value; }
        }

        public string GetQuestionXML()
        {
            StringBuilder builder = new StringBuilder(500);
            builder.Append("<Question ID=\"" + ID + "\" ScoreValue=\"" + ScoreValue + "\"  Score=\"" + Score + "\" IsScored=\""+IsScored+"\">");
            builder.Append("<StudentAnswer><![CDATA[" + StudentAnswer + "]]></StudentAnswer>");
            builder.Append(Content.GetContentXML());
            builder.Append("</Question>");
            return builder.ToString();
        }
        public override int GetHashCode()
        {
            return (this.GetType().FullName + "|" +
                Content.GetHashCode()).GetHashCode();
        }
        private QuestionContainer questionContainer;

        public virtual QuestionContainer QuestionContainer
        {
            get { return questionContainer; }
            set { questionContainer = value; }
        }
        private bool isScored=false;

        public virtual bool IsScored
        {
            get { return isScored; }
            set { isScored = value; }
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -