You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
515 B

const express = require('express');
const router = express.Router();
const examController = require('../controllers/exams');
const { protect, authorize } = require('../middlewares/auth');
router.get('/', examController.getExams);
router.get('/:id', examController.getExam);
router.post('/:id/validate', protect, examController.validateAnswers);
// 以下路由需要教师或管理员权限
router.post('/', protect, authorize('teacher', 'admin'), examController.createExam);
module.exports = router;