Beispiel #1
0
    public static List <St_TTimuDaXue> getList(string sc, string kemuId, string leimu, string seq, string readType, int top, ref AFDictionary <string, int> dic1)
    {
        AFDictionary <string, St_TTimuDaXue> dicLeimu1 = BLL1.GetDic(sc, kemuId, leimu, ref dic1);

        int index1 = 0;

        if (dic1.ContainsKey(seq))
        {
            index1 = dic1[seq];
        }
        if (index1 < 0)
        {
            index1 = 0;
        }
        if (top == 0)
        {
            top = 50;
        }
        List <St_TTimuDaXue> list1 = new List <St_TTimuDaXue>();

        list1.AddRange(dicLeimu1.Values);

        if (list1.Count > 0)
        {
            List <St_TTimuDaXue> list2 = new List <St_TTimuDaXue>();
            if ((string.IsNullOrEmpty(readType) || readType == "0") && list1.Count > 0)
            {
                St_TTimuDaXue[] list3 = new St_TTimuDaXue[top];
                list1.CopyTo(index1, list3, 0, top);
                list2.AddRange(list3);
                return(list2);
            }
            else
            {
                int index2 = index1 - top;
                if (index2 < 0)
                {
                    index2 = 0;
                }
                St_TTimuDaXue[] list3 = new St_TTimuDaXue[top];
                list1.CopyTo(index2, list3, 0, top);
                list2.AddRange(list3);
                return(list2);
            }
        }
        return(list1);
    }
Beispiel #2
0
    public St_TiMu233 GetTiMu233Cond(St_TTimuDaXue valObj2)
    {
        St_TiMu233 valObj = new St_TiMu233();

        if (valObj2.KemuId != 0)
        {
            valObj.ClassId = Convert.ToString(valObj2.KemuId); //
        }
        if (!String.IsNullOrEmpty(valObj2._Sourceid))          //试卷id
        {
            valObj.PaperId = (valObj2._Sourceid);              //
        }
        if (!String.IsNullOrEmpty(valObj2.OptionType))
        {
            valObj.ExamType = get233OptionType(valObj2.OptionType);    //
        }
        return(valObj);
    }
Beispiel #3
0
    public static AFDictionary <string, St_TTimuDaXue> Init(string sc, string kemuId, ref AFDictionary <string, int> dic1)
    {
        initDaxue();
        readInt++;
        if (true)//每100次重新加载一次题目。
        {
            if (listMks.Count > 0 && DateTime.Now.Subtract(now1).TotalSeconds < 120)
            {
                now1    = DateTime.Now;
                readInt = 0;
                return(listMks);
            }
        }
        St_TTimuDaXue cond1 = new St_TTimuDaXue();

        cond1.Sc     = StringHelper.GetNumeric(sc);
        cond1.KemuId = Convert.ToInt32(kemuId);
        List <St_TTimuDaXue> list1 = BLLTable <St_TTimuDaXue> .Select(new St_TTimuDaXue(), cond1);

        int jj = 0;

        foreach (St_TTimuDaXue tt in list1)
        {
            jj++;
            listMks.Add(jj.ToString(), tt);
        }

        #region 其他题型
        AFDictionary <string, St_TTimuDaXue> listMks1 = new AFDictionary <string, St_TTimuDaXue>();
        AFDictionary <string, St_TTimuDaXue> listMks2 = new AFDictionary <string, St_TTimuDaXue>();
        AFDictionary <string, St_TTimuDaXue> listMks3 = new AFDictionary <string, St_TTimuDaXue>();
        AFDictionary <string, St_TTimuDaXue> listMks4 = new AFDictionary <string, St_TTimuDaXue>();

        AFDictionary <string, int> list2Mks  = new AFDictionary <string, int>();
        AFDictionary <string, int> list2Mks1 = new AFDictionary <string, int>();
        AFDictionary <string, int> list2Mks2 = new AFDictionary <string, int>();
        AFDictionary <string, int> list2Mks3 = new AFDictionary <string, int>();
        AFDictionary <string, int> list2Mks4 = new AFDictionary <string, int>();

        int i = -1;
        foreach (string id in listMks.Keys)
        {
            i++;
            list2Mks.Add(id, i);
            if (listMks[id].OptionType == "0")
            {
                listMks1.Add(id, listMks[id]);
                list2Mks1.Add(id, list2Mks1.Count);
            }
            if (listMks[id].OptionType == "1")
            {
                listMks2.Add(id, listMks[id]);
                list2Mks2.Add(id, list2Mks2.Count);
            }
            if (listMks[id].OptionType == "2")
            {
                listMks3.Add(id, listMks[id]);
                list2Mks3.Add(id, list2Mks3.Count);
            }
            if (listMks[id].OptionType == "3")
            {
                listMks4.Add(id, listMks[id]);
                list2Mks4.Add(id, list2Mks4.Count);
            }
        }
        string file1 = GetFile(sc, kemuId);
        if (dicDicTiMu.ContainsKey(file1))
        {
            dicDicTiMu[file1] = listMks;
        }
        else
        {
            dicDicTiMu.Add(file1, listMks);
        }

        if (dicDicTiMu1.ContainsKey(file1))
        {
            dicDicTiMu1[file1] = listMks1;
        }
        else
        {
            dicDicTiMu1.Add(file1, listMks1);
        }

        if (dicDicTiMu2.ContainsKey(file1))
        {
            dicDicTiMu2[file1] = listMks2;
        }
        else
        {
            dicDicTiMu2.Add(file1, listMks2);
        }

        if (dicDicTiMu3.ContainsKey(file1))
        {
            dicDicTiMu3[file1] = listMks3;
        }
        else
        {
            dicDicTiMu3.Add(file1, listMks3);
        }

        if (dicDicTiMu4.ContainsKey(file1))
        {
            dicDicTiMu4[file1] = listMks4;
        }
        else
        {
            dicDicTiMu4.Add(file1, listMks4);
        }
        /////

        if (dic2DicTiMu.ContainsKey(file1))
        {
            dic2DicTiMu[file1] = list2Mks;
        }
        else
        {
            dic2DicTiMu.Add(file1, list2Mks);
        }

        if (dic2DicTiMu1.ContainsKey(file1))
        {
            dic2DicTiMu1[file1] = list2Mks1;
        }
        else
        {
            dic2DicTiMu1.Add(file1, list2Mks1);
        }

        if (dic2DicTiMu2.ContainsKey(file1))
        {
            dic2DicTiMu2[file1] = list2Mks2;
        }
        else
        {
            dic2DicTiMu2.Add(file1, list2Mks2);
        }

        if (dic2DicTiMu3.ContainsKey(file1))
        {
            dic2DicTiMu3[file1] = list2Mks3;
        }
        else
        {
            dic2DicTiMu3.Add(file1, list2Mks3);
        }

        if (dic2DicTiMu4.ContainsKey(file1))
        {
            dic2DicTiMu4[file1] = list2Mks4;
        }
        else
        {
            dic2DicTiMu4.Add(file1, list2Mks4);
        }

        #endregion 其他题型

        if (dicDicTiMu.ContainsKey(file1))
        {
            return(dicDicTiMu[file1]);
        }
        if (dic2DicTiMu.ContainsKey(file1))
        {
            dic1 = dic2DicTiMu[file1];
        }
        return(new AFDictionary <string, St_TTimuDaXue>());
    }
