Ejemplo n.º 1
0
        public JsonTestController ToJson()
        {
            var test = new JsonTestController {
                Reoccurrences              = Reoccurrences,
                NumberOfQuestions          = NumberOfQuestions,
                NumberOfAnswers            = NumberOfAnswers,
                NumberOfCorrectAnswers     = NumberOfCorrectAnswers,
                NumberOfBadAnswers         = NumberOfBadAnswers,
                NumberOfLearnedQuestions   = NumberOfLearnedQuestions,
                NumberOfRemainingQuestions = NumberOfRemainingQuestions,
                Time = Time
            };

            return(test);
        }
Ejemplo n.º 2
0
        public static TestController FromJson(JsonTestController jsonTestController, IDictionary <string, IQuestion> questions, string token)
        {
            //TODO should recalculate integers instead of get from json
            var test = new TestController {
                FolderToken                = token,
                Questions                  = questions,
                Reoccurrences              = jsonTestController.Reoccurrences, //TODO only reoccurrences where key is in questions
                NumberOfQuestions          = jsonTestController.NumberOfQuestions,
                NumberOfAnswers            = jsonTestController.NumberOfAnswers,
                NumberOfCorrectAnswers     = jsonTestController.NumberOfCorrectAnswers,
                NumberOfBadAnswers         = jsonTestController.NumberOfBadAnswers,
                NumberOfLearnedQuestions   = jsonTestController.NumberOfLearnedQuestions,
                NumberOfRemainingQuestions = jsonTestController.NumberOfRemainingQuestions,
                Time = jsonTestController.Time
            };

            test.PrepareTimer();
            return(test);
        }