/// <summary> /// get exam information by exam id /// </summary> /// <param name="id">examid</param> /// <returns>exam information datatable</returns> public ExamDS.examDataTable GetExamById(int id) { ExamManager examManager = new ExamManager(); ExamDS.examDataTable dataTable = new ExamDS.examDataTable(); dataTable.Merge(examManager.GetExamById(id)); return(dataTable); }
public void TestGetExamById() { ExamDS.examDataTable table = examManager.GetExamById(examId); foreach (var item in table) { Assert.AreEqual("computer", item.exam_name); Assert.AreEqual(60, item.pass_criteria); } }
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); } }