Beispiel #1
0
        private int NewPart8(Guid quizId)
        {
            bl_QuestionGroup bl_group    = new bl_QuestionGroup(db);
            bl_Question      bl_question = new bl_Question(db);

            for (byte i = 0; i < 4; i++)
            {
                //4 pairs of reading texts with 5 questions per pair
                var groupId = bl_group.Create(
                    quizId,
                    8, //Thay đổi đối với từng part (thứ tự part)
                    String.Format("Part8.{0}-{1}", 181 + i * 5, 185 + i * 5),
                    i,
                    null, null);

                //Create 5 question each a group
                for (byte ord = 0; ord < 5; ord++)
                {
                    bl_question.Create(
                        groupId,
                        quizId,
                        (byte)(181 + i * 5 + ord), //đúng thứ tự câu hỏi trong một bộ quiz
                        null, null, null, null, null, null, null, 0);
                }
            }

            return(0);
        }
Beispiel #2
0
        private int NewPart7(Guid quizId, int numberOfGroup, List <int> itemList)
        {
            bl_QuestionGroup bl_group    = new bl_QuestionGroup(db);
            bl_Question      bl_question = new bl_Question(db);

            int tmp = 0;

            for (byte i = 0; i < itemList.Count; i++)
            {
                //4 pairs of reading texts with 5 questions per pair
                var groupId = bl_group.Create(
                    quizId,
                    7, //Thay đổi đối với từng part (thứ tự part)
                    String.Format("Part7.{0}-{1}", 153 + tmp, 153 + tmp + itemList[i] - 1),
                    i,
                    null, null);

                for (byte ord = 0; ord < itemList[i]; ord++)
                {
                    bl_question.Create(
                        groupId,
                        quizId,
                        (byte)(153 + tmp + ord), //đúng thứ tự câu hỏi trong một bộ quiz
                        null, null, null, null, null, null, null, 0);
                }

                tmp += itemList[i];
            }

            return(0);
        }
Beispiel #3
0
        private int NewPart6(Guid quizId)
        {
            bl_QuestionGroup bl_group    = new bl_QuestionGroup(db);
            bl_Question      bl_question = new bl_Question(db);

            for (byte i = 0; i < 3; i++)
            {
                //3 pairs of reading texts with 4 questions per pair
                var groupId = bl_group.Create(
                    quizId,
                    6, //Thay đổi đối với từng part
                    String.Format("Part6.{0}-{1}", 141 + i * 4, 144 + i * 4),
                    i,
                    null, null);

                //Create 4 question each a group
                for (byte ord = 0; ord < 4; ord++)
                {
                    bl_question.Create(
                        groupId,
                        quizId,
                        (byte)(141 + i * 4 + ord),
                        null, null, null, null, null, null, null, 0);
                }
            }

            return(0);
        }
Beispiel #4
0
        private int NewPart5(Guid quizId)
        {
            bl_QuestionGroup bl_group    = new bl_QuestionGroup(db);
            bl_Question      bl_question = new bl_Question(db);

            for (byte i = 0; i < 8; i++)
            {
                //8 pairs of reading texts with 5 questions per pair
                var groupId = bl_group.Create(
                    quizId,
                    5, //Thay đổi đối với từng part
                    String.Format("Part5.{0}-{1}", 101 + i * 5, 105 + i * 5),
                    i,
                    null, null);

                //Create 5 question each a group
                for (byte ord = 0; ord < 5; ord++)
                {
                    bl_question.Create(
                        groupId,
                        quizId,
                        (byte)(101 + i * 5 + ord),
                        null, null, null, null, null, null, null, 0);
                }
            }
            return(0);
        }
Beispiel #5
0
        private int NewPart4(Guid quizId)
        {
            bl_QuestionGroup bl_group    = new bl_QuestionGroup(db);
            bl_Question      bl_question = new bl_Question(db);

            for (byte i = 0; i < 10; i++)
            {
                Int32 s = 70 + i * 3;

                //4 pairs of reading texts with 10 questions per pair
                var groupId = bl_group.Create(
                    quizId,
                    4, //Thay đổi đối với từng part (thứ tự part)
                    String.Format("Part4.{0}-{1}", s + 1, s + 3),
                    i,
                    null, null);

                //Create 3 question each a group
                for (byte ord = 0; ord < 3; ord++)
                {
                    bl_question.Create(
                        groupId,
                        quizId,
                        (byte)(s + ord + 1),
                        null, null, null, null, null, null, null, 0);
                }
            }
            return(0);
        }
Beispiel #6
0
        private int NewPart1(Guid quizId)
        {
            bl_QuestionGroup bl_group    = new bl_QuestionGroup(db);
            bl_Question      bl_question = new bl_Question(db);

            for (byte i = 0; i < 2; i++)
            {
                //4 pairs of reading texts with 5 questions per pair
                var groupId = bl_group.Create(
                    quizId,
                    1, //Thay đổi đối với từng part (thứ tự part)
                    String.Format("Part1.{0}-{1}", 1 + i * 5, 5 + i * 5),
                    i,
                    null, null);

                //Create 5 question each a group
                for (byte ord = 0; ord < 5; ord++)
                {
                    bl_question.Create(
                        groupId,
                        quizId, //phải trả về đúng với group id phía trên
                        (byte)(1 + i * 5 + ord),
                        null, null, null, null, null, null, null, 0);
                }
            }

            return(0);
        }