Exemplo n.º 1
0
        void AddQuizText()
        {
            Console.Clear();
            WriteLine("ADD TEXT QUIZ____________________________");
            WriteLine("\n");
            WriteLine(instructionsQuestion);
            Write(">");
            string question = ReadLine();

            WriteLine("\n");
            WriteLine("Please enter the answer.");
            Write(">");

            string userAnswer = ReadLine();

            Answer   answer  = new Answer(userAnswer, true);
            QuizText element = new QuizText(question, answer);

            string updatedJson = AddObjectsToJson(pathText, element);

            File.WriteAllText(pathText, updatedJson);
            WriteLine(updatedJson.ToString());
            WriteLine("New quiz element successfully added!");
            WriteLine("\n");
            Thread.Sleep(5000);

            Menu();
        }
Exemplo n.º 2
0
        public QuizText AddQuizText()
        {
            WriteLine(instructionsQuestion);
            Write(">");
            string question = ReadLine();

            WriteLine("Please enter the answer.");
            Write(">");
            string userAnswer = ReadLine();

            Answer   answer   = new Answer(userAnswer, true);
            QuizText quizText = new QuizText(question, answer);

            return(quizText);
        }