示例#1
0
        /// <summary>
        /// 取得學生綜合表現答案
        /// </summary>
        /// <param name="StudentIDList"></param>
        private void GetStudentABCardAnswerDict(List <string> StudentIDList)
        {
            _AnswerDict.Clear();
            // 取得學生綜合表現答案
            List <UDT_ABCardDataDef> ABCardDataList = UDTTransfer.GetABCardDataListByStudentList(StudentIDList);

            foreach (string str in StudentIDList)
            {
                int id = int.Parse(str);
                List <AnswerPkey> dataList = new List <AnswerPkey>();
                foreach (UDT_ABCardDataDef data in ABCardDataList.Where(x => x.StudentID == id))
                {
                    XElement ansElmRoot = XElement.Parse(data.Content);

                    foreach (XElement elm in ansElmRoot.Elements("Ans"))
                    {
                        AnswerPkey apk = new AnswerPkey();
                        apk.dataElement = elm;
                        apk.Label       = data.SubjectName;
                        apk.Name        = elm.Attribute("name").Value;
                        apk.StudentID   = id;
                        apk.TemplateID  = data.TemplateID;
                        dataList.Add(apk);
                    }
                }

                if (dataList.Count > 0)
                {
                    _AnswerDict.Add(str, dataList);
                }
            }
        }
        /// <summary>
        /// 取得學生綜合表現答案
        /// </summary>
        /// <param name="StudentIDList"></param>
        private void GetStudentABCardAnswerDict(List<string> StudentIDList)
        {
            _AnswerDict.Clear();
            // 取得學生綜合表現答案
            List<UDT_ABCardDataDef> ABCardDataList = UDTTransfer.GetABCardDataListByStudentList(StudentIDList);

            foreach (string str in StudentIDList)
            {
                int id=int.Parse(str);
                List<AnswerPkey> dataList = new List<AnswerPkey>();
                foreach (UDT_ABCardDataDef data in ABCardDataList.Where(x => x.StudentID == id))
                {
                    XElement ansElmRoot = XElement.Parse(data.Content);

                    foreach (XElement elm in ansElmRoot.Elements("Ans"))
                    {
                        AnswerPkey apk = new AnswerPkey();
                        apk.dataElement = elm;
                        apk.Label = data.SubjectName;
                        apk.Name = elm.Attribute("name").Value;
                        apk.StudentID = id;
                        apk.TemplateID = data.TemplateID;
                        dataList.Add(apk);
                    }
                }

                if (dataList.Count > 0)
                {
                    _AnswerDict.Add(str, dataList);
                }
            }
        }