コード例 #1
0
ファイル: SharedQuizExercise.cs プロジェクト: aragoubi/Nine
 public SharedQuizExercise(QuizLayer layer, int uid, List<int> bullets, QuizMode mode, string exerciseName,
     string userName)
     : base(layer, uid, exerciseName, userName)
 {
     Bullets = bullets;
     Mode = mode;
 }
コード例 #2
0
 public SharedQuizExercise(QuizLayer layer, int uid, List <int> bullets, QuizMode mode, string exerciseName,
                           string userName)
     : base(layer, uid, exerciseName, userName)
 {
     Bullets = bullets;
     Mode    = mode;
 }
コード例 #3
0
ファイル: QuizLayer.cs プロジェクト: aragoubi/Nine
 internal void AddBullet(int offset, Point position, QuizMode mode)
 {
     if (mode == QuizMode.QCM)
         Bullets.Add(new QCMBullet(position, offset));
     else
         Bullets.Add(new QCUBullet(position, offset));
 }
コード例 #4
0
        public static QuizMode CreateQuizMode()
        {
            var testObject = new QuizMode
            {
                Type       = QuizModeType.Binary,
                IsSelected = true
            };

            return(testObject);
        }
コード例 #5
0
 internal void AddBullet(int offset, Point position, QuizMode mode)
 {
     if (mode == QuizMode.QCM)
     {
         Bullets.Add(new QCMBullet(position, offset));
     }
     else
     {
         Bullets.Add(new QCUBullet(position, offset));
     }
 }
コード例 #6
0
        /// <summary>
        /// クイズモードを変更する
        /// </summary>
        /// <param name="quizMode"></param>
        private void ChangeQuizMode(QuizMode quizMode)
        {
            _animTime        = 0.0f;
            _currentQuizMode = quizMode;
            bool isQuestion = (_currentQuizMode == QuizMode.Question);
            bool isResult   = (_currentQuizMode == QuizMode.Result);
            bool isGetItem  = (_currentQuizMode == QuizMode.GetItem);
            bool isHint     = (_currentQuizMode == QuizMode.Hint);

            _questionCanvas.SetActive(isQuestion);
            _resultCanvas.SetActive(isResult);
            _getItemCanvas.SetActive(isGetItem);
            _hintCanvas.SetActive(isHint);

            SetEnabledUICanvas();
        }
コード例 #7
0
        protected override void Seed(QuoteQuizContext context)
        {
            //  This method will be called after migrating to the latest version.

            if (!context.Authors.Any() && !context.Quotes.Any())
            {
                var kevinKruse = new Author
                {
                    Name = "Kevin Kruse"
                };

                context.Authors.Add(kevinKruse);

                var quote1 = new Quote
                {
                    Content = "Life is about making an impact, not making an income.",
                    Author  = kevinKruse
                };

                context.Quotes.Add(quote1);

                var napoleonHill = new Author
                {
                    Name = "Napoleon Hill"
                };

                context.Authors.Add(napoleonHill);

                var quote2 = new Quote
                {
                    Content = "Whatever the mind of man can conceive and believe, it can achieve.",
                    Author  = napoleonHill
                };

                context.Quotes.Add(quote2);

                var bayGanyo = new Author
                {
                    Name = "Bay Ganyo"
                };

                context.Authors.Add(napoleonHill);

                var quote3 = new Quote
                {
                    Content = "You had money, you gave money",
                    Author  = bayGanyo
                };

                context.Quotes.Add(quote3);

                var sunTsu = new Author
                {
                    Name = "Sun Tsu"
                };

                context.Authors.Add(sunTsu);

                var quote4 = new Quote
                {
                    Content = "All warfare is based on deception",
                    Author  = sunTsu
                };

                context.Quotes.Add(quote4);

                var stoichkov = new Author
                {
                    Name = "Stoichkov"
                };

                context.Authors.Add(stoichkov);

                var quote5 = new Quote
                {
                    Content = "First half very good, second half I no like...",
                    Author  = stoichkov
                };

                context.Quotes.Add(quote5);

                var luboslavPenev = new Author
                {
                    Name = "Luboslav Penev"
                };

                context.Authors.Add(luboslavPenev);

                var quote6 = new Quote
                {
                    Content = "If you don't like me, blow on the soup.",
                    Author  = luboslavPenev
                };

                context.Quotes.Add(quote6);

                context.SaveChanges();
            }

            if (!context.QuizModes.Any())
            {
                var binaryMode = new QuizMode
                {
                    Type       = QuizModeType.Binary,
                    IsSelected = true
                };

                context.QuizModes.Add(binaryMode);

                var multipleChoiceMode = new QuizMode
                {
                    Type       = QuizModeType.MultipleChoice,
                    IsSelected = false
                };

                context.QuizModes.Add(multipleChoiceMode);

                context.SaveChanges();
            }
        }
