public IActionResult GenerateConfig() { var model = new GenerateConfigViewModel(); model.CanvasBaseUrl = appSettings.CanvasBaseUrl; return(View(model)); }
public async Task <IActionResult> GenerateConfig(GenerateConfigViewModel model) { try { var quizExists = await canvasClient.GetStringAsync($"api/v1/courses/{model.CourseId}/quizzes/{model.QuizId}"); return(RedirectToAction(nameof(Config), new { courseId = model.CourseId, quizId = model.QuizId, scoreReq = model.ScoreRequirement })); } catch (Exception ex) { ModelState.AddModelError("QuizDNE", "Quiz with specified ID not found. Note that it may take up to 48" + " hours for a newly created quiz to show up in the database."); } return(View(model)); }