Exemple #1
0
        public SCETakeRecord(JHSCETakeRecord record)
        {
            _record = record;

            //try to read score
            XmlElement root  = _record.ToXML();
            XmlNode    node1 = root.SelectSingleNode("Extension/Extension/Score");
            XmlNode    node2 = root.SelectSingleNode("Extension/Extension/AssignmentScore");

            _examScore    = node1 == null ? string.Empty : node1.InnerText;
            _regularScore = node2 == null ? string.Empty : node2.InnerText;
        }
        public SCETakeData(JHSCETakeRecord record)
        {
            Origin = record;

            XmlElement xmlrecord = record.ToXML();

            #region 嘗試取得 AssignmentScore
            XmlNode assignment = xmlrecord.SelectSingleNode("Extension/Extension/AssignmentScore");
            if (assignment != null)
            {
                AssignmentScore = ParseDecimalAllowNull(assignment.InnerText);
            }
            #endregion

            #region 嘗試取得 Effort
            XmlNode effort = xmlrecord.SelectSingleNode("Extension/Extension/Effort");
            if (effort != null)
            {
                Effort = (int?)ParseDecimalAllowNull(effort.InnerText);
            }
            #endregion
        }
Exemple #3
0
        public JHSCETakeRecord toJHSCETakeRecord()
        {
            XmlElement root  = _record.ToXML();
            XmlNode    node1 = root.SelectSingleNode("Extension/Extension/Score");
            XmlNode    node2 = root.SelectSingleNode("Extension/Extension/AssignmentScore");

            if (node1 == null)
            {
                node1 = root.OwnerDocument.CreateElement("Score");
                root.SelectSingleNode("Extension/Extension").AppendChild(node1);
            }

            if (node2 == null)
            {
                node2 = root.OwnerDocument.CreateElement("AssignmentScore");
                root.SelectSingleNode("Extension/Extension").AppendChild(node2);
            }

            node1.InnerText = _examScore;
            node2.InnerText = _regularScore;

            _record.Load(root);
            return(_record);
        }