public IActionResult Index(SQLTeacherContext context) { setStaticVariables(); // Check roles and open the right page if (_currentUser == null) { return(RedirectToAction("Exam", "Queries")); } else if (_currentUser.Role.Name == "teacher") { return(RedirectToAction("Index", "Exercises")); } else if (_currentUser.Role.Name == "student") { return(RedirectToAction("Exam", "Queries")); } else { return(RedirectToAction("Exam", "Queries")); } }
public StartController(SQLTeacherContext context) { _context = context; }
public ApiController(SQLTeacherContext context, IConfiguration configuration) { _context = context; _configuration = configuration; }
public ExercisesController(SQLTeacherContext context) { _context = context; }
public QueriesController(SQLTeacherContext context) { _context = context; }