Exemplo n.º 1
0
 public static string getT30(连线题 连线题, bool 是否显示答案)
 {
     if (!是否显示答案) { return ""; }
     return getResItem(连线题.解题思路);
 }
Exemplo n.º 2
0
        public static string getT30(连线题 连线题)
        {
            List<连线题选项> 连线题左选项集合 = 连线题.连线题左选项集合;
            List<连线题选项> 连线题右选项集合 = 连线题.连线题右选项集合;
            List<连线题答案> 连线题答案集合 = 连线题.连线题答案集合;
            连线题答案 连线题答案;
            Dictionary<Guid, int> 连线题左选项Data = new Dictionary<Guid, int>();
            Dictionary<Guid, int> 连线题右选项Data = new Dictionary<Guid, int>();
            string 大写字母, 小写字母, html = "";

            //遍历连线题左选项集合
            for (var i = 0; i < 连线题左选项集合.Count; i++)
            {
                连线题左选项Data[连线题左选项集合[i].ID] = i;
            }

            //遍历连线题右选项集合
            for (var i = 0; i < 连线题右选项集合.Count; i++)
            {
                连线题右选项Data[连线题右选项集合[i].ID] = i;
            }

            //遍历连线题答案集合
            for (var i = 0; i < 连线题答案集合.Count; i++)
            {
                连线题答案 = 连线题答案集合[i];

                大写字母 = ViewLibManage.数字转大写字母(连线题左选项Data[连线题答案.连线题左选项ID]);
                小写字母 = ViewLibManage.数字转小写字母(连线题右选项Data[连线题答案.连线题右选项ID]);

                html += getT30CellText(i, 大写字母, 小写字母);
            }

            string tds = getT30选项(连线题) + getT30Module答案(getT30Head答案("RightAnswer"), html);
            return getTable("<tr>" + tds + "</tr>");
        }
Exemplo n.º 3
0
        public static string getT30选项(连线题 连线题)
        {
            string _leftHead = getT30Head选项("Left"),
                _leftList = getT30选项LeftList(连线题.连线题左选项集合),
                _rightHead = getT30Head选项("Right"),
                _rightList = getT30选项RightList(连线题.连线题右选项集合);

            return getT30Module选项(_leftHead, _leftList) +
                   getT30Module选项(_rightHead, _rightList);
        }
Exemplo n.º 4
0
 public static void 给连线题选项赋值新ID(连线题 link)
 {
     foreach (连线题选项 choice in link.连线题左选项集合)
     {
         连线题答案 answer = link.连线题答案集合.Where(a => a.连线题左选项ID == choice.ID).FirstOrDefault();
         if (answer != null)
         {
             choice.ID = Guid.NewGuid();
             answer.连线题左选项ID = choice.ID;
         }
         else
         {
             choice.ID = Guid.NewGuid();
         }
     }
     foreach (连线题选项 choice in link.连线题右选项集合)
     {
         连线题答案 answer = link.连线题答案集合.Where(a => a.连线题右选项ID == choice.ID).FirstOrDefault();
         if (answer != null)
         {
             choice.ID = Guid.NewGuid();
             answer.连线题右选项ID = choice.ID;
         }
         else
         {
             choice.ID = Guid.NewGuid();
         }
     }
 }