parent
7f0c51024e
commit
30d59f979c
@ -0,0 +1,12 @@
|
|||||||
|
const express = require('express');
|
||||||
|
const router = express.Router();
|
||||||
|
const resultController = require('../controllers/results');
|
||||||
|
const { protect, authorize } = require('../middlewares/auth');
|
||||||
|
|
||||||
|
router.post('/', protect, resultController.submitResult);
|
||||||
|
router.get('/my-results', protect, resultController.getUserResults);
|
||||||
|
|
||||||
|
// 以下路由需要教师或管理员权限
|
||||||
|
router.get('/exam/:id', protect, authorize('teacher', 'admin'), resultController.getExamResults);
|
||||||
|
|
||||||
|
module.exports = router;
|
Loading…
Reference in new issue