Ejemplo n.º 1
0
        public CreateExamViewModel()
        {
            try
            {
                Response <List <QualificationModel> > response = qualificationManager.GetAllQualifications();

                List <QualificationModel> data = response.Data;

                foreach (var qualif in data)
                {
                    QualifsList.Add(qualif.Code);
                }

                Response <List <ClassSimpleModel> > responseClass = userManager.GetAllClasses();

                List <ClassSimpleModel> dataClass = responseClass.Data;

                foreach (var className in dataClass)
                {
                    ClassesList.Add(className.ClassName);
                }
            }
            catch (Exception exception)
            {
                NotifyMessageViewVisibility.ShowMessageView("Błąd!", exception.Message);
            }
        }
Ejemplo n.º 2
0
        public CreateQuestionViewModel()
        {
            try
            {
                Response <List <QualificationModel> > response = qualificationManager.GetAllQualifications();

                List <QualificationModel> data = response.Data;

                foreach (var qualif in data)
                {
                    QualifsList.Add(qualif.Code);
                }
            }
            catch (Exception exception)
            {
                NotifyMessageViewVisibility.ShowMessageView("Błąd!", exception.Message);
            }
        }
        public FinishedExamViewModel(string id)
        {
            try
            {
                Response <FinishedExamModel> response = examManager.GetExamById(id);

                FinishedExamModel data = response.Data;

                int index = 1;
                foreach (var question in data.Questions)
                {
                    Questions.Add(new FinishedExamQuestionListItemViewModel(index, question, this));
                    index++;
                }

                SelectedQuestion = Questions[0];
            }
            catch (Exception exception)
            {
                NotifyMessageViewVisibility.ShowMessageView("Błąd!", exception.Message);
            }
        }