Merge remote-tracking branch 'origin/dev' into feature/own-learning-objects
# Conflicts: # backend/package.json # backend/src/config.ts # backend/src/controllers/learningObjects.ts # backend/src/controllers/learningPaths.ts # backend/src/data/content/attachment-repository.ts # backend/src/data/content/learning-object-repository.ts # backend/src/data/content/learning-path-repository.ts # backend/src/data/repositories.ts # backend/src/entities/content/learning-path.entity.ts # backend/src/exceptions.ts # backend/src/routes/learning-objects.ts # backend/src/services/learningObjects.ts # backend/src/services/learningPaths.ts # backend/src/util/apiHelper.ts # backend/src/util/envvars.ts # package-lock.json
This commit is contained in:
commit
cd0a3a8a7b
119 changed files with 8837 additions and 1697 deletions
|
@ -1,23 +1,20 @@
|
|||
import express from 'express'
|
||||
import express from 'express';
|
||||
const router = express.Router();
|
||||
|
||||
// root endpoint used to search objects
|
||||
// Root endpoint used to search objects
|
||||
router.get('/', (req, res) => {
|
||||
res.json({
|
||||
assignments: [
|
||||
'0',
|
||||
'1',
|
||||
]
|
||||
assignments: ['0', '1'],
|
||||
});
|
||||
});
|
||||
|
||||
// information about an assignment with id 'id'
|
||||
// Information about an assignment with id 'id'
|
||||
router.get('/:id', (req, res) => {
|
||||
res.json({
|
||||
id: req.params.id,
|
||||
title: 'Dit is een test assignment',
|
||||
description: 'Een korte beschrijving',
|
||||
groups: [ '0' ],
|
||||
groups: ['0'],
|
||||
learningPath: '0',
|
||||
class: '0',
|
||||
links: {
|
||||
|
@ -25,30 +22,24 @@ router.get('/:id', (req, res) => {
|
|||
submissions: `${req.baseUrl}/${req.params.id}`,
|
||||
},
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
router.get('/:id/submissions', (req, res) => {
|
||||
res.json({
|
||||
submissions: [
|
||||
'0'
|
||||
],
|
||||
submissions: ['0'],
|
||||
});
|
||||
});
|
||||
|
||||
router.get('/:id/groups', (req, res) => {
|
||||
res.json({
|
||||
groups: [
|
||||
'0'
|
||||
],
|
||||
groups: ['0'],
|
||||
});
|
||||
});
|
||||
|
||||
router.get('/:id/questions', (req, res) => {
|
||||
res.json({
|
||||
questions: [
|
||||
'0'
|
||||
],
|
||||
questions: ['0'],
|
||||
});
|
||||
});
|
||||
|
||||
export default router
|
||||
export default router;
|
||||
|
|
23
backend/src/routes/auth.ts
Normal file
23
backend/src/routes/auth.ts
Normal file
|
@ -0,0 +1,23 @@
|
|||
import express from 'express';
|
||||
import { getFrontendAuthConfig } from '../controllers/auth.js';
|
||||
import { authenticatedOnly, studentsOnly, teachersOnly } from '../middleware/auth/auth.js';
|
||||
const router = express.Router();
|
||||
|
||||
// Returns auth configuration for frontend
|
||||
router.get('/config', (req, res) => {
|
||||
res.json(getFrontendAuthConfig());
|
||||
});
|
||||
|
||||
router.get('/testAuthenticatedOnly', authenticatedOnly, (req, res) => {
|
||||
res.json({ message: 'If you see this, you should be authenticated!' });
|
||||
});
|
||||
|
||||
router.get('/testStudentsOnly', studentsOnly, (req, res) => {
|
||||
res.json({ message: 'If you see this, you should be a student!' });
|
||||
});
|
||||
|
||||
router.get('/testTeachersOnly', teachersOnly, (req, res) => {
|
||||
res.json({ message: 'If you see this, you should be a teacher!' });
|
||||
});
|
||||
|
||||
export default router;
|
|
@ -1,55 +1,46 @@
|
|||
import express from 'express'
|
||||
import express from 'express';
|
||||
const router = express.Router();
|
||||
|
||||
// root endpoint used to search objects
|
||||
// Root endpoint used to search objects
|
||||
router.get('/', (req, res) => {
|
||||
res.json({
|
||||
classes: [
|
||||
'0',
|
||||
'1',
|
||||
]
|
||||
classes: ['0', '1'],
|
||||
});
|
||||
});
|
||||
|
||||
// information about an class with id 'id'
|
||||
// Information about an class with id 'id'
|
||||
router.get('/:id', (req, res) => {
|
||||
res.json({
|
||||
id: req.params.id,
|
||||
displayName: 'Klas 4B',
|
||||
teachers: [ '0' ],
|
||||
students: [ '0' ],
|
||||
joinRequests: [ '0' ],
|
||||
teachers: ['0'],
|
||||
students: ['0'],
|
||||
joinRequests: ['0'],
|
||||
links: {
|
||||
self: `${req.baseUrl}/${req.params.id}`,
|
||||
classes: `${req.baseUrl}/${req.params.id}/invitations`,
|
||||
questions: `${req.baseUrl}/${req.params.id}/assignments`,
|
||||
students: `${req.baseUrl}/${req.params.id}/students`,
|
||||
}
|
||||
},
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
router.get('/:id/invitations', (req, res) => {
|
||||
res.json({
|
||||
invitations: [
|
||||
'0'
|
||||
],
|
||||
invitations: ['0'],
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
router.get('/:id/assignments', (req, res) => {
|
||||
res.json({
|
||||
assignments: [
|
||||
'0'
|
||||
],
|
||||
assignments: ['0'],
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
router.get('/:id/students', (req, res) => {
|
||||
res.json({
|
||||
students: [
|
||||
'0'
|
||||
],
|
||||
students: ['0'],
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
export default router
|
||||
export default router;
|
||||
|
|
|
@ -1,34 +1,31 @@
|
|||
import express from 'express'
|
||||
import express from 'express';
|
||||
const router = express.Router();
|
||||
|
||||
// root endpoint used to search objects
|
||||
// Root endpoint used to search objects
|
||||
router.get('/', (req, res) => {
|
||||
res.json({
|
||||
groups: [
|
||||
'0',
|
||||
'1',
|
||||
]
|
||||
groups: ['0', '1'],
|
||||
});
|
||||
});
|
||||
|
||||
// information about a group (members, ... [TODO DOC])
|
||||
// Information about a group (members, ... [TODO DOC])
|
||||
router.get('/:id', (req, res) => {
|
||||
res.json({
|
||||
id: req.params.id,
|
||||
assignment: '0',
|
||||
students: [ '0' ],
|
||||
submissions: [ '0' ],
|
||||
// reference to other endpoint
|
||||
// should be less hardcoded
|
||||
questions: `/group/${req.params.id}/question`,
|
||||
students: ['0'],
|
||||
submissions: ['0'],
|
||||
// Reference to other endpoint
|
||||
// Should be less hardcoded
|
||||
questions: `/group/${req.params.id}/question`,
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
// the list of questions a group has made
|
||||
// The list of questions a group has made
|
||||
router.get('/:id/question', (req, res) => {
|
||||
res.json({
|
||||
questions: [ '0' ],
|
||||
questions: ['0'],
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
export default router
|
||||
export default router;
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
import express from 'express'
|
||||
const router = express.Router();
|
||||
|
||||
// returns login paths for IDP
|
||||
router.get('/', (req, res) => {
|
||||
res.json({
|
||||
// dummy variables, needs to be changed
|
||||
// with IDP endpoints
|
||||
leerkracht: '/login-leerkracht',
|
||||
leerling: '/login-leerling',
|
||||
});
|
||||
})
|
||||
|
||||
export default router
|
|
@ -1,17 +1,14 @@
|
|||
import express from 'express'
|
||||
import express from 'express';
|
||||
const router = express.Router();
|
||||
|
||||
// root endpoint used to search objects
|
||||
// Root endpoint used to search objects
|
||||
router.get('/', (req, res) => {
|
||||
res.json({
|
||||
questions: [
|
||||
'0',
|
||||
'1',
|
||||
]
|
||||
questions: ['0', '1'],
|
||||
});
|
||||
});
|
||||
|
||||
// information about an question with id 'id'
|
||||
// Information about an question with id 'id'
|
||||
router.get('/:id', (req, res) => {
|
||||
res.json({
|
||||
id: req.params.id,
|
||||
|
@ -23,16 +20,14 @@ router.get('/:id', (req, res) => {
|
|||
links: {
|
||||
self: `${req.baseUrl}/${req.params.id}`,
|
||||
answers: `${req.baseUrl}/${req.params.id}/answers`,
|
||||
}
|
||||
},
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
router.get('/:id/answers', (req, res) => {
|
||||
res.json({
|
||||
answers: [
|
||||
'0'
|
||||
],
|
||||
})
|
||||
})
|
||||
answers: ['0'],
|
||||
});
|
||||
});
|
||||
|
||||
export default router
|
||||
export default router;
|
||||
|
|
|
@ -1,17 +1,14 @@
|
|||
import express from 'express'
|
||||
import express from 'express';
|
||||
const router = express.Router();
|
||||
|
||||
// root endpoint used to search objects
|
||||
// Root endpoint used to search objects
|
||||
router.get('/', (req, res) => {
|
||||
res.json({
|
||||
students: [
|
||||
'0',
|
||||
'1',
|
||||
]
|
||||
students: ['0', '1'],
|
||||
});
|
||||
});
|
||||
|
||||
// information about a student's profile
|
||||
// Information about a student's profile
|
||||
router.get('/:id', (req, res) => {
|
||||
res.json({
|
||||
id: req.params.id,
|
||||
|
@ -27,33 +24,32 @@ router.get('/:id', (req, res) => {
|
|||
});
|
||||
});
|
||||
|
||||
// the list of classes a student is in
|
||||
// The list of classes a student is in
|
||||
router.get('/:id/classes', (req, res) => {
|
||||
res.json({
|
||||
classes: [ '0' ],
|
||||
classes: ['0'],
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
// the list of submissions a student has made
|
||||
// The list of submissions a student has made
|
||||
router.get('/:id/submissions', (req, res) => {
|
||||
res.json({
|
||||
submissions: [ '0' ],
|
||||
submissions: ['0'],
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
// the list of assignments a student has
|
||||
// The list of assignments a student has
|
||||
router.get('/:id/assignments', (req, res) => {
|
||||
res.json({
|
||||
assignments: [ '0' ],
|
||||
assignments: ['0'],
|
||||
});
|
||||
})
|
||||
|
||||
// the list of groups a student is in
|
||||
});
|
||||
|
||||
// The list of groups a student is in
|
||||
router.get('/:id/groups', (req, res) => {
|
||||
res.json({
|
||||
groups: [ '0' ],
|
||||
groups: ['0'],
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
export default router
|
||||
export default router;
|
||||
|
|
|
@ -1,17 +1,14 @@
|
|||
import express from 'express'
|
||||
import express from 'express';
|
||||
const router = express.Router();
|
||||
|
||||
// root endpoint used to search objects
|
||||
// Root endpoint used to search objects
|
||||
router.get('/', (req, res) => {
|
||||
res.json({
|
||||
submissions: [
|
||||
'0',
|
||||
'1',
|
||||
]
|
||||
submissions: ['0', '1'],
|
||||
});
|
||||
});
|
||||
|
||||
// information about an submission with id 'id'
|
||||
// Information about an submission with id 'id'
|
||||
router.get('/:id', (req, res) => {
|
||||
res.json({
|
||||
id: req.params.id,
|
||||
|
@ -21,6 +18,6 @@ router.get('/:id', (req, res) => {
|
|||
content: 'Wortel 2 is rationeel',
|
||||
learningObject: '0',
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
export default router
|
||||
export default router;
|
||||
|
|
|
@ -1,17 +1,14 @@
|
|||
import express from 'express'
|
||||
import express from 'express';
|
||||
const router = express.Router();
|
||||
|
||||
// root endpoint used to search objects
|
||||
// Root endpoint used to search objects
|
||||
router.get('/', (req, res) => {
|
||||
res.json({
|
||||
teachers: [
|
||||
'0',
|
||||
'1',
|
||||
]
|
||||
teachers: ['0', '1'],
|
||||
});
|
||||
});
|
||||
|
||||
// information about a teacher
|
||||
// Information about a teacher
|
||||
router.get('/:id', (req, res) => {
|
||||
res.json({
|
||||
id: req.params.id,
|
||||
|
@ -25,34 +22,27 @@ router.get('/:id', (req, res) => {
|
|||
invitations: `${req.baseUrl}/${req.params.id}/invitations`,
|
||||
},
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
// the questions students asked a teacher
|
||||
// The questions students asked a teacher
|
||||
router.get('/:id/questions', (req, res) => {
|
||||
res.json({
|
||||
questions: [
|
||||
'0'
|
||||
],
|
||||
questions: ['0'],
|
||||
});
|
||||
});
|
||||
|
||||
// invitations to other classes a teacher received
|
||||
// Invitations to other classes a teacher received
|
||||
router.get('/:id/invitations', (req, res) => {
|
||||
res.json({
|
||||
invitations: [
|
||||
'0'
|
||||
],
|
||||
invitations: ['0'],
|
||||
});
|
||||
});
|
||||
|
||||
// a list with ids of classes a teacher is in
|
||||
// A list with ids of classes a teacher is in
|
||||
router.get('/:id/classes', (req, res) => {
|
||||
res.json({
|
||||
classes: [
|
||||
'0'
|
||||
],
|
||||
classes: ['0'],
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
export default router
|
||||
export default router;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue