private Question GenerateMD()
        {
            double a = 0;
            double b = 0;
            double c = 0;

            MathAPI.MMSelectRandom(ref a, ref b, ref c, this.maxNumber, this.maxNumber, 0);

            Operator op = Operator.Multiply;

            Random key         = new Random(DateTime.Now.Second);
            Random rand        = new Random(DateTime.Now.Second * key.Next(1234));
            int    randOpIndex = rand.Next(99);

            randOpIndex = randOpIndex % 2;
            if (randOpIndex == 0)
            {
                op = Operator.Multiply;
            }
            else
            {
                op = Operator.Division;
                double temp = a;
                a = c;
                c = temp;
            }

            return(new Question_a_b_c((int)a, (int)b, (int)c, op));
        }
        protected override Question GenerateQuestion()
        {
            double a = 0;
            double b = 0;
            double c = 0;

            MathAPI.MMSelectRandom(ref a, ref b, ref c, this.maxNumber, this.maxNumber, 0);

            Operator op = Operator.Multiply;

            Random key         = new Random();
            Random rand        = new Random(4 * key.Next());
            int    randOpIndex = rand.Next();

            randOpIndex = randOpIndex % 2;
            if (randOpIndex == 0)
            {
                op = Operator.Multiply;
            }
            else
            {
                op = Operator.Division;
                double temp = a;
                a = c;
                c = temp;
            }

            return(new Question_a_b_c((int)a, (int)b, (int)c, op));
        }
Beispiel #3
0
 public System.Windows.UIElement GetStartupPage()
 {
     MathAPI.MMInit(IntPtr.Zero);
     ControlMgr.Instance.Entry = this;
     MathSetting.Instance.Type = typeof(MultiplyDivisionQuestionData);
     MathSetting.Instance.CurrentQuestionHeader = MultiplyDivisionQuestionData.header;
     MathSetting.Instance.CreateQuestionData   += new CreateQuestionDataDelegate(Instance_CreateQuestionData);
     return(ControlMgr.Instance.MathStartupControl);
 }
        public System.Windows.UIElement GetStartupPage()
        {
            ResourceDictionary rd = new ResourceDictionary();

            rd.Source = new Uri(@"pack://application:,,,/Math;component/Resources/DataDictionary.xaml");
            App.Current.Resources.MergedDictionaries.Add(rd);
            MathSetting.Instance.Type = MathType.Multiply_Division;
            MathAPI.MMInit(IntPtr.Zero);
            ControlMgr.Instance.Entry = this;
            return(ControlMgr.Instance.MathStartupControl);
        }
Beispiel #5
0
        protected override Question GenerateQuestion()
        {
            double a = 0;
            double b = 0;
            double c = 0;

            MathAPI.MMSelectRandom(ref a, ref b, ref c, 9, 9, 0);

            Operator op = Operator.Multiply;

            return(new Question_a_b_c((int)a, (int)b, (int)c, op));
        }
        private Question GenerateAM()
        {
            int a = 0;
            int b = 0;
            int c = 0;

            MathAPI.MCSelectRandom(ref a, ref b, ref c, this.maxNumber, 0);

            Operator op = Operator.Plus;

            if (a - b == c)
            {
                op = Operator.Minus;
            }

            return(new Question_a_b_c(a, b, c, op));
        }