
# Conflicts: # backend/src/controllers/classes.ts # backend/src/controllers/students.ts # backend/src/data/users/teacher-repository.ts # backend/src/interfaces/assignment.ts # backend/src/interfaces/teacher.ts # backend/src/routes/classes.ts # backend/src/services/assignments.ts # backend/src/services/class.ts # backend/src/services/students.ts # backend/src/util/translation-helper.ts
31 lines
714 B
TypeScript
31 lines
714 B
TypeScript
import express from 'express'
|
|
import { getAllAssignmentsHandler, getAssignmentHandler } from '../controllers/assignments.js';
|
|
import groupRouter from './group.js';
|
|
|
|
const router = express.Router({ mergeParams: true });
|
|
|
|
// root endpoint used to search objects
|
|
router.get('/', getAllAssignmentsHandler);
|
|
|
|
// information about an assignment with id 'id'
|
|
router.get('/:id', getAssignmentHandler);
|
|
|
|
router.get('/:id/submissions', (req, res) => {
|
|
res.json({
|
|
submissions: [
|
|
'0'
|
|
],
|
|
});
|
|
});
|
|
|
|
router.get('/:id/questions', (req, res) => {
|
|
res.json({
|
|
questions: [
|
|
'0'
|
|
],
|
|
});
|
|
});
|
|
|
|
router.use('/:assignmentid/groups', groupRouter);
|
|
|
|
export default router
|