Example #1
0
        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"));
            }
        }
Example #2
0
 public StartController(SQLTeacherContext context)
 {
     _context = context;
 }
Example #3
0
 public ApiController(SQLTeacherContext context, IConfiguration configuration)
 {
     _context       = context;
     _configuration = configuration;
 }
 public ExercisesController(SQLTeacherContext context)
 {
     _context = context;
 }
Example #5
0
 public QueriesController(SQLTeacherContext context)
 {
     _context = context;
 }