/// <summary> /// Get exam takers /// </summary> private async Task GetExamTakers() { var(err, takers) = await ExamServices.GetTestTakers(_examId); if (err == ErrorCodes.Success) { _examTakerVideoCards = new ExamTakerVideoCard[takers.Count]; _testTakers = takers; } }
protected override async Task OnInitializedAsync() { if (!int.TryParse(ExamId, out _examId)) { await Modal.ErrorAsync(new ConfirmOptions() { Title = "Invalid exam ID" }); return; } var(res, details) = await ExamServices.GetExamDetails(_examId); if (res != ErrorCodes.Success) { await Modal.ErrorAsync(new ConfirmOptions() { Title = "Failed to obtain exam information", Content = ErrorCodes.MessageMap[res] }); return; } _model = details; var(res2, takers) = await ExamServices.GetTestTakers(_examId); if (res2 != ErrorCodes.Success) { await Modal.ErrorAsync(new ConfirmOptions() { Title = "Failed to obtain list of exam takers", Content = ErrorCodes.MessageMap[res2] }); return; } _takers = takers; var(res3, proctors) = await ExamServices.GetProctors(_examId); if (res3 != ErrorCodes.Success) { await Modal.ErrorAsync(new ConfirmOptions() { Title = "Failed to obtain list of exam proctors", Content = ErrorCodes.MessageMap[res3] }); return; } _proctors = proctors; var(res4, questions) = await ExamServices.GetPaper(_examId); if (res4 != ErrorCodes.Success) { await Modal.ErrorAsync(new ConfirmOptions() { Title = "Failed to obtain questions", Content = ErrorCodes.MessageMap[res4] }); return; } _questions = questions; }