コード例 #1
0
        public TestsViewModel(PageService pageService, UserService userService, TestsRestClient testsClient, StudentsRestClient studentsClient, QuestionsRestClient questionsRestClient, StudentAnswersRestClient studentAnswersClient)
        {
            _pageService = pageService;
            _userService = userService;

            _testsClient          = testsClient;
            _studentsClient       = studentsClient;
            _questionsClient      = questionsRestClient;
            _studentAnswersClient = studentAnswersClient;

            Tests.Clear();
            Tests = new ObservableCollection <dynamic>(HttpResponseMessageConverter.GetResult <List <dynamic> >(_testsClient.GetTests()));
        }
コード例 #2
0
        public PassingTheTestViewModel(PageService pageService, UserService userService, TestsRestClient testsClient, AnswersRestClient answersClient, StudentsRestClient studentsClient, QuestionsRestClient questionsClient, StudentAnswersRestClient studentAnswersClient)
        {
            _pageService = pageService;
            _userService = userService;

            _testsClient          = testsClient;
            _answersClient        = answersClient;
            _studentsClient       = studentsClient;
            _questionsClient      = questionsClient;
            _studentAnswersClient = studentAnswersClient;

            if (TestId != null)
            {
                Test = HttpResponseMessageConverter.GetResult <dynamic>(_testsClient.GetTestById((int)TestId));

                InitTimer();
                FormQuestions();

                ActiveQuestion = Questions[0];

                Answers.Clear();
                Answers = new ObservableCollection <dynamic>(HttpResponseMessageConverter.GetResult <List <dynamic> >(_answersClient.GetAnswersByQuestionId(Convert.ToInt32(ActiveQuestion.id))));
            }
        }