public RegistrationViewModel(PageService pageService, RolesRestClient rolesClient, GroupsRestClient groupsClient, AccountsRestClient accountsClient, StudentsRestClient studentsClient) { _pageService = pageService; _rolesClient = rolesClient; _groupsClient = groupsClient; _accountsClient = accountsClient; _studentsClient = studentsClient; Groups = HttpResponseMessageConverter.GetResult <List <dynamic> >(_groupsClient.GetGroups()); }
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())); }
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)))); } }