コード例 #8
0
ファイル: QuizContent.cs プロジェクト: aragoubi/Nine
 /// <summary>
 ///     Initializes a new instance of the <see cref="ExerciseContent" /> class.
 /// </summary>
 /// <param name="holder">The holder.</param>
 /// <param name="name">The name.</param>
 /// <param name="processing">The processing.</param>
 internal QuizContent(BasicHolder holder, string name, ExerciseProcessing processing, QuizMode mode)
     : base(holder, name, processing)
 {
     Mode = mode;
 }
コード例 #9
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="QuizProcessing" /> class.
 /// </summary>
 /// <param name="mode">The mode.</param>
 public QuizProcessing(QuizMode mode)
 {
     Mode   = mode;
     result = new Dictionary <int, int>();
 }
コード例 #10
0
ファイル: QuizProcessing.cs プロジェクト: aragoubi/Nine
 /// <summary>
 ///     Initializes a new instance of the <see cref="QuizProcessing" /> class.
 /// </summary>
 /// <param name="mode">The mode.</param>
 public QuizProcessing(QuizMode mode)
 {
     Mode = mode;
     result = new Dictionary<int, int>();
 }
コード例 #11
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="ExerciseContent" /> class.
 /// </summary>
 /// <param name="holder">The holder.</param>
 /// <param name="name">The name.</param>
 /// <param name="processing">The processing.</param>
 internal QuizContent(BasicHolder holder, string name, ExerciseProcessing processing, QuizMode mode)
     : base(holder, name, processing)
 {
     Mode = mode;
 }
コード例 #12
0
ファイル: Quiz.cs プロジェクト: HeinerMuc/archive
        public bool SetCurrentQuestionAnswered()
        {
            if(currentQuestion+1>=currentQuestions.Count)
            {
                //Spiel zuende
                quizMode=QuizMode.Idle;

                return true;
            }

            currentQuestion++;
            LastRequestForCurrentQuestion=DateTime.MinValue;
            return false;
        }
コード例 #13
0
ファイル: Quiz.cs プロジェクト: HeinerMuc/archive
        public bool Start(int numberOfQuestions, string category)
        {
            if(quizMode==QuizMode.Idle)
            {
                currentQuestions=new List<Question>();
                currentQuestion=0;

                //Fragen zusammenwürfeln
                List<Question> tmpQuestions=new List<Question>();
                tmpQuestions.AddRange(Questions);

                for(int i=0;i<numberOfQuestions;i++)
                {
                    int questionIndex=rnd.Next(tmpQuestions.Count);
                    currentQuestions.Add(tmpQuestions[questionIndex]);
                    tmpQuestions.RemoveAt(questionIndex);
                }

                LastRequestForCurrentQuestion=DateTime.MinValue;
                quizMode=QuizMode.QuizInAction;

                return true;
            }
            else
            {
                return false; //Quiz ist bereits aktiv
            }
        }