Beispiel #4
0
    public St_TTimuDaXue GetTTimuDaXue(St_TiMu233 valObj2)
    {
        St_TTimuDaXue valObj = new St_TTimuDaXue();

        valObj.Id         = Convert.ToInt32(valObj2.ExamId);//Convert.ToString(valObj2.Id);
        valObj.QuestionId = Convert.ToInt32(valObj2.OrderId);
        //valObj.PaperInfo = valObj2.PaperInfo;
        //valObj.IsRepeatTf = valObj2.IsRepeatTf;

        //1单选,2多选,3不定项选择题,4判断题,7简答题=计算分析题
        valObj.Answer = valObj2.Answer.Replace("A", "1").Replace("B", "2").Replace("C", "3").Replace("D", "4");
        if (valObj.Answer == valObj2.Answer)
        {
            valObj.Answer = valObj2.Answer.Replace("0", "1").Replace("1", "2").Replace("2", "3").Replace("3", "4").Replace("4", "5")
                            .Replace("5", "6").Replace("6", "7").Replace("7", "8").Replace("8", "9");
        }

        //Analysis
        valObj.Explain = valObj2.Analysis;
        //valObj.UserDeNumStats = valObj2.UserDeNumStats;
        valObj.Question = valObj2.Content;

        valObj.OptionType = getDaxueOptionType(valObj2.ExamType);    //
        // valObj.SelectNum = valObj2.SelectNum;
        valObj.LinkExam = valObj2.LinkExam;
        valObj.OrderId  = valObj2.OrderId;
        //valObj.RulesId = valObj2.RulesId;
        valObj.DiggUp   = valObj2.DiggUp;
        valObj.DiggDown = valObj2.DiggDown;
        //valObj.Weight = valObj2.Weight;
        //valObj.DeNums = valObj2.DeNums;
        //valObj.UserDeNum = valObj2.UserDeNum;
        //valObj.DiscussCount = valObj2.DiscussCount;
        //valObj.ExamDiscussCount = valObj2.ExamDiscussCount;
        //valObj.AnswerDiscussCount = valObj2.AnswerDiscussCount;
        //valObj.VedioDiscussCount = valObj2.VedioDiscussCount;
        //valObj.MyDiscussCount = valObj2.MyDiscussCount;
        //valObj.ExpanddoExamNum = valObj2.ExpanddoExamNum;
        //valObj.ExpandPercent = valObj2.ExpandPercent;
        //valObj.FavNum = valObj2.FavNum;
        //valObj.IsFavorites = valObj2.IsFavorites;
        //valObj.FavInfo = valObj2.FavInfo;

        //valObj.Question = valObj2.Question;
        //valObj.QuestionCount = valObj2.QuestionCount;
        valObj.Teacher   = valObj2.Teacher;
        valObj.Knowledge = valObj2.Knowledge;
        //valObj.ExamNewStats = valObj2.ExamNewStats;
        //valObj.RightOrWrong = valObj2.RightOrWrong;
        //valObj.NewestNote = valObj2.NewestNote;
        //valObj.Md5 = valObj2.Md5;
        valObj.OptionStr = valObj2.OptionList;

        ////这里的问题要解决
        valObj._Sourceid = valObj2.SubQuestion;

        valObj.KemuId     = Convert.ToInt32(valObj2.ClassId);
        valObj.Sourceid   = valObj2.PaperId;
        valObj.SourceFile = valObj2.PaperName;
        //valObj.ClassName = valObj2.ClassName;
        valObj._SourceZhangjie = valObj2.PaperShortName;

        //历年真题;type=1,
        valObj._ExamType = (valObj2.Type1 == "1") ? "历年真题" : "模拟卷";

        valObj.YearId = valObj2.YearId;
        //valObj.TypeIdUrl = valObj2.TypeIdUrl;
        valObj.Url = valObj2.Url;
        //valObj.Answer123 = valObj2.Answer123;
        //valObj.AnswerABC = valObj2.AnswerABC;

        return(valObj);
    }