Пример #1
0
    IEnumerator deadtimer()
    {
        yield return(new WaitForSeconds(3.5F));

        var getCoin = GameObject.Find("GameManager").GetComponent <GameManager>();


        if (getCoin.Coin >= 3)
        {
            gameObject.transform.position = checkpoint.transform.position;
        }


        else
        {
            gameObject.transform.position = spawnpoint.transform.position;
        }

        health = 100;
        mousesensitivitycheck.mouseSensitivity = 94.01f;
        Movecharacter.movementSpeed            = 6;

        Transform a = GameObject.Find("Camera").GetComponent <Transform>();

        a.localPosition             = new Vector3(0, 0.5f, 0);
        a.localRotation             = Quaternion.Euler(0, 0, 0);
        Movecharacter.groundCounter = 0;

        CheckAnswer.resetEnemiesActivity();

        Debug.Log("Can" + health);
    }
Пример #2
0
        private async Task SendSelectionResult(Message.Message contex, Mediator mediator)
        {
            var correctAnswer = new CheckAnswer(contex.Id, contex.Data);
            await mediator.HandleCommand(correctAnswer);

            Console.WriteLine("_________________correctAnswer" + correctAnswer.Result);
            var text = MessageTextPattern.GetResultMessage(correctAnswer.Result);
            await mediator.HandleCommand(new SendMessageCommand(contex.Id, text));
        }
Пример #3
0
        public string Calc(string exePath = "", string answerPath = "")
        {
            int factcount = 1;

            if (Mode == CoreMode.CheckMode)
            {
                string GradePath = ReadXml("//Path//Grade");
                CheckAnswer.Grade(exePath, answerPath, GradePath);
            }
            else if (Mode == CoreMode.ExerciseMode)
            {
                try {
                    bool HasNeg     = ReadOption("//Option//NegOp");
                    bool HasMultDiv = ReadOption("//Option//MultDivOp");
                    bool HasBrack   = ReadOption("//Option//BrackOp");
                    bool HasFrac    = ReadOption("//Option//FracOp");
                    int  OpCount    = ReadCount("//Count//OpCount");
                    int  ExeCount   = ReadCount("//Count//NumCount");
                    int  leftRange  = ReadCount("//Range//leftRange");
                    int  rightRange = ReadCount("//Range//rightRange");
                    //这俩路径是要在配置文件里指定的
                    string ExePath    = ReadXml("//Path//Exe");
                    string AnswerPath = ReadXml("//Path//Ans");
                    factcount = 0;
                    new GenerateExp(
                        HasNeg,
                        HasMultDiv,
                        HasBrack,
                        HasFrac,
                        OpCount,
                        ExeCount,
                        leftRange,
                        rightRange,
                        ExePath,
                        AnswerPath,
                        ref factcount
                        );
                }
                finally
                {
                    XmlDocument doc = new XmlDocument();
                    doc.Load("configure.xml");
                    XmlElement rootElem = doc.DocumentElement;
                    XmlNode    node     = doc.SelectSingleNode("//Count//FactCount");
                    XmlElement Exepath  = (XmlElement)node;
                    Exepath.InnerText = factcount.ToString();
                    doc.Save("configure.xml");
                }
            }
            else
            {
                //利用第一个参数...为表达式的题目
                return(new AnswerGet(exePath + " =").getAnswer());
            }
            return("");
        }
Пример #4
0
        private void popupButton_Click(object sender, RoutedEventArgs e)
        {
            dataList.Clear();
            dataList.Add(loadPositioСurrentButton.Content.ToString());
            dataList.Add(variantСurrentButton.Content.ToString());
            dataList.Add(tipCount.Text.ToString());

            tPage = new testPage(contentControl,
                                 titleLabel.Content + " Тест " + loadPositioСurrentButton.Content + "-" + variantСurrentButton.Content,
                                 timeCount.Text);

            contentControl.Content = tPage;

            //=================
            TestControl test = new TestControl();
            //LoaderClass loaderClass = new LoaderClass("Questions.txt");
            CheckAnswer checkAnswer = new CheckAnswer();

            // Загружаем из файла словарь
            checkAnswer.Variables = questions.getQuestionParams(choiceBlock.theme, choiceBlock.blockID, loadID, variantID);

            // Загружаем в графический интерфейс данные массива
            string testtext = "";
            int    proba    = 0;

            foreach (var massiv in checkAnswer.Variables)
            {
                if (massiv.Key == "h" || massiv.Key == "d")
                {
                    testtext += $"{massiv.Key} = {massiv.Value} м; ";
                }
                else
                {
                    testtext += $"{massiv.Key} = {massiv.Value} кН; ";
                }
                proba++;
                if (proba >= 3)
                {
                    testtext += "\n";
                    proba     = 0;
                }
            }
            test.DataExtraInfo(testtext);

            // Загружаем текст вопроса
            test.DataMainInfo(questions.getQuestionText(choiceBlock.theme, choiceBlock.blockID, loadID, variantID, 1));

            // Загружаем неизвестные переменные, которые нужно найти
            test.QuestionVals(questions.getQuestionFinds(choiceBlock.theme, choiceBlock.blockID, loadID, variantID, 1));



            test.GraphContent(System.IO.Path.GetFullPath(questions.getVariantsImgPath(choiceBlock.theme, choiceBlock.blockID, loadID)[loadID][1].ToString()));

            //==================
        }
Пример #5
0
        public async Task <string> CheckAnswer([FromBody] CheckAnswer command)
        {
            var wynik = await _flashcardService.CheckAnswer(command.FlashcardId, command.Answer);

            if (wynik)
            {
                return("Poprawna odpowiedź.");
            }
            return("Zła odpowiedź.");
        }
Пример #6
0
    // Use this for initialization
    void Start()
    {
        //Get scripts
        questionScript = GetComponent <Question>();
        answerScript   = GetComponent <CheckAnswer>();
        progressScript = GameObject.FindGameObjectWithTag("AvatarTransfer").GetComponent <AvatarProgress>();

        //Audio
        audioManager = GameObject.FindGameObjectWithTag("AudioManager").GetComponent <MathsAudio>();

        moneyScript = GameObject.Find("MoneyManager").GetComponent <PlayerMoney>();
    }
Пример #7
0
        public void CheckAsnwer_nullemptyError()
        {
            string expected = "NullOrEmpty Error!";

            Dictionary <string, double> dictTest = new Dictionary <string, double>
            {
                { "f1", 5 },
                { "f2", 3 }
            };
            CheckAnswer check = new CheckAnswer(dictTest);

            check.Formula = "";

            Assert.AreEqual(expected, check.Check());
        }
Пример #8
0
        public void CheckAsnwer_bracketError()
        {
            string expected = "Bracket Error!";

            Dictionary <string, double> dictTest = new Dictionary <string, double>
            {
                { "f1", 5 },
                { "f2", 3 }
            };
            CheckAnswer check = new CheckAnswer(dictTest);

            check.Formula = "(f1+ f2)*f2)";

            Assert.AreEqual(expected, check.Check());
        }
Пример #9
0
        public void CheckAsnwerF1andF2_resultmin2()
        {
            string expected = "-2";

            Dictionary <string, double> dictTest = new Dictionary <string, double>
            {
                { "f1", 5 },
                { "f2", 3 }
            };

            CheckAnswer check = new CheckAnswer(dictTest);

            check.Formula = "F2 -       F1";

            Assert.AreEqual(expected, check.Check());
        }
Пример #10
0
        public void UnknownData_Error()
        {
            string expected = "UnknownData Error!";

            Dictionary <string, double> dictTest = new Dictionary <string, double>
            {
                { "f1", 5 },
                { "f2", 3 }
            };

            CheckAnswer check = new CheckAnswer(dictTest);

            check.Formula = "HB";

            Assert.AreEqual(expected, check.Check());
        }
Пример #11
0
        public void CheckAsnwer10and10_result20()
        {
            int result = 20;

            Dictionary <string, double> dictTest = new Dictionary <string, double>
            {
                { "f1", 5 },
                { "f2", 3 }
            };

            CheckAnswer check = new CheckAnswer(dictTest);


            check.Formula = "10 +       10";

            Assert.AreEqual(check.Check(), result.ToString());
        }
Пример #12
0
        private static string AskQuestion(string question, CheckAnswer isAnswerAcceptable = null)
        {
            if (isAnswerAcceptable == null)
            {
                isAnswerAcceptable = YesMan;
            }

            string answer = null;

            while (answer == null)
            {
                Console.WriteLine(question);
                answer = Console.ReadLine();
                if (String.IsNullOrWhiteSpace(answer) || !isAnswerAcceptable(answer))
                {
                    Console.Clear();
                    Console.WriteLine("Riiiight...");
                    answer = null;
                }
            }
            Console.Clear();

            return(answer.Trim());
        }
Пример #13
0
 private void Awake()
 {
     instance = this;
 }
 public CheckedAnswerViewModel(CheckAnswer model, IControlName parent)
 {
     _model  = model;
     _parent = parent;
 }
Пример #15
0
 void Start()
 {
     instantce = this;
 }
Пример #16
0
        private CheckAnswer ProcessCheck(CheckRequest checkRequest)
        {
            var сheckAnswer = new CheckAnswer();

            return(сheckAnswer);
        }
Пример #17
0
        private void Select_Click(object sender, EventArgs e)
        {
            int num_value = id_value[listBox1.SelectedIndex];                //номер выбранного разрешенного значения
            int numFact   = id_facts[0];                                     //номер факта

            creator.WriteLabel(numFact, num_value);                          //запись меток
            listBox2.Items.Add(textBox1.Text + " " + listBox1.SelectedItem); //добавление в историю

            listBox1.Items.Clear();                                          //очищение
            textBox1.Text = "";

            id_facts.Clear();
            id_value.Clear();
            name_questions.Clear();

            string answer = displayer_answer.GetAnswer();

            if (answer != "")
            {
                if (!answer.Contains("*")) //если факт не содержит звездочки, то есть он целевой
                {
                    MessageBox.Show(answer);
                }
                else
                {
                    if (!listBox3.Items.Contains(answer))
                    {
                        listBox3.Items.Add(answer); //иначе факт промежуточный. Добавляем в список, расставляем метки, опрашиваем
                    }

                    Get_All_Questions(); //получить отфильтрованные факты
                    try
                    {
                        int numFactNext = id_facts[0]; //берет ID самого первого факта из отфильтрованных. Предыдущего факта нет
                        textBox1.Text = name_questions[0];
                        AddValues(numFactNext);        //выводит разрешенные значения факта
                    }
                    catch
                    {
                        CheckAnswer displayer = new CheckAnswer();
                        string      answer1   = displayer.GetEndAnswer();
                        MessageBox.Show(answer1);
                        Select.Enabled = false;
                    }
                }
            }
            else
            {
                //MessageBox.Show(answer);
                Get_All_Questions(); //получить отфильтрованные факты
                try
                {
                    int numFactNext = id_facts[0]; //берет ID самого первого факта из отфильтрованных. Предыдущего факта нет
                    textBox1.Text = name_questions[0];
                    AddValues(numFactNext);        //выводит разрешенные значения факта
                }
                catch
                {
                    CheckAnswer displayer = new CheckAnswer();
                    string      answer1   = displayer.GetEndAnswer();
                    MessageBox.Show(answer1);
                    Select.Enabled = false;
                }
            }
